Apache OpenOffice (AOO) Bugzilla – Issue 120369
oDrawDoc.Drawpages(0).Add(oShape) in OSX version causes error
Last modified: 2017-05-20 09:32:07 UTC
Created attachment 78729 [details] example macro causing crash When I try to add a new shape to a Draw document with the command oDrawDoc.Drawpages(0).Add(oShape) it returns the error: Type: com.sun.star.beans.UnknownPropertyException Message: . The same command works perfectly with AOO 3.4.0 Win version, LibreOffice 3.5.5.3 Mac version and NeoOffice 3.2.1 patch 0 Mac. The same issue happens in a MacOSX 10.5 with fresh AOO 3.4.0 installed. Please note tat the shape I wish to insert is a formula, I don't try with other shapes kind. Attached a sample Basic Macro useful to verify the problem. Running the only macro present in the Draw document you will get the error. The example macro is: REM ***** BASIC ***** Sub InsertFormula() Dim oDrawDoc As Object Dim oShape As Object Dim p As new com.sun.star.awt.Point Dim s As new com.sun.star.awt.Size p.X = 500 p.Y = 500 s.Width = 10000 s.Height = 5000 ODrawDoc = ThisComponent oShape = ThisComponent.createInstance("com.sun.star.drawing.OLE2Shape") oShape.CLSID = "078B7ABA-54FC-457F-8551-6147e776a997" oDrawDoc.Drawpages(0).Add(oShape) oShape.Model.Formula = "size 20 e^{i%pi} + 1 = 0" oShape.MoveProtect = False oShape.SizeProtect = False oShape.setPosition(p) oShape.setSize(s) End Sub
(In reply to comment #0) > The same command works perfectly with AOO 3.4.0 Win version, LibreOffice > 3.5.5.3 Mac version and NeoOffice 3.2.1 patch 0 Mac. It also works on Linux x86-64 (Fedora 17)
(In reply to comment #0) > Created attachment 78729 [details] > example macro causing crash > > When I try to add a new shape to a Draw document with the command > > oDrawDoc.Drawpages(0).Add(oShape) > > it returns the error: > > Type: com.sun.star.beans.UnknownPropertyException > Message: . Can you try splitting that instruction, in order to detect if the error is in add(oShape)? oPage = oDrawDoc.Drawpages(0) oPage.add(oShape)
I tried: msgbox oDrawDoc.Drawpages(0).name and it works, so I'm sure the problem is in the .add(oShape)
Verified: oPage = oDrawDoc.Drawpages(0) oPage.add(oShape) The error is now in oPage.add(oShape)
Update: tested with OOo 3.3.0 and it works
I can't reproduce it in a dev snapshot of AOO 3.4.1 You can try a snapshot build under https://cwiki.apache.org/confluence/display/OOOUSERS/Development+Snapshot+Builds
This is probably a duplicate to bug 119337, which got fixed for AOO 3.4.1 *** This issue has been marked as a duplicate of issue 119337 ***