On 03.11.2017 14:00, Fred Kruse wrote:
I'm working on LanguageTool an international grammar checker (java based
extension for LibreOffice). Till now the environment of a sentences is
checked only for the surrounding paragraph. But some rules need to check
the whole text. To implement such a check I need to know which paragraph
is currently checked (TextRange).
Is there a possibility to get the TextRange for the checked paragraph
while doProofreading is processed?
not currently, and i wonder if it's intentional.
the string that is passed to doProofreading is pre-processed and doesn't
correspond 1:1 to the text in the paragraph, so you can't really know
where any given XTextRange is relative to that string, and not every
position in the string has a corresponding XTextRange...
the GrammarCheckingIterator iterator uses the SwXFlatParagraphIterator
to get the "dirty" paragraphs, and there doesn't appear to be any way to
get XTextRange for them.
on the other hand, there are XFlatParagraph methods like changeText and
changeAttributes that don't do this mapping, which looks like a bug?
these aren't used by the GrammarCheckingIterator, i wonder why they exist?
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.