List Info

Thread: Getting the TextFields directly of a table (Writer)




Getting the TextFields directly of a table (Writer)
user name
2007-06-13 09:23:42
Hi,

I have to process a Writer document with a lot of
TextFields. I know how to
get globally all TextFields, like:

Reference<XTextFieldsSupplier> xSupp
(xWriterComponent, UNO_QUERY);
Reference<XEnumerationAccess> enumerationAcc =
xSupp->getTextFields();
Reference<XEnumeration> enumeration =
enumerationAcc->createEnumeration();

BUT: I need to process the TextFields in tables differently.
So I have to
know which
TextFields are in the tables of the document. I can access
the text in the
table cell
like that:

Reference<XCell> cell =
table->getCellByName(OUString::createFromAscii(cellName))
;
Reference<XText > xtext (cell, UNO_QUERY);
Reference<XTextCursor > xtextc =
xtext->createTextCursor();
CString name = OUStringToOString(xtextc->getString(),
RTL_TEXTENCODING_ASCII_US).getStr();

But how can I access the content of the TextField in the
cell?!

Thanks for your help.

Regards, Michael
Re: Getting the TextFields directly of a table (Writer)
user name
2007-06-13 09:44:06
Hi Micheal

> But how can I access the content of the TextField in
the cell?!
>

Look at the anchors and compare their relative position
with for example compareRegionEnds method

Laurent


-- 
Laurent Godard <lgodardindesko.com> -
Ingénierie OpenOffice.org - 
http://www.indesko.com
Nuxeo Enterprise Content Management >> http://www.nuxeo.com - 
http://www.nuxeo.org
Livre "Programmation OpenOffice.org", Eyrolles
2004-2006

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )