Issue 77246 - Relative glue points are messy after save and reload
Summary: Relative glue points are messy after save and reload
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Keywords: oooqa
Depends on:
Reported: 2007-05-11 14:09 UTC by xat
Modified: 2013-02-24 21:07 UTC (History)
2 users (show)

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


Note You need to log in before you can comment on or make changes to this issue.
Description xat 2007-05-11 14:09:50 UTC
I made a macro that create a rectangular shape and insert relative glue point in it.

After saving and reloading the file, the glue points have changed of place.

It seems that before reloading, the coordinates of the glue points are from
(0,0) to (10000,10000).

After reloading, it seems that the coordinates are from (-5000,-5000) to

So a relative glue point created with (0,0) coordinates will be in the upper
left corner (this is normal), but after saving and reloading, it will be in the
center :(
Comment 1 Regina Henschel 2007-05-11 20:33:59 UTC
It works without problem in the UI. Therefore please attach your macro.
Comment 2 xat 2007-05-14 09:13:58 UTC
This is not my macro but a simpler one which will create a rectangle shape with
a relative glue point with coordonate (0,0) wich is upper-left corner.After
saving and reloading the odg document, the gluepoint moved to the centre.

Sub Main
	Dim oDoc			As Object
	Dim oPage 			As Object
	Dim Size			As New
	Dim Point			As New
	Dim oRectangleShape As Object
	Dim oGluePoints		As Object
	Dim oGluePoint		As Object		
	'Retrive Doc and Page
	oDoc = ThisComponent
	oPage = oDoc.drawPages(0)
	'Create rectangle shape in the center of the page
	Size.Width = 5000
	Size.Height = 3000
	Point.x = oPage.Width/2 - Size.Width/2
	Point.y = oPage.Height/2 - Size.Height/2
	oRectangleShape =  oDoc.createInstance( "" )
	oRectangleShape.Position = Point
	oRectangleShape.Size = Size
	oRectangleShape.FillStyle =
	'Create a relative glue point at position (0,0)
	oGluePoints = oRectangleShape.getGluePoints()
	Point.x = 0
	Point.y = 0
	oGluePoint =  createUnoStruct( "" )
	With oGluePoint
   		.IsRelative = True
		.Position = Point
		.Escape =
		.IsUserDefined = False
	End With
	oGluePoints.insertByIndex( oGluePoints.getCount(), oGluePoint )
End Sub
Comment 3 jsc 2007-05-15 15:14:39 UTC
jsc - sj: can you please check this
Comment 4 xat 2007-05-29 14:58:34 UTC
I investigated a litle bit:

If I create gluepoints with the UI and theirs coordinates varies between
(-5000,-5000) and (5000,5000). Like I said if I create de gluepoints in a macro,
It is displayed correctly only after a save and a reload.

Can I force a refresh of the shape without saving (and overwriting the file)?

Unfortunately, this issue blocks my company to switch from a propriatary draw
soft to oodraw, but they (my bosses) will wait a little time before paying the
lisence fees for next year. So I need a quick fix/workaround.
Comment 5 kpalagin 2007-06-09 04:45:53 UTC
Confirming with 2.2 on WinXP - as described.
Repro steps:
1. run provided macro, display gluepoints with the button on toolbar - 
gluepoint is at the top left corner.
2. Save, close and reopen file.
3. Display gluepoints - gluepoint is in the middle of rectangle.