Bug 153258 - FILEOPEN DOCX VML some WordArt is not detected as Fontwork and thus shrinks to nominal text size
Summary: FILEOPEN DOCX VML some WordArt is not detected as Fontwork and thus shrinks t...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:7.6.0 target:7.5.1
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-28 00:49 UTC by Regina Henschel
Modified: 2023-02-03 10:03 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
WortArt shape with type name "mso-spt167" (158.84 KB, application/zip)
2023-01-28 00:49 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2023-01-28 00:49:23 UTC
Created attachment 184973 [details]
WortArt shape with type name "mso-spt167"

Open attached file. It contains a VML WordArt 'mso_sptTextDeflateInflateDeflate' and a screenshot of how it looks in Word.

The SimpleShape::implConvertAndInsert(..) method in https://opengrok.libreoffice.org/xref/core/oox/source/vml/vmlshape.cxx?r=ceaff89c has code to prevent 'resize autoshape to fit text' for Fontwork shapes. It uses aShapeType.startsWith("fontwork") as criterion. But that does not work for all WordArt shapes, some start with mso-spt. The used strings are in pNameTypeTableArray[] in https://opengrok.libreoffice.org/xref/core/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx?r=96e3a641

Instead the IsTextPath() method of the SdrObject should be used. That detects whether it is a Fontwork shape independent from a type name but uses directly the property "TextPath".
Comment 1 Regina Henschel 2023-01-30 15:54:37 UTC
Unfortunately IsTextPath() is not possible because the shape properties are not complete at that time of import. So need a different method.
Comment 2 Commit Notification 2023-02-02 16:54:43 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2598f40521c6a8dee6d59ca41c3e58e65a98b17f

tdf#153258 VML import improve WordArt detection

It will be available in 7.6.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 3 Commit Notification 2023-02-03 10:03:24 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/39eb3d9ab448722851d8ffca1061d3cefcb32d0e

tdf#153258 VML import improve WordArt detection

It will be available in 7.5.1.

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.