Issue 53001 - Loss text while grouping shapes with OOoBasic
Summary: Loss text while grouping shapes with OOoBasic
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Windows XP
: P2 Trivial
Target Milestone: ---
Assignee: stephan.wunderlich
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-07 17:13 UTC by arkas
Modified: 2013-02-24 21:09 UTC (History)
1 user (show)

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


Attachments
Relevant Macros (1.56 KB, application/x-compressed)
2005-08-08 08:07 UTC, arkas
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description arkas 2005-08-07 17:13:33 UTC
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 -------------------
Comment 1 arkas 2005-08-07 17:17:25 UTC
Sorry,

the code includes my workaround.
to reproduce the bug comment out the last 3 lines of Sub Main

'------------ 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
'------------ END OF CODE -------------------
Comment 2 christianjunker 2005-08-07 19:29:37 UTC
arkas,
can you please provide an sample document containing all the relevant macros?
Comment 3 arkas 2005-08-08 08:07:18 UTC
Created attachment 28564 [details]
Relevant Macros
Comment 4 arkas 2005-08-08 08:09:29 UTC
Hi,

i have added the relevant macro-code. 
notice, you have to do a few steps "by hand" descriped in the first comment of
this issue.

Jan
Comment 5 stephan.wunderlich 2005-08-09 12:26:21 UTC
I could reproduce the behaviour with OOo1.1.4 but not with src680_m122, so I
think it has been fixed by now => setting it to WORKFORME
Comment 6 stephan.wunderlich 2005-08-09 12:50:29 UTC
closing