Hi,
I posted this on oooforum.org already
(http://www.oooforum.org/forum/viewtopic.phtml?t=44933) but it wasn't
completly solved, so I need to try here again.
[...] The next problem is that I need to get the text and check it, then
navigate to given positions and select them (this is for my grammar
checker, LanguageTool). I can use the following code to navigate to given
positions, but it seems to count in a different way than the code above
(i.e. using XEnumerationAccess):
XTextCursor cursor = xTextDoc.getText().createTextCursor();
XParagraphCursor xParagraphCursor = (XParagraphCursor)
UnoRuntime.queryInterface(XParagraphCursor.class, cursor);
boolean hasNextParagraph = true;
while (hasNextParagraph) {
if (paraCount == paragraphNumber) {
xParagraphCursor.gotoStartOfParagraph(false);
xParagraphCursor.goRight(..., false);
}
hasNextParagraph = xParagraphCursor.gotoNextParagraph(false);
}
So when I find an error in, say, "paragraph 10, characters 5 to 8", I
cannot use this code to navigate there because it seems to count tables
differently (namely it ignores them) and I end up in paragraph 11 instead
of 10 with the wrong text selected.
So how can I combine the first way of iterating over text
(XEnumerationAccess) with using the cursor to go right/left/select? In
other words, if I have an XEnumeration and XEnumerationAccess, how do I
get an XParagraphCursor for that?
regards
Daniel
--
http://www.danielnaber.de
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]