Apache OpenOffice (AOO) Bugzilla – Issue 31125
sBasic wrong reads co-ordinates triangular vertex in sDraw
Last modified: 2017-05-20 11:27:50 UTC
'============== macro to test =============================== Dim oDoc as Object Dim oPage as object Dim oGraf as object Dim nX as double Dim nY as double Dim iOpcja as integer ' -------------------------------------------- 'Plesae test this macro in Sdraw but in sDraw probably egzist bug in OpenOffice 1.1.1 or 1.1.2 pl 'You must open sDraw and draw manually eg. Triangular and one Line 'Changne Line position X=10mm ; Y=10mm ( select line and click right key) 'Triangular draw manually size and position 'Now run this macro 'Macro wrong reads 3 points X Y in Triangular in sDraw but in Calc and sWriter work OK 'You must correct values X-322 and Y-102 'autor: markcc@wp.pl '--------------------------------------------- oDoc= StarDesktop.ActiveFrame.Controller.Model oPage=oDoc.drawPages(0) oGraf=oPage.GetByIndex(0) ' if number 0 is not Triangular object then chagne number 0 on 1 or 2 ... etc. oDoc.CurrentController.Select(oShape) sRodzaj=oGraf.GetShapeType() if sRodzaj="com.sun.star.drawing.PolyPolygonShape" then oWierzcholek=oGraf.PolyPolygon(0) iStart=Ubound(oWierzcholek) end if If istart=3 then x1=oWierzcholek(0).x/100 y1=oWierzcholek(0).y/100 x2=oWierzcholek(1).x/100 y2=oWierzcholek(1).y/100 x3=oWierzcholek(2).x/100 y3=oWierzcholek(2).y/100 msgbox "1 punkt: x1: " & x1 &" y1: " & y1 & Chr(13) & "2 punkt: x2: " & x2 &" y2: " & y2 & Chr(13) & "3 punkt: x3: " & x3 &" y3: " & y3 ' wrong reads value X Y , please see reality position X Y end if ' In sDraw is bug when you changne CorrectionX=322 and Y=102 then macro work OK ' But sCalc or sWriter this bug not egzist iCorrectionX=0+322 iCorrectionY=0+102 Dim points(2) As New com.sun.star.awt.Point points(0).x = 1000+iCorrectionX points(0).y = 1000+iCorrectionY points(1).x = 2500+iCorrectionX points(1).y = 5500+iCorrectionY points(2).x = 5500+iCorrectionX points(2).y = 2500+iCorrectionY oGraf.PolyPolygon=array(Points()) End Sub
Created attachment 16279 [details] File example to test chagne Triangular in sBasic
SW->CL: drawing-api, seems to be one for you
Reset assigne to the default "issues@openoffice.apache.org".