Bug 127437 - FILEOPEN PPTX Rotated text in shape is imported wrongly
Summary: FILEOPEN PPTX Rotated text in shape is imported wrongly
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
Keywords: filter:pptx
: 127439 (view as bug list)
Depends on:
Blocks: PPTX-Textbox
  Show dependency treegraph
Reported: 2019-09-08 10:17 UTC by Regina Henschel
Modified: 2021-01-25 10:16 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:
Regression By:

TextBoxRotation.pptx demonstrates the error (46.80 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2019-09-08 10:17 UTC, Regina Henschel
AnalyseError.odt contains the mathematical reason of the error (80.79 KB, application/vnd.oasis.opendocument.text)
2019-10-02 10:47 UTC, Regina Henschel
Comparison MSO 2010 and LibreOffice 7.0 master (171.64 KB, image/png)
2020-05-11 11:05 UTC, Xisco Faulí

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2019-09-08 10:17:23 UTC
Created attachment 154013 [details]
TextBoxRotation.pptx demonstrates the error

Open attached document. It contains an arrow with text at the left and a screenshot from PowerPoint365 on the right. The text is rotated with 20 degree by the attribute "rot" of the bodyPr element. The blue dashed rectangle illustrates the unrotated text area, the green rectangle the rotated text area.

Error: The text is sheared.
Comment 1 Regina Henschel 2019-10-01 22:08:08 UTC
The rotation angle is put into TextPreRotateAngle. That results in a matrix-multiplication order scale-matrix * rotation-matrix in ViewContactOfSdrObjCustomShape::createViewIndependentPrimitive2DSequence().
The decompose algorithm in B2DHomMatrix::decompose uses the column-vectors to detect shear. With this multiplication order the column-vectors are not orthogonal, and thus results in a shear angle.

If the rotation angle is put into TextRotateAngle, then the matrix-multiplication order is rotation-matrix * scale-matrix. Then the column-vectors are orthogonal and shear angle is zero.
Comment 2 Regina Henschel 2019-10-02 07:41:48 UTC
*** Bug 127439 has been marked as a duplicate of this bug. ***
Comment 3 Regina Henschel 2019-10-02 10:47:17 UTC
Created attachment 154695 [details]
AnalyseError.odt contains the mathematical reason of the error
Comment 4 Xisco Faulí 2020-05-11 11:05:16 UTC
Created attachment 160657 [details]
Comparison MSO 2010 and LibreOffice 7.0 master