Bug 143219 - DOCX Problems with wrap distance to text in import/export filters
Summary: DOCX Problems with wrap distance to text in import/export filters
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.0.0 alpha0+
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:7.3.0
Keywords: implementationError
Depends on:
Blocks:
 
Reported: 2021-07-06 19:10 UTC by Regina Henschel
Modified: 2022-01-10 12:37 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
contour wrap with rotated shape (74.28 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-07-06 19:10 UTC, Regina Henschel
Details
fat stroke and shadow (86.21 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-07-06 19:11 UTC, Regina Henschel
Details
contour wrap with rotated shape with glow effect (192.63 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-07-06 19:12 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2021-07-06 19:10:11 UTC
Created attachment 173396 [details]
contour wrap with rotated shape

LibreOffice has only one place for setting the distance between object and surrounding text, see section 'Spacing' in the 'Wrap' dialog in the UI. Word has two places to determine this distance. One place are the values distL, distB, distR and distR, which are available to the user in the UI. The other place is the effectExtent element. It contains distances, which are introduced by rotation, fat stroke or by effects like shadow or glow. On import the 'distance to text' values of LibreOffice are set so, that a similar rendering is achieved. On export to docx, LibreOffice needs to distribute it's values somehow so that the visual appearance is similar.

Currently this does not work well for rotated shapes or contour wrap.

I put some problems together where the same part of code is touched.

The attachments contain each a shape and a screenshot of rendering in Word.

Attachment "wrapThrough_rotate plus screenshot.docx":
Open attached document. Notice, that left and right 'distance to text' is too large.

Attachment "stroke18pt_shadow36pt plus screenshot.docx":
Open attached document. You see some differences in rendering. The reason is, that LibreOffice and Word uses different concepts for contour wrap. But that is not to be discussed here. Save the document without changes to docx format. Open the saved document in Word or in LibreOffice. You will see a large 'distance to text' which does not exist in the original document.

Attachment "glow36pt_rot135_wrapThrough plus screenshot.docx":
Open attached document. Notice that the right distance to text is too small.
Save the document without changes to docx format and open the saved document in Word. Notice that the 'distance to text' is far too large.
Comment 1 Regina Henschel 2021-07-06 19:11:31 UTC
Created attachment 173397 [details]
fat stroke and shadow
Comment 2 Regina Henschel 2021-07-06 19:12:35 UTC
Created attachment 173398 [details]
contour wrap with rotated shape with glow effect
Comment 3 Xisco Faulí 2021-07-07 09:28:22 UTC
Moving to NEW
Comment 4 Commit Notification 2021-07-14 09:35:34 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

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

tdf#143219 improve docx import/export of contour wrap

It will be available in 7.3.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.