Bug 134289 - FILEOPEN PPTX: text shifts to the left when box is too narrow (text horizontally centers around upper/left corner instead of starting there)
Summary: FILEOPEN PPTX: text shifts to the left when box is too narrow (text horizonta...
Status: RESOLVED DUPLICATE of bug 129685
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
6.4.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:pptx
Depends on:
Blocks:
 
Reported: 2020-06-24 23:34 UTC by Gerald Pfeifer
Modified: 2020-10-30 08:59 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample slide (PPTX) (546.17 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2020-06-24 23:34 UTC, Gerald Pfeifer
Details
How it looks in LibreOffice - text box too far to the left (44.91 KB, image/png)
2020-06-24 23:35 UTC, Gerald Pfeifer
Details
Comparison MSO 2010 and LibreOffice 7.1 master (83.36 KB, image/png)
2020-06-25 18:16 UTC, Xisco Faulí
Details
Another two slides exhibiting the same issue, I believe (5.60 MB, application/vnd.ms-powerpoint)
2020-07-17 04:29 UTC, Gerald Pfeifer
Details
Another two slides exhibiting the same issue, I believe (version 2) (5.60 MB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2020-07-17 05:08 UTC, Gerald Pfeifer
Details
Comparision 365 and LO 7.1 master of the first page of the second document (428.14 KB, image/png)
2020-07-17 05:19 UTC, Gerald Pfeifer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer 2020-06-24 23:34:38 UTC
Created attachment 162388 [details]
Sample slide (PPTX)

The text box in this slide nicely fits into the slide on Office 365;
with LibreOffice 7.1.0.0.alpha0+
  Build ID: abe2a662cde10bb6d9308a85c60ab0b185183d41
  CPU threads: 4; OS: Linux 5.6; UI render: default; VCL: gtk3
  Locale: en-US (en_US.UTF-8); UI: en-US
  TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2020-06-21_15:25:29
it noticable shifts to the left, even beyond the border of the slide.
Comment 1 Gerald Pfeifer 2020-06-24 23:35:08 UTC
Created attachment 162389 [details]
How it looks in LibreOffice - text box too far to the left
Comment 2 Gerald Pfeifer 2020-06-24 23:36:51 UTC
To clarify, the slide on the screenshot ends in the vertical green bar.
I included the part of the overall window that includes the entire text,
a fair bit of which no longer fits into the slide.
Comment 3 Xisco Faulí 2020-06-25 18:16:56 UTC
Created attachment 162413 [details]
Comparison MSO 2010 and LibreOffice 7.1 master
Comment 4 Xisco Faulí 2020-06-25 18:18:42 UTC
Reproduced in

Version: 7.1.0.0.alpha0+
Build ID: 42bf9bdf3d551eb59604f952204c49f7d7a1e913
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

and

Version: 5.2.0.0.alpha0+
Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53
Threads 4; Ver: 4.19; Render: default; 

Locale: en-US (en_US.UTF-8)
Comment 5 Xisco Faulí 2020-06-25 18:20:14 UTC
Also reprpduced in

Version: 4.3.0.0.alpha1+
Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e

and

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 6 Timur 2020-06-26 18:28:10 UTC
Repro OO. Inherited. PPT is fine. 
There's a trick here: after Text Box right-click Position and Size.. it appears OK, until next reload.
Maybe LO is confused with text box small size so it centers wrong.
Comment 7 Gerald Pfeifer 2020-07-17 04:29:56 UTC
Created attachment 163146 [details]
Another two slides exhibiting the same issue, I believe

I believe I ran into this again in a completely different context, and came
to the same conclusion as Timur:

(In reply to Timur from comment #6)
> Maybe LO is confused with text box small size so it centers wrong.

Version: 7.1.0.0.alpha0+
Build ID: 9006cbf6a13317a386194d6857f22391464c2aa0
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2020-07-16_00:51:18
Comment 8 Gerald Pfeifer 2020-07-17 05:08:33 UTC
Created attachment 163147 [details]
Another two slides exhibiting the same issue, I believe (version 2)
Comment 9 Gerald Pfeifer 2020-07-17 05:19:50 UTC
Created attachment 163148 [details]
Comparision 365 and LO 7.1 master of the first page of the second document
Comment 10 Regina Henschel 2020-07-17 14:32:56 UTC
The error is in https://opengrok.libreoffice.org/xref/core/oox/source/drawingml/textbodypropertiescontext.cxx?r=ef08f18e#73

Because MS Office has "not centered" as default and LibreOffice has "centered" in its default style, the value "not centered" needs to be set explicitly.

So instead of
    mrTextBodyProp.mbAnchorCtr = rAttribs.getBool( XML_anchorCtr, false );
    if( mrTextBodyProp.mbAnchorCtr )
        mrTextBodyProp.maPropertyMap.setProperty( PROP_TextHorizontalAdjust, TextHorizontalAdjust_CENTER );

it needs to be
    mrTextBodyProp.mbAnchorCtr = rAttribs.getBool( XML_anchorCtr, false );
    if( mrTextBodyProp.mbAnchorCtr )
        mrTextBodyProp.maPropertyMap.setProperty( PROP_TextHorizontalAdjust, TextHorizontalAdjust_CENTER );
    else
        mrTextBodyProp.maPropertyMap.setProperty( PROP_TextHorizontalAdjust, TextHorizontalAdjust_LEFT );


I have not tested, whether other places have to be adapted in addition. At least the import works with this change.
Comment 11 Gerald Pfeifer 2020-10-29 23:48:35 UTC
Is it possible this has been addressed in the meantime?

I appear not to be able to reproduce this for the original document
nor "Another two slides" with current -dev builds of LO 7.1 and LO 7.0?


Digging into this a bit, it appears bug #137023 (which is newer than
mine ;-) is a duplicate by Xisco that got fixed by Miklos?


- Xisco?
Comment 12 Aron Budea 2020-10-30 05:09:54 UTC
(In reply to Xisco Faulí from comment #4)
> Reproduced in
...
> Version: 5.2.0.0.alpha0+
> Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53
> Threads 4; Ver: 4.19; Render: default; 
This was a bit unfortunate choice of version, indeed the bug is there in 5.2.0.4, but it's gone in 5.3.0.3, thus this wasn't an old issue, but a recent regression.

(In reply to Gerald Pfeifer from comment #11)
> Digging into this a bit, it appears bug #137023 (which is newer than
> mine ;-) is a duplicate by Xisco that got fixed by Miklos?
It's actually a duplicate of bug 129685, confirmed using the bibisect-linux-64-7.1 bibisect repo (bug 137023 is a regression from that other bugfix).

*** This bug has been marked as a duplicate of bug 129685 ***
Comment 13 Xisco Faulí 2020-10-30 08:59:53 UTC
(In reply to Aron Budea from comment #12)
> (In reply to Xisco Faulí from comment #4)
> > Reproduced in
> ...
> > Version: 5.2.0.0.alpha0+
> > Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53
> > Threads 4; Ver: 4.19; Render: default; 
> This was a bit unfortunate choice of version, indeed the bug is there in
> 5.2.0.4, but it's gone in 5.3.0.3, thus this wasn't an old issue, but a
> recent regression.

Ouch, nice catch!! Happy to see the issue is fixed!!