The new "Shape" service is focused on
the description of shapes/images/drawing
objects stored in documents.
In the actual release only shapes
in Calc sheets are considered.
A Shape instance is created from either:
- calc.CreateShapeFromFile(shapename, imagefile,
range, aslink)
=> the shape is loaded in the sheet and
anchored to the given range.
The shape may or not be embedded in the
document.
- calc.Shapes(sheetname, shapename)
Next methods are available:
- shape.Anchor(anchortype, cell)
=> define the anchor type and the cell
to which the shape has to be anchored.
- shape.ExportToFile(filename, imagetype, overwrite)
=> save the shape as an image file
to a specified location.
- shape.Pick()
=> select the shape (NB "Select" is a reserved
word in Basic, hence "Pick")
- shape.Resize(xpos, ypos, width, height)
=> change position and/or size.
- shape.Rotate(angle, pivot)
=> rotate the shape using a given
pivot point (x, y) with a given angle.
The shape.XShape property gives a direct
access to its com.sun.star.drawing.XShape
UNO representation.
The pre-existing SF_Chart service is
functionally unchanged. However it is
now implemented as a subclass of the
new SF_Shape service.
Compatibility with previous releases
is preserved.
The implementation required a few changes
in the error messages. Hence also in
their translations.
All the functions are available for both
Basic and Python user scripts.
The documentation should include:
- a revision of the Calc and Chart help pages
- the creation of an additional Shape page
Change-Id: Ib67f5e755e3112961aadeffc3188b2cdf9aca613
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193906
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>