Hi Aidan,

after a first short look, it seems to be a bug and you shoul submit an issue.

- Juergen

Aidan Butler wrote:
Hi,
yes I have noticed that as well. I think that it has something to do with the redline itself, rather than the position of the cursor. That is, if the range that is to be enumerated starts inside the redline, the enumeration does not work correctly.
-Aidan

sos wrote:

Aidan,

I tryed out your macro and indeed: strange behaviour but I think its comming from the fact that in the document there is just your paragraph with only 2 words "delete and instert" the document starts with this "redline" stuff put some extra text or even a new paragrph before the "redline" portion and your second macro is working normaly as well

Fernand.


At 12:49 7/10/05, you wrote:

Hello All,
I am seeing a bug when enumerating text portions within a paragraph. I have created a paragraph consisting of the word "Delete". I then turned on Change Tracking and inserted the word "Insert" and deleted the original word "Delete". I now have 2 redlines, a Deletion and an Insertion.

The first macro below returns the following output:
   "Redline Start"
   "Delete"
   "Redline End"
   "Redline Start"
   "Insert"
   "Redline End"

The second macro just moves the start range by one but just returns:
   "eleteInsert"

No redline portion is being detected. Is this a bug? Am I doing something incorrectly?

Regards,
-Aidan


rem First Macro
Sub Main
oDocument = ThisComponent
oText = oDocument.Text
oCursor = oText.createTextCursor
oCursor.goRight(0,False)
oCursor.GotoEnd(True)
enum = oCursor.createEnumeration()


While enum.hasMoreElements()
   element = enum.nextElement()
   newenum = element.createEnumeration()
   While newenum.hasMoreElements()
       newelement = newenum.nextElement()
If newelement.supportsService( "com.sun.star.text.TextPortion") Then
           if newelement.TextPortionType = "Redline" Then
                   if newelement.IsStart Then
                        msgbox "Redline Start"
                    Else
                        msgbox "Redline End"
                    End IF
           Else
               msgbox newelement.getString()
           End If
       End If
wend
Wend

End Sub


rem Second Macro
Sub Main
oDocument = ThisComponent
oText = oDocument.Text
oCursor = oText.createTextCursor
oCursor.goRight(1,False)
oCursor.GotoEnd(True)
enum = oCursor.createEnumeration()


While enum.hasMoreElements()
   element = enum.nextElement()
   newenum = element.createEnumeration()
   While newenum.hasMoreElements()
       newelement = newenum.nextElement()
If newelement.supportsService( "com.sun.star.text.TextPortion") Then
           if newelement.TextPortionType = "Redline" Then
                   if newelement.IsStart Then
                        msgbox "Redline Start"
                    Else
                        msgbox "Redline End"
                    End IF
           Else
               msgbox newelement.getString()
           End If
       End If
wend
Wend

End Sub







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to