Created attachment 171008 [details] Rotated group with rectangles and lines Open attached document. It has a rotated group with yellow objects and a screenshot in blue. The screenshot is behind the group, so when all is OK, you should not see the screenshot. A not suitable outer size is set for the group. The content of the group is fit to this size, which results in the shew. In docx the position and size attributes refer to the unrotated group rectangle. In LO position and size refer to the snap rect of the group. In case the group is not anisotropic stretched (which is usually the case), the import in Shape::createAndInsert() produces the correct size and position. Impress uses Shape::createAndInsert() too and shows the group correctly. The error is in GraphicImport::lcl_attribute(), case NS_ooxml::LN_shape. Lines 788-794 are: 788 awt::Size aSize(m_xShape->getSize()); 789 790 if (m_pImpl->isXSizeValid()) 791 aSize.Width = m_pImpl->getXSize(); 792 if (m_pImpl->isYSizeValis()) 793 aSize.Height = m_pImpl->getYSize(); #788 gets the correct size from m_xShape, which considers content and transformation. But that is overwritten with the size in m_pImpl, which is the value from the ext-element from file. If you comment out #790-793, you can see, that the group is then rendered with the correct size. But that is not a complete solution, because the position is still wrong. Besides that I do not know, which other consequences such change has. [Anisotropic stretched groups have an additional error in Shape::createAndInsert(), which is tracked in bug 141463.]
Created attachment 171009 [details] Group with a rotated content The group contains a red rectangle in size (as in Word) of the group and a green rectangle. The green rectangle is rotated and overflows the group rectangle in Word. This situation triggers the same error, the content is fit to the group rectangle and thus the red rectangle has wrong size and the green rectangle is skewed.
Created attachment 171010 [details] Comparison LibreOffice 7.2 master and MSO 2010
Reproduced in Version: 7.2.0.0.alpha0+ / LibreOffice Community Build ID: c47ad11f8c2e917adebbd5d7b3a3ef6cc4b3e670 CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded
Also reproduced in Version: 5.2.0.0.alpha0+ Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53 Threads 4; Ver: 5.7; Render: default; and Version: 4.3.0.0.alpha1+ Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e
Regina Henschel committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/2a70cfb09c4d89154d229b6a95cf076e8bd76798 tdf#141540 fix docx import of group or line with rotation It will be available in 7.2.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.
*** Bug 141330 has been marked as a duplicate of this bug. ***
Created attachment 171703 [details] How it looks after 2a70cfb09c
Regina Henschel committed a patch related to this issue. It has been pushed to "libreoffice-7-1": https://git.libreoffice.org/core/commit/e72b36434dc299d0fb3ecc97045fbb9ca2b9abf8 tdf#141540 fix docx import of group or line with rotation It will be available in 7.1.4. 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.
The remaining differences are due to the fact that the "center relative to column" setting was used for the horizontal alignment. That is a general problem and independent from the originally reported wrongly skew. I have written bug 142948 for the alignment problem. I consider the original problem fixed here.
It's like in Xixco screenshot from comment 7. Based on comment 9 I consider that it is ok now. Verified with Version: 7.2.0.1.0+ (x64) / LibreOffice Community Build ID: ffeeb78118a887419c5f33bb5311f0e2ddae463c CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win Locale: ro-RO (ro_RO); UI: en-US Calc: threaded