Bug 124534 - Extending the offapi documentation for 'AnchorPosition'
Summary: Extending the offapi documentation for 'AnchorPosition'
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Anchor-and-Text-Wrap
  Show dependency treegraph
 
Reported: 2019-04-03 18:43 UTC by Regina Henschel
Modified: 2025-01-09 14:49 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file with macro to examine the shape properties (12.71 KB, application/vnd.oasis.opendocument.text)
2019-04-03 18:43 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2019-04-03 18:43:21 UTC
Created attachment 150516 [details]
Example file with macro to examine the shape properties

If you inspect a shape via macro, you will find the property "AnchorPosition". I see these problems:

1) If you change the zoom, you get different values for the X coordinate but not for the Y coordinate.

2) 'AnchorPosition' exists in the API only for legend, but not for shapes.

3) The values in AnchorPosition make no sense.

Expected behavior:

The values in AnchorPosition are in unit 1/100 mm, same as all other values.

The values in AnchorPosition are independent from zoom.

'AnchorPosition' + 'Position' = 'Left or 'Top' respectively, so that 'Left' and 'Top' describe the distance from the page edge.

Type 'Anchor to page' results in 'AnchorPosition' (0|0).


The attached file contains the macro FrameRectWriter, which works on a selected shape. You can use it to examine the current behavior.
Comment 1 Regina Henschel 2019-04-03 19:00:07 UTC
It seems, that 'AnchorPosition' is measured from the edge of the content area of the window? If that is indeed so and intended, it should be documented in the API.
Comment 2 Xisco Faulí 2019-05-06 16:37:38 UTC
@Regina, would you mind asking for more info in the dev list ?
Comment 3 Regina Henschel 2019-05-07 10:05:42 UTC
(In reply to Xisco Faulí from comment #2)
> @Regina, would you mind asking for more info in the dev list ?

Done. https://lists.freedesktop.org/archives/libreoffice/2019-May/082677.html
Answer: https://lists.freedesktop.org/archives/libreoffice/2019-May/082682.html
Comment 4 Xisco Faulí 2019-05-07 10:07:16 UTC
(In reply to Regina Henschel from comment #3)
> (In reply to Xisco Faulí from comment #2)
> > @Regina, would you mind asking for more info in the dev list ?
> 
> Done. https://lists.freedesktop.org/archives/libreoffice/2019-May/082677.html
> Answer:
> https://lists.freedesktop.org/archives/libreoffice/2019-May/082682.html

Thanks. Moving to NEW then...
Comment 5 QA Administrators 2021-05-07 03:59:20 UTC Comment hidden (obsolete)
Comment 6 Regina Henschel 2021-05-07 11:56:56 UTC
The API is still not improved. Tested with 7.2 SDK from 9. Apr. 2021.
Comment 7 QA Administrators 2023-05-08 03:18:01 UTC Comment hidden (obsolete)
Comment 8 Regina Henschel 2023-05-08 11:56:59 UTC
The requested info is still missing in LibreOfficeDev_7.6_SDK.
Comment 9 Regina Henschel 2025-01-09 14:49:03 UTC
Miklos has related the property "AnchorPosition" to the method SdrObject::GetAnchorPos() in his answer  https://lists.freedesktop.org/archives/libreoffice/2019-May/082682.html

I think, the property "AnchorPosition" is not related to SdrObject::GetAnchorPos(). Two different shapes in a text document have the same values for "AnchorPosition", whereas GetAnchorPos() returns the m_aAnchor member of the individual shape.

Using the now available tools "Development Tools" I see this:

The property "AnchorPosition" of a shape reflects the properties Document > ViewData > ViewLeft and ViewTop. As it is a document property is makes sense that it is readonly at the shape.

The document properties ViewLeft and ViewTop do not react immediately in the Development Tools, when the view in the application window changes. You need to save the document with the changed view to actualize the properties.

The property "AnchorPosition" of the shapes in the Development Tools reacts immediately on a changed view.

So it boils down to the question, "What is contained in ViewLeft and ViewTop?"

In file format they are config items in settings.xml.