Bug 148342 - FILESAVE DOCX Shape 'puzzle' is exported as rectangle
Summary: FILESAVE DOCX Shape 'puzzle' is exported as rectangle
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: All All
: medium normal
Assignee: Attila Bakos (NISZ)
Whiteboard: target:7.3.3
Keywords: bibisected, bisected, regression
Depends on:
Reported: 2022-04-03 23:39 UTC by Regina Henschel
Modified: 2022-04-08 07:09 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2022-04-03 23:39:37 UTC
Start a text document and insert a shape 'Puzzle'. Save it as DOCX and reopen the saved file. The shape has become a rectangle.

The error is in ShapeExport::WriteCustomShape(). The condition for using DMLPresetShapeExporter is wrong.
At that time it is already known, that the shape needs to be exported as custGeom. But DMLPresetShapeExporter is used anyway. And there msfilter::util::GetOOXMLPresetGeometry("puzzle") is called. That method has no result "fail" but returns type "rect" in case the shape type does not exist.

Besides the wrong condition, I think it should be considered to let GetOOXMLPresetGeometry return an empty string in case no preset is found, so that the caller can detect this case and react appropriate.
Comment 1 Rainer Bielefeld Retired 2022-04-04 07:22:23 UTC
Already REPRODUCIBLE with  Installation of Version: (x64) 
Build ID a69ca51ded25f3eefd52d7bf9a5fad8c90b87951
CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win | Locale: de-DE (de_DE); UI: de-DE | Calc: threaded | ElementaryTheme | My normal User Profile

Was still ok with Portable Version of (x86) 
Build-ID 639b8ac485750d5696d7590a72ef1b496725cfb5; CPU-Threads: 12; BS: Windows 10.0; UI-Render: GL; Gebietsschema: de-DE (de_DE); Calc: CL, Special devUserProfile

a) Calc not affected, save/reopen xlsx does not destroy puzzle shape
b) no obvious DUO found iwth query https://bugs.documentfoundation.org/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=DUPs148342&sharer_id=19321
Comment 2 Xisco Faulí 2022-04-04 08:54:07 UTC
Regression introduced by:


author	Attila Bakos (NISZ) <bakos.attilakaroly@nisz.hu>	2021-05-14 13:53:32 +0200
committer	László Németh <nemeth@numbertext.org>	2021-06-23 12:57:40 +0200
commit 63cd67e5e18f01aca303131e148c80398a181a41 (patch)
tree f096ec2a12b32517fa031019aa57e7acf2914998
parent ae31c8503c568171cadc87a0b3de0ca23619afdd (diff)
tdf#92525 tdf#142398: fix export of simple custom shapes

Bisected with: bibisect-linux64-7.3

Adding Cc: to Attila Bakos
Comment 3 Regina Henschel 2022-04-06 19:44:27 UTC
Fixed with commit https://cgit.freedesktop.org/libreoffice/core/commit/?id=9592da0a8e596869a1cd0859619dd28a541d7234

Because of wrong number in subject line the commit notification was sent to bug 148327.
Comment 4 Commit Notification 2022-04-07 09:33:52 UTC
Attila Bakos (NISZ) committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":


tdf#148342 docx export: fix puzzle shape

It will be available in 7.3.3.

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:

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