Bug 142113 - FILEOPEN PPTX horizontal/vertical lines are not horizontal/vertical after import
Summary: FILEOPEN PPTX horizontal/vertical lines are not horizontal/vertical after import
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: OOXML-Shapes
  Show dependency treegraph
 
Reported: 2021-05-06 07:47 UTC by Regina Henschel
Modified: 2022-07-07 07:34 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Document with horizontal and vertical line (13.56 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2021-05-06 07:47 UTC, Regina Henschel
Details
The example file in PP and current nightly (80.50 KB, image/png)
2021-05-13 06:40 UTC, NISZ LibreOffice Team
Details
The example file in recent 7.4 master (125.78 KB, image/png)
2022-05-23 14:43 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2021-05-06 07:47:04 UTC
Created attachment 171673 [details]
Document with horizontal and vertical line

If a line is horizontal or vertical in pptx, they are not horizontal or vertical after opening the file in Impress. The angles are slightly off. You get 359.99deg for a horizontal line and 270.01deg for a vertical line for example.

Besides looking at the rotation angle in the Position&Size dialog, you will notice the error in the status bar, if the line is selected. The shown text should include "horizontal" or "vertical", but it doesn't.

This slight deviation cancels out the horizontal/vertical detection, which is used in several places in the code.

The error is likely in the part https://opengrok.libreoffice.org/xref/core/oox/source/drawingml/shape.cxx?r=2a70cfb0#844
The handling of lines there is questionable:
* A line has exactly two points and one polygon. No need for a loop.
* The 'Guard against zero width or height' is wrong. A vertical line has zero width and a horizontal line has zero height. The current solution prevents vertical and horizontal lines. Even height and width zero at the time is possible. Such zero length lines are visible, if line caps are set.
* What is the purpose of 'xModelInfo' there?

But I have not tested yet, whether a fix there would solve the problem.
Comment 1 Regina Henschel 2021-05-06 15:31:37 UTC
The current code is a workaround, see bug 122717. It cannot be simple removed. Prior the underlying problem in Writer has to be fixed. Any try needs to consider the sample files from bug 127364, bug 141120 and bug 141239.
Comment 2 NISZ LibreOffice Team 2021-05-13 06:40:24 UTC
Created attachment 171947 [details]
The example file in PP and current nightly

Confirming with

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: dbd4110cc36011042c98549d997daa79e8065aba
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
Comment 3 Gabor Kelemen (allotropia) 2022-05-23 14:43:29 UTC
Created attachment 180316 [details]
The example file in recent 7.4 master

This seems to have changed in:

https://git.libreoffice.org/core/+/cbf66ec3e60d07efb7c3cceed9b4f0fb4f0510c8

author	Tibor Nagy <nagy.tibor2@nisz.hu>	Thu Mar 10 08:42:12 2022 +0100
committer	László Németh <nemeth@numbertext.org>	Tue Mar 29 16:12:45 2022 +0200

tdf#89449 PPTX import: fix line connectors

Now both lines appear in the Position&Size dialog/sidebar as having exactly 0 degrees rotation.
This matches what my PP 2016 shows.
Comment 4 Gabor Kelemen (allotropia) 2022-05-23 14:45:19 UTC
Thanks Tibor for fixing this as well!
Comment 5 NISZ LibreOffice Team 2022-07-07 07:34:57 UTC
Verified in:
Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: e4066a41406b1ddd454901b4fa718cf9be2746c4
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL