Issue 55624 - TextPortion Enumeration not working with redlines
Summary: TextPortion Enumeration not working with redlines
Status: CLOSED FIXED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P2 Trivial
Target Milestone: ---
Assignee: stephan.wunderlich
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-07 16:39 UTC by aidan.butler
Modified: 2013-02-24 21:09 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
bugdoc (7.60 KB, application/vnd.oasis.opendocument.text)
2005-10-12 10:49 UTC, stephan.wunderlich
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description aidan.butler 2005-10-07 16:39:47 UTC
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?




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
Comment 1 michael.ruess 2005-10-10 13:04:03 UTC
Macro Issue. Reassigned to JSK.
Comment 2 joerg.skottke 2005-10-11 12:59:21 UTC
jsk->sw: This is more API than BASIC. The BASIC API, so to speak. Ahöhö ;-)
Comment 3 stephan.wunderlich 2005-10-12 10:49:17 UTC
Created attachment 30336 [details]
bugdoc
Comment 4 stephan.wunderlich 2005-10-12 10:51:04 UTC
The attached bugdoc contains two methods ... 

executing “Works†returns the following output:
   "Redline Start"
   "Insert"
   "Redline End"
   "Redline Start"
   "Delete"
   "Redline End"

executing “Fails†which moves the start range by one, just returns
   "nsertdelete"
and no redline portion is being detected.
Comment 5 mtg 2005-11-22 16:04:53 UTC
mtg->sw,os: Going to take a look at this one under the hood. Has anyone looked
at it yet? If so, have they discovered anything that might help ? Danke.
Comment 6 mtg 2005-11-22 16:09:14 UTC
mtg->sw,os: Going to take a look at this one under the hood. Has anyone looked
at it yet? If so, have they discovered anything that might help ? Danke.
Comment 7 mtg 2005-11-24 18:11:01 UTC
Reassign to mtg, fix commited to CWS 'mtg2'.
Comment 8 mtg 2005-11-24 18:20:19 UTC
Will 'smoke test' fix tomorrow. In the mean time, if tl or os could take a look at:

http://sw.openoffice.org/source/browse/sw/sw/source/core/unocore/unoportenum.cxx?r1=1.30&r2=1.30.120.1

They could do a quick code review on my changes.

Thanks,

Martin
Comment 9 mtg 2005-11-25 15:05:46 UTC
fixed on CWS mtg2
Comment 10 mtg 2005-11-25 15:07:42 UTC
reopen for reassignment
Comment 11 mtg 2005-11-25 15:08:52 UTC
mtg->sw: Hi there, fixes for #i55624#, #i58436# and #i58438# are commited in CWS
mtg2. Can you test them please ? Thanks, Martin
Comment 12 mtg 2005-12-05 16:02:06 UTC
Fixed in CWS mtg2
Comment 13 stephan.wunderlich 2005-12-06 16:04:02 UTC
looks good in cws mtg2 => verified
Comment 14 stephan.wunderlich 2006-01-04 10:26:41 UTC
ok in src680_m148 => closed