To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=76449
                 Issue #|76449
                 Summary|CurrentSelection (writer) returns wrong values
               Component|api
                 Version|OOo 2.2
                Platform|PC
                     URL|
              OS/Version|All
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|code
             Assigned to|jsc
             Reported by|mroe





------- Additional comments from [EMAIL PROTECTED] Tue Apr 17 14:25:35 +0000 
2007 -------
Try the following code at a text document.

Sub Testselect
 Dim oDoc As Object
 Dim oSelection As Object
 Dim i As Integer
 Dim s As String
 oDoc = ThisComponent
 oSelection = ThisComponent.CurrentSelection
 s = ""
 If oSelection.hasElements() Then
 For i = 0 To oSelection.getCount() - 1
 If i > 0 Then s = s & chr( 13 )
 s = s & Format( i, "00" ) & (": ") & oSelection.getByIndex( i ).getString()
 Next i
 MsgBox( s )
 Else
 MsgBox( "no selection" )
 End If
End Sub

Problems:
1. oSelection.hasElements() is even True if nothing is selected.
2. oSelection.getCount() returns 1 if nothing is selected or there exits one
selection.
3. oSelection.getCount() returns n + 1 if n ranges are selected (n > 1).
4. Exists only one selection then oSelection.getByIndex( 0 ) returns the 
selection.
5. Exists n > 1 selections then oSelection.getByIndex( 0 ) is empty and
oSelection.getByIndex( 1 ) to oSelection.getByIndex( n ) returns the selections.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
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