Bug 142914 - FILE SAVE XLSX Line shapes rotation is incorrect in range 45 - 135 degrees
Summary: FILE SAVE XLSX Line shapes rotation is incorrect in range 45 - 135 degrees
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: XLSX-Shapes
  Show dependency treegraph
 
Reported: 2021-06-17 12:58 UTC by qve00761
Modified: 2021-10-06 08:32 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Original file (ods) (10.73 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-06-17 13:05 UTC, qve00761
Details
After (5.93 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2021-06-17 13:07 UTC, qve00761
Details
Example file with line shapes rotated (12.90 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-08-31 14:06 UTC, NISZ LibreOffice Team
Details
The example file saved as xlsx (7.63 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2021-08-31 14:09 UTC, NISZ LibreOffice Team
Details
The extended example on ODS and XLSX format in Calc (156.98 KB, image/png)
2021-08-31 14:17 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description qve00761 2021-06-17 12:58:35 UTC
Description:
If you save the shape line created from bottom to top in xlsx format, the shape line will change horizontally.
This phenomenon occurs when the angle of the original line is 90 degrees.

Steps to Reproduce:
1.Hold down the shift key and create a line from bottom to top with the shape line.
2.Save to xlsx.
3.Close the xlsx file.
4.Open the xlsx file.

Actual Results:
The vertical line has changed to a horizontal line.

Expected Results:
The shape line is displayed as a vertical line.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.3.0.0.alpha0+ (x86) / LibreOffice Community
Build ID: b89ebf135818ccaa45bbfb164099a6e199bd7d11
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Vulkan; VCL: win
Locale: ja-JP (ja_JP); UI: en-US
Calc: threaded
Comment 1 qve00761 2021-06-17 13:05:58 UTC
Created attachment 172981 [details]
Original file (ods)

Save this ods file as xlsx.
You can check the phenomenon.
Comment 2 qve00761 2021-06-17 13:07:29 UTC
Created attachment 172985 [details]
After

I saved the original ods file in xlsx format.
Comment 3 Regina Henschel 2021-06-17 23:25:49 UTC
I can reproduce the problem.

The error is in XclObjAny::WriteFromTo()
The left, green line has a rotation angle of -9000 and therefore skips the part "swap(width,height)". The right, red line has a rotation angle of 9000 and therefore performs the swap.

The error is not only with exactly horizontal or vertical lines. It is necessary to check whether lines must generally be excluded from the "swap" part.

This should be fixed together with bug 142881, because the same code part is affected.
Comment 4 NISZ LibreOffice Team 2021-08-31 14:06:06 UTC
Created attachment 174670 [details]
Example file with line shapes rotated
Comment 5 NISZ LibreOffice Team 2021-08-31 14:09:02 UTC
Created attachment 174671 [details]
The example file saved as xlsx

The 45 degrees - 135 degrees range looks to be handled quite badly in:

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: d350a1364a1c34b96d00f2f716c44882b7b57fe9
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL

Others only have some minor (but with each subsequent save aggregating!) change in the rotation value of about +0.05 degrees / save - but this is a separate issue.
Comment 6 NISZ LibreOffice Team 2021-08-31 14:17:33 UTC
Created attachment 174672 [details]
The extended example on ODS and XLSX format in Calc

In ascending order the problematic value range (rounded to whole numbers):

45 degrees becomes 45
46 degrees becomes 44
50 degrees becomes 40
60 degrees becomes 30
70 degrees becomes 20
80 degrees becomes 10
89 degrees becomes 1
90 degrees becomes 0
91 degrees becomes 179
100 degrees becomes 170
110 degrees becomes 160
120 degrees becomes 150
134 degrees becomes 136
135 degrees becomes 135
Comment 7 NISZ LibreOffice Team 2021-09-01 12:36:35 UTC
This started in 7.1 with:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=5e8875780d665b7ae0fee1a053b5ce78ec513f69

author	Szabolcs Toth <szabolcs450@gmail.com>	2020-08-17 10:55:43 +0200
committer	László Németh <nemeth@numbertext.org>	2020-08-24 18:28:51 +0200

tdf#135828 XLSX shape export: fix distortion of rotated shapes
Comment 8 Regina Henschel 2021-09-06 23:59:50 UTC
This is fixed with https://git.libreoffice.org/core/commit/84d6d704682a4d0e037a28895356b073e4f992a5 from bug 144242.
Comment 9 NISZ LibreOffice Team 2021-10-06 08:32:55 UTC
Verified in: 

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: c2de581d1943df2d84f2b71817b6a8bee41f0217
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded