Bug 144242 - FILESAVE XLSX Line objects incorrectly saved after creation
Summary: FILESAVE XLSX Line objects incorrectly saved after creation
Status: VERIFIED 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: Regina Henschel
URL:
Whiteboard: target:7.3.0 target:7.2.2
Keywords: bibisected, bisected, filter:xlsx, regression
Depends on:
Blocks: XLSX-Shapes
  Show dependency treegraph
 
Reported: 2021-09-01 12:42 UTC by NISZ LibreOffice Team
Modified: 2021-10-06 08:24 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Calc for further modification (8.87 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-09-01 12:42 UTC, NISZ LibreOffice Team
Details
The modified example file for reference (11.74 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-09-01 12:43 UTC, NISZ LibreOffice Team
Details
The original example file after modification saved as XLSX (6.00 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2021-09-01 12:43 UTC, NISZ LibreOffice Team
Details
Screenshot of the modified document in Calc before saving (42.91 KB, image/png)
2021-09-01 12:44 UTC, NISZ LibreOffice Team
Details
Screenshot of the modified document in Calc after saving as XLSX and reloading (36.25 KB, image/png)
2021-09-01 12:45 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 2021-09-01 12:42:14 UTC
Created attachment 174692 [details]
Example file from Calc for further modification

This is a followup to bug 142914
When line objects are created and set to a rotation value between 225 degrees and 315 and saved to XLSX they are incorrectly mirrored.
If the same line objects are saved to ODS, reloaded and then saved as XLSX then the rotation is fine.

Steps to reproduce:
1.	Open the attached file, it contains some line objects
2.	Make copies of the objects and set a rotation value for them between 225 degrees and 315 degrees. On the screenshot I set 224, 225, 226 for blue lines, 269, 270, 271 for green lines and 314, 315, 316 for orange lines.
3.	Save as ODS, then XLSX, reload to see the problem
4.	Open the ODS version, save as XLSX, to see it work correctly.

Actual results:
224 and 225 degrees becomes 224 and 225 (good)
226 degrees becomes 224
269 degrees becomes 181
270 degrees becomes 0
271 degrees becomes 359
314 degrees becomes 316
315 and 316 degrees becomes 315 and 316 (good)

Expected results:
Rotation values retained unchanged.

LibreOffice details:
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: d5ade739771ddf06cc7ee6d4af15672bfcf09ed6
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

Also in
Version: 7.1.0.3 (x64) / LibreOffice Community
Build ID: f6099ecf3d29644b5008cc8f48f42f4a40986e4c
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: default; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: threaded

Not yet in
Version: 7.0.0.3 (x64)
Build ID: 8061b3e9204bef6b321a21033174034a5e2ea88e
CPU szálak: 4; OS: Windows 10.0 Build 18363; Felületmegjelenítés: alapértelmezett; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded

Additional Information:
Bibisected using bibisect-win64-7.1 to:
URL:https://cgit.freedesktop.org/libreoffice/core/commit/?id=5e8875780d665b7ae0fee1a053b5ce78ec513f69 
author: Szabolcs Toth szabolcs450@gmail.com
committer: László Németh <nemeth@numbertext.org>

tdf#135828 XLSX shape export: fix distortion of rotated shapes
Comment 1 NISZ LibreOffice Team 2021-09-01 12:43:15 UTC
Created attachment 174693 [details]
The modified example file for reference

Recreate the rotations in this one from the previous one to see the problem after XLSX save-reload.
Comment 2 NISZ LibreOffice Team 2021-09-01 12:43:35 UTC
Created attachment 174694 [details]
The original example file after modification saved as XLSX
Comment 3 NISZ LibreOffice Team 2021-09-01 12:44:35 UTC
Created attachment 174695 [details]
Screenshot of the modified document in Calc before saving
Comment 4 NISZ LibreOffice Team 2021-09-01 12:45:17 UTC
Created attachment 174696 [details]
Screenshot of the modified document in Calc after saving as XLSX and reloading
Comment 5 Regina Henschel 2021-09-02 17:25:41 UTC
A newly inserted line has a positive rotate angle, e.g. 30000.
The same line after save and reload has a negative rotate angle, e.g. -6000.
Comment 6 Regina Henschel 2021-09-04 23:43:22 UTC
Proposed patch is in https://gerrit.libreoffice.org/c/core/+/121661

The problem exists not only with lines but with all open path objects. A Bezier curve is wrong not only by immediately export after inserting, but also when exporting from the reopened document, for example.

The patch contains a unit test with SID_DRAW_LINE. I would need the identical test for SID_DRAW_BEZIER_NOFILL. Do you have an idea how I could write that more clever than making a copy?
Comment 7 Commit Notification 2021-09-06 14:04:58 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/84d6d704682a4d0e037a28895356b073e4f992a5

tdf#144242 no width-height swap for line and pathline

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.
Comment 8 Commit Notification 2021-09-07 15:07:09 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/7ed532a2cbce52cd20b0801116d35ce713365f76

tdf#144242 no width-height swap for line and pathline

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.
Comment 9 NISZ LibreOffice Team 2021-10-06 08:24:10 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