Bug 135254 - FILEOPEN DOCX Grouped shapes have slightly different height/width
Summary: FILEOPEN DOCX Grouped shapes have slightly different height/width
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:docx
: 150255 (view as bug list)
Depends on:
Blocks: DOCX-Grouped-Shapes
  Show dependency treegraph
 
Reported: 2020-07-29 07:25 UTC by NISZ LibreOffice Team
Modified: 2023-03-09 21:57 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Word with two grouped shapes (21.85 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-07-29 07:25 UTC, NISZ LibreOffice Team
Details
Screenshot of the magenta shapes properties side by side in Word and Writer (117.68 KB, image/png)
2020-07-29 07:25 UTC, NISZ LibreOffice Team
Details
Screenshot of the white shapes properties side by side in Word and Writer (98.84 KB, image/png)
2020-07-29 07:26 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2020-07-29 07:25:19 UTC
Created attachment 163718 [details]
Example file from Word with two grouped shapes

Attached document is a minimized version of the Word 2010 title page template Transcendent.
It has two rectangle shapes which are grouped, the magenta one being exactly the page size.
When opened in Writer the magenta shape is slightly smaller than in Word, and the white shape is  a bit smaller and wider too.

Steps to reproduce:
    1. Open attached file

Actual results:
Magenta shape has 27.94 cm height instead of 29,7 cm (1,76 cm smaller).
White shape has 25.69 cm height instead of 27.31 cm (1,62 cm smaller) and 19.43 cm width instead of 18.9 cm (0.53 cm wider).

Expected results:
Both shapes have the same size as in Word.

LibreOffice details:
Version: 7.1.0.0.alpha0+ (x64)
Build ID: <buildversion>
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: CL

Also happens in:
Verzió: 6.0.0.3
Build az.: 64a0f66915f38c6217de274f0aa8e15618924765
CPU szálak: 4; OS: Windows 6.3; Felületmegjelenítés: alapértelmezett; 
Területi beállítások: hu-HU (hu_HU); Calc: CL

Version: 5.0.0.5
Build ID: 1b1a90865e348b492231e1c451437d7a15bb262b
Locale: hu-HU (hu_HU)

Verzió: 4.2.0.4
Build az.: 05dceb5d363845f2cf968344d7adab8dcfb2ba71

In older versions the grouped shapes were not even imported.
Comment 1 NISZ LibreOffice Team 2020-07-29 07:25:49 UTC
Created attachment 163719 [details]
Screenshot of the magenta shapes properties side by side in Word and Writer
Comment 2 NISZ LibreOffice Team 2020-07-29 07:26:12 UTC
Created attachment 163720 [details]
Screenshot of the white shapes properties side by side in Word and Writer
Comment 3 Xisco Faulí 2020-07-30 11:07:04 UTC
Reproduced in

Version: 7.1.0.0.alpha0+
Build ID: bc44e0acef79a2c0d4f0504023be21bd78451214
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 4 Regina Henschel 2021-07-11 20:42:56 UTC
The corresponding attributes in ODF are style:rel-height and style:rel-width.

LibreOffice has it implemented for a Frame. That has a UI to set it. It is written to file as direct attribute of the <draw:frame> element.

LibreOffice can interpret these attributes for some kind of shapes as attributes of the <style:graphic-properties> element of a style. It works for a TextBox. That is a <draw:frame> element and from point of view of ODF not different to a Frame. It works too for legacy rectangle and oval and for polygons, but the shapes will be a little bit too large. LibreOffice has no UI to set it in these cases, but the attributes are available via API.

LibreOffice cannot interpret these attributes for custom shapes. Therefore it fails with the example document.

So a short-term solution could be, to import a shape as Frame in Writer, if it has a rectangular geometry, no shape rotation, no text rotation, and no special effects like shadow or glow.
And long-term solution would be to implement these attributes for custom shapes too, correct the size, and bring the attributes to UI.

A workaround could be to recalculate the shape size on import depending on the actual page size.
Comment 5 Gabor Kelemen (allotropia) 2023-03-09 21:57:30 UTC
*** Bug 150255 has been marked as a duplicate of this bug. ***