To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=53001
                  Issue #:|53001
                  Summary:|Loss text while grouping shapes with OOoBasic
                Component:|api
                  Version:|OOo 1.1.4
                 Platform:|PC
                      URL:|
               OS/Version:|Windows XP
                   Status:|UNCONFIRMED
        Status whiteboard:|
                 Keywords:|
               Resolution:|
               Issue type:|DEFECT
                 Priority:|P2
             Subcomponent:|code
              Assigned to:|sw
              Reported by:|arkas





------- Additional comments from [EMAIL PROTECTED] Sun Aug  7 09:13:33 -0700 
2005 -------
If you group shapes, who are created and filled with text by
OpenOfficeBasic-Makro, save, close and reopen the doc so the text of the last
shape has been removed. But before closing the doc the text was there!!!

I have tested it on few Windows-Systems, XP down to ME.

My code bases on some scripts of DannyB. I think i could say that they are so
simple and so often used that there is no bug in this macros.

Step by Step:
1. Open a new Draw Document
2. Excute "Main"
3. Switch to Draw
4. Select the 2 shapes
5. right-click the selection and choose the entry Group
6. immediately save the draw document
7. close the doc and open it

'------------ START OF CODE -------------------
Sub Main
   Dim oShape1 As Object
   Dim oShape2 As Object
   Dim oShape3 As Object
   
   oShape1 = MakeTextShape(ThisComponent, MakePoint_Utils(7*1000, 5*1000),
MakeSize_Utils(5*1000, 1*1000))
   ThisComponent.getCurrentController().getCurrentPage().add( oShape1  )
   oShape1.setString("Foo")
   
   oShape2 = MakeTextShape(ThisComponent, MakePoint_Utils(7*1000, 7*1000),
MakeSize_Utils(5*1000, 1*1000))
   ThisComponent.getCurrentController().getCurrentPage().add( oShape2  )
   oShape2.setString("Foo2")
   
   oShape3 = MakeTextShape(ThisComponent, MakePoint_Utils(7*1000, 9*1000),
MakeSize_Utils(5*1000, 1*1000))
   ThisComponent.getCurrentController().getCurrentPage().add( oShape3  )
   ThisComponent.getCurrentController().getCurrentPage().remove( oShape3  )
End Sub

Function MakeTextShape( oDoc As Object,_
               Optional position As com.sun.star.awt.Point,_
               Optional size As com.sun.star.awt.Size ) As
com.sun.star.drawing.TextShape
   Dim oShape As Object
   oShape = oDoc.createInstance( "com.sun.star.drawing.TextShape" )
   If Not IsMissing( position ) Then
      oShape.Position = position
   EndIf
   If Not IsMissing( size ) Then
      oShape.Size = size
   EndIf
   MakeTextShape = oShape
End Function

Function MakePoint_Utils(ByVal x As Long, ByVal y As Long) As 
com.sun.star.awt.Point
   Dim oPoint As Object
   
   oPoint = CreateUnoStruct("com.sun.star.awt.Point")
   oPoint.X = x
   oPoint.Y = y
   MakePoint_Utils = oPoint
End Function

Function MakeSize_Utils(ByVal width As Long, ByVal height As Long) As
com.sun.star.awt.Size
   Dim oSize As Object
   
   oSize = CreateUnoStruct("com.sun.star.awt.Size")
   oSize.Width = width
   oSize.Height = height
   MakeSize_Utils = oSize
End Function 
'------------ END OF CODE -------------------

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