Issue 31125

Summary: sBasic wrong reads co-ordinates triangular vertex in sDraw
Product: App Dev Reporter: markcc <markcc>
Component: apiAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: PC   
OS: Windows 98   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
File example to test chagne Triangular in sBasic none

Description markcc 2004-07-06 08:03:42 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
Comment 1 markcc 2004-07-06 08:12:24 UTC
Created attachment 16279 [details]
File example to test chagne Triangular in sBasic
Comment 2 stephan.wunderlich 2004-07-06 15:03:30 UTC
SW->CL: drawing-api, seems to be one for you 
Comment 3 Marcus 2017-05-20 11:27:50 UTC
Reset assigne to the default "issues@openoffice.apache.org".