Bug 104202 - FILEOPEN: PPTX: Text is shifted to the right, left alignment opens as center
Summary: FILEOPEN: PPTX: Text is shifted to the right, left alignment opens as center
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
(earliest affected)
Hardware: All All
: medium normal
Assignee: Not Assigned
Keywords: bibisected, bisected, filter:pptx
: 114608 (view as bug list)
Depends on:
Blocks: PPTX-Textbox
  Show dependency treegraph
Reported: 2016-11-27 14:22 UTC by Xisco Faulí
Modified: 2022-02-11 12:18 UTC (History)
8 users (show)

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

Test compared MSO 2016 LO 7.1+ (56.55 KB, image/png)
2020-06-26 18:27 UTC, Timur
Text anchor settings in Impress and PP (115.44 KB, image/png)
2021-01-14 09:17 UTC, NISZ LibreOffice Team
The master slide (63.89 KB, image/jpeg)
2021-12-09 09:05 UTC, Attila Bakos (NISZ)

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2016-11-27 14:22:38 UTC
Steps to reproduce:
1. Open attachment 106313 [details]

Observed behaviour: Second line is shifted to the right. it should be aligned with the first line

Reproduced in:

Build ID: 690f553ecb3efd19143acbf01f3af4e289e94536
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk2; Layout
Engine: new; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

but not in

Build ID: ada8a2123ea655142be74a11c23e042a0109d5f8
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk3; Layout
Engine: new; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 1 Xisco Faulí 2016-11-27 14:25:22 UTC
Regression introduced by:

author	Zolnai Tamás <tamas.zolnai@collabora.com>	2014-12-22 15:36:27 (GMT)
committer	Zolnai Tamás <tamas.zolnai@collabora.com>	2014-12-22 15:36:59 (GMT)
commit 7a64988dbc7a1542aa38f0e8f9a8a47941fbc67d (patch)
tree 8359b96d20f356c946d192e3c6c474208a7376ce
parent 89206c472ecf18bfde6824cea8004921cd404365 (diff)

bnc#862510: PPTX import: Wrong text vertical adjustment inside shape.
When alignment is not specified, it should be set to the
default "left" value just on time, when properties are
pushed to the property set, otherwise uninitialized value
is better.

Adding Cc: to Zolnai Tamás
Comment 2 QA Administrators 2017-11-28 08:39:44 UTC Comment hidden (obsolete)
Comment 3 Regina Henschel 2019-10-02 19:47:46 UTC
I see the problem still in Version: (x64)
Build ID: b2d8093b19642038631dfb8f1ab6745a380a652c
CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-09-23_22:42:37
Locale: de-DE (en_US); UI-Language: en-US
Calc: threaded

The two objects are presentation objects, no custom shapes.
Comment 4 Timur 2020-06-26 18:27:07 UTC
Created attachment 162433 [details]
Test compared MSO 2016 LO 7.1+
Comment 5 NISZ LibreOffice Team 2021-01-14 09:17:41 UTC
Created attachment 168870 [details]
Text anchor settings in Impress and PP

In PP the alignment of the textbox is Top, but it's opened in Impress as if it was Top Centered in PP.
Comment 6 NISZ LibreOffice Team 2021-01-15 08:52:10 UTC
*** Bug 114608 has been marked as a duplicate of this bug. ***
Comment 7 Attila Bakos (NISZ) 2021-12-09 09:05:11 UTC
Created attachment 176831 [details]
The master slide

And finally i have reached this one. I think the problem comes from the master slide (as shown in my picture), if there i change the alignment to left, everything fine, so there is a file open problem with the setting priority. PP overrides the master slide setting Impress does not, however should. Hopefully if i change the order of the property applying that might be the solution.
Comment 8 Justin L 2022-02-11 12:18:55 UTC
I think regression flag can safely be removed. It just happened to look better when the default of left align was forced on it.

The problem is that the slide should not be inheriting the textbox from the master. (For example, if MS Office adds a fill to the master's subtitle textbox, slide1 doesn't get that fill.) The title textbox in the slide mirrors the master, but not the subtitle textbox. [Problem already seen in LO 3.5 bibisect.]

The issue seems to be that master is
    <p:ph type="subTitle" sz="quarter" idx="1"/>
but the slide is different ID
    <p:ph type="subTitle" sz="quarter" idx="4294967295"/>

If I set the slide's idx to 1, then MS 2010 opens like LO - i.e. the master's textbox settings apply to the slide's textbox.

There was major re-work done in the LO 4.4-ish timeframe. 
commit cc6ae367280d205a88c6f907b20b84613221ca52
Author: Matúš Kukan on Thu Aug 7 13:25:51 2014 +0200
    bnc#821916: Better algorithm to find placeholder shape.

// Function to find placeholder (ph) for a shape. No idea how MSO implements
// this, but this order seems to work quite well
// (probably it's unnecessary complicated / wrong):
// 1. ph with nFirstSubType and the same oSubTypeIndex
// 2. ph with nFirstSubType
// 3. ph with nSecondSubType and the same oSubTypeIndex
// 4. ph with nSecondSubType
// 5. ph with the same oSubTypeIndex

Forcing an idx reference to only match a master with the same idx fixed the bad textbox inheritance problem (from slideLayouts) and didn't cause any real unit test failures, but it did cause the blue colour (from slideMasters) to disappear in this examples test.pptx. [Obviously not a complete or safe solution.]