Bug 136423 - XShapeGrouper::group does not work with a single shape
Summary: XShapeGrouper::group does not work with a single shape
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Samuel Mehrbrodt (allotropia)
URL:
Whiteboard: target:7.1.0 target:7.0.2 target:6.4.7
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-03 06:44 UTC by Samuel Mehrbrodt (allotropia)
Modified: 2020-09-03 12:53 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Mehrbrodt (allotropia) 2020-09-03 06:44:59 UTC
When using the XShapeGrouper::group function with only a single shape, no shape group is created.
There is no reason this should not work with a single shape (and the implementation in Draw/Impress/Calc does work when only a single shape is given).

Sample (pseudo) python code:

# xDoc = empty Writer document
# xContext = component context
page = xDoc.DrawPage
collection = xContext.ServiceManager.createInstance( 'com.sun.star.drawing.ShapeCollection' )
shape = xDoc.createInstance('com.sun.star.drawing.TextShape')
shape.AnchorType = AT_PARAGRAPH
page.add(shape)
collection.add(shape)
shapegroup = page.group(collection)

Expected:
shapegroup is an XShapeGroup containing the given shape

Actual:
shapegroup is None
Comment 1 Commit Notification 2020-09-03 08:45:46 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3eb5318ed9ae8cf02804fbdc584a5f4b046db0ae

tdf#136423 make SwXDrawPage::group work with a single shape

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 2 Commit Notification 2020-09-03 12:48:09 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/ba86d4e1345276c5fa76a5e4b00e1f04de8cc166

tdf#136423 make SwXDrawPage::group work with a single shape

It will be available in 7.0.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2020-09-03 12:53:23 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/a011af93697722f0b2da79eab4facbf96bb2dd9c

tdf#136423 make SwXDrawPage::group work with a single shape

It will be available in 6.4.7.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.