Created attachment 172920 [details] Example file from Excel with rotated shapes Attached example file contains rotated shapes made in Excel. When saving this in Calc to XLSX some of them are vertically flipped. Steps to reproduce: 1. Open attached file 2. Save as XLSX, reopen in Calc or Excel Actual results: Some shapes are vertically flipped with rotation values of 45 degrees, 135 degrees, 225 degrees and 315 degrees. Expected results: Rotation should be retained. LibreOffice details: Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community Build ID: 93a3e2f86c27b06062708fe788963a0e49f3a90b CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: default; VCL: win Locale: en-US (hu_HU); UI: en-US Calc: CL Also in 7.0, in 6.4 the rotations were not all imported correctly.
Created attachment 172921 [details] The original file saved by Calc
Created attachment 172922 [details] Screenshot of the original document in Calc
Created attachment 172923 [details] Screenshot of the exported document in Calc
I reproduced in the following environment: Version: 7.1.4.2 / LibreOffice Community Build ID: a529a4fab45b75fefc5b6226684193eb000654f6 CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3 Locale: ja-JP (ja_JP.UTF-8); UI: ja-JP Calc: threaded
I think, the shapes are not flipped, but have a wrong swapped width and height in the anchor. If the rotation angle is larger as 45deg, MSO swaps width and height in calculating the anchor, and LO too. But it seems for exact 45deg MSO does not swap width and height, but LO does it. To make it easier to calculate the object size from the anchor, put all shapes into one large cell. Then you can get the size as difference of the offset. If I do so, and then "repair" the document so, that the offset in the 'to' element corresponds to the not swapped width and height, the shapes will be shown correctly in Excel.
Created attachment 172951 [details] All shapes in A1 original ods file
Created attachment 172952 [details] Export with current master
Created attachment 172953 [details] 'repaired' file Here the offset in the 'to' element is set, so that from-colOff + ext.cx = to-colOff and from-rowOff + ext.cy = to-rowOff.
Created attachment 172956 [details] proposed patch I don't know, whether such change will have any impact on export to MS binary format or to other formats than OOXML.
This should be fixed together with bug 142914, because the same code part is affected.
(In reply to Regina Henschel from comment #10) > This should be fixed together with bug 142914, because the same code part is > affected. Thanks for the analysis. I asked Szabolcs to take a look at this.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/eae0636311d3a1b3a1af58a3e4df686b55afa3fa tdf#142881 XLSX import: fix shapes rotated exactly 45°, 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.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "libreoffice-7-2": https://git.libreoffice.org/core/commit/30128c2fea22ccd08678744c9501ab052a1fb074 tdf#142881 XLSX import: fix shapes rotated exactly 45°, It will be available in 7.2.2. 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.
Isn't this fixed now?
Verified in: Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community Build ID: 8151f3a1d99ab740d2affdccc7115faa156bf3ad CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: Skia/Raster; VCL: win Locale: hu-HU (hu_HU); UI: hu-HU Calc: threaded