redlines for pyuno

James Michael DuPont jmdpplks at gmail.com
Thu Aug 8 09:21:53 PDT 2013


Thanks Andrew,
that is basically what I had to do, there are cases where you can skip over
looking at all redlines because of the order but that is the algorithm I
needed to do. Otherwise an idea would be apply a temporary marking to the
text or a style that would externalize the redline and then use that to
find out where it applies to, and then remove it later... ugg.
mike


On Thu, Aug 8, 2013 at 12:00 AM, Andrew Douglas Pitonyak <
andrew at pitonyak.org> wrote:

>  I remember looking at redlines way back in the dark recesses of time, so
> I loaded up AndrewMacro.odt
>
> The best I saw there was the ability to enumerate text sections to find
> "Redline" text portion sections.
>
> If I had to determine if the cursor was currently in a redline section, my
> first guess at a solution would probably be to go looking for redlines in
> the text object containing the view cursor and then check the start and end
> point of each redline to see if it contains the cursor. Feels like a bad
> solution to me (as in it is probably slow), but it is the best that comes
> to my mind (assuming I understand your question correctly).
>
>
>
> On 08/07/2013 09:35 PM, James Michael DuPont wrote:
>
> OK, thank you for your support. I will look into this when I have time.
> Thanks,
> mike
>
>
> On Wed, Aug 7, 2013 at 2:23 PM, Miklos Vajna <vmiklos at suse.cz> wrote:
>
>> On Wed, Aug 07, 2013 at 12:33:35PM -0500, James Michael DuPont <
>> jmdpplks at gmail.com> wrote:
>> > I am feeling stupid here, so please excuse my ignorance, but I did not
>> find
>> > any api to tell me if the current cursor is in a redline, can you please
>> > point me in the right direction? I just found an api to give me the
>> list of
>> > redlines and have been checking the cursor to see if it is in one of
>> them.
>>
>>  As far as I know, that's not directly possible. Here is how I would do
>> the API for it:
>>
>> - see
>>
>> http://opengrok.libreoffice.org/xref/core/sw/source/ui/uiview/view2.cxx#639
>>   on how to check if an SwPosition (that's the internal equivalent of a
>>   position in the document model) is inside a redline using
>>   SwDoc::GetRedline()
>>
>> - it's already possible to check if the cursor is e.g. at the end of
>>   line:
>>
>>
>> http://api.libreoffice.org/docs/common/ref/com/sun/star/view/XLineCursor.html#isAtEndOfLine
>>
>>   The implementation of that is in the SwXTextViewCursor class:
>>
>>
>> http://opengrok.libreoffice.org/xref/core/sw/source/ui/uno/unotxvw.cxx#1649
>>
>> >From that, you could add a new isInRedline() method to the cursor, which
>> would return exactly what you need.
>>
>> HTH,
>>
>> Miklos
>>
>> _______________________________________________
>> LibreOffice mailing list
>> LibreOffice at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/libreoffice
>>
>>
>
>
> _______________________________________________
> LibreOffice mailing listLibreOffice at lists.freedesktop.orghttp://lists.freedesktop.org/mailman/listinfo/libreoffice
>
>
> --
> Andrew Pitonyak
> My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
> Info:  http://www.pitonyak.org/oo.php
>
>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20130808/5f7c813e/attachment.html>


More information about the LibreOffice mailing list