Bug Hunting Session
Bug 51340 - FILEOPEN: PPTX - Master-slide style-level line spacing not applied to line that has a different paragraph-level above paragraph spacing
Summary: FILEOPEN: PPTX - Master-slide style-level line spacing not applied to line th...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: Other All
: high normal
Assignee: Tamás Zolnai
URL:
Whiteboard: BSA target:6.1.0 target:6.0.2
Keywords:
: 115693 (view as bug list)
Depends on:
Blocks: 107840 PPTX-Paragraph
  Show dependency treegraph
 
Reported: 2012-06-22 10:17 UTC by René Peinl
Modified: 2018-02-15 19:53 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Test document to show the described problem. (379.66 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2012-07-05 08:56 UTC, René Peinl
Details
Another test PPTX - Screenshot PPT original slide left and Impress 4.0 right. (191.59 KB, image/png)
2013-02-07 16:20 UTC, René Peinl
Details
Another test PPTX - screenshot showing different behavior in 4.1.4.2 (94.19 KB, image/png)
2014-01-29 09:16 UTC, René Peinl
Details
Another test PPTX related to the screenshots (507.11 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2014-01-29 09:17 UTC, René Peinl
Details
Simple PPTX created from scratch in MSO 2010 (32.06 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2016-10-25 15:50 UTC, Timur
Details
Third PPTX example, opposite behavior (77.73 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2016-10-25 16:06 UTC, Timur
Details
Simple PPTX example, created from scratch in MSO 2016 (33.50 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2016-10-25 18:19 UTC, René Peinl
Details
Image showing view in PPTX to the left and view in Impress to the right (27.72 KB, image/png)
2016-10-25 18:20 UTC, René Peinl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description René Peinl 2012-06-22 10:17:23 UTC
Problem description: 
I have PPTX files created with PowerPoint 2010 / Win7 and open them on Ubuntu 12.04 with LibreOffice 3.5.3.2.
In PowerPoint, the line spacing was set to be multiple lines, namely 1.3. 
Furthermore, there was a paragraph spacing of 6 px after each paragraph. In Impress there is no spacing at all neither on line nor on paragraph level.

Steps to reproduce:
1. Open attached PPTX file
2. scroll to page 3, 6, or 16
3. notice that there are no spaces

Current behavior:
spacing is not correctly read from pptx

Expected behavior:
spacing should be read correctly when opening pptx

Platform (if different from the browser): 
              
Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0
Comment 1 bfoman (inactive) 2012-07-05 04:31:56 UTC
Could you attach any example documents to allow others to check on different
system/build?
Comment 2 René Peinl 2012-07-05 08:45:56 UTC
There was an attachment, when I created the issue. What happened to it?
Comment 3 René Peinl 2012-07-05 08:56:05 UTC
Created attachment 63864 [details]
Test document to show the described problem.

This is not the original attachment I uploaded but the line spacing is here 1,5 lines in PPT and none in LibreOffice.
Comment 4 René Peinl 2012-07-05 09:04:42 UTC
I added a new document. It has the same problem. I can reproduce the problem with LibreOffice 3.5.4 on Windows 7 64 Bit. It just seems that no line spacing at all is imported from pptx. My first thought was that it's due to unit conversion since in Word the spacing is called multiple and takes values from 0.x to 3.0 or something, whereas in Impress the equivalent is called proportional and takes percentage values.
Then upon closer inspection I saw that Impress shows the correct line spacing in the format paragraph dialog FOR THE TEXT PLACEHOLDER. Unfortunately it does not affect the text inside the placeholder. There the linespacing is single. 
In PowerPoint I see no difference between the placeholder settings and those of the text inside the placeholder. Maybe Impress is just missing "inheritage" of paragraph formatting.
Comment 5 Joel Madero 2012-11-20 18:08:41 UTC
Verified.

LibO: 3.6.3.2

Marking as NEW and prioritizing:

Normal: Can prevent users from making high quality work

High: PPTX is becoming the standard, especially in professional settings, furthermore line spacing is an incredibly popular thing to do in slides.
Comment 6 René Peinl 2013-02-07 16:19:55 UTC
Bug still present in LibreOffice 4.0.0.3 (see screenshot attached)
Comment 7 René Peinl 2013-02-07 16:20:58 UTC
Created attachment 74361 [details]
Another test PPTX - Screenshot PPT original slide left and Impress 4.0 right.
Comment 8 René Peinl 2013-07-25 14:50:49 UTC
Problem still present in Impress 4.1.0.4
More than 3000 bugs fixed but this one is still there. Is it really so hard?
I've analyzed what's happening and it seems like Impress is reading the master layout correctly, but doesn't apply the text styles defined there to the single slides. 
I used slide 5 of the Impress_test.pptx uploaded earlier as an example. 
On the text level it says:
<a:p> <a:pPr lvl="1"/> 
   <a:r> <a:rPr lang="de-DE" dirty="0" smtClean="0"/>
   <a:t>Erstellen eines integrierten </a:t> ...
That means: paragraph with outline level 1
In the master slide you find the corresponding
<p:txStyles><p:bodyStyle>
  <a:lvl1pPr marL="180975" indent="-180975" algn="l" rtl="0" eaLnBrk="1" fontAlgn="base" hangingPunct="1">
  <a:lnSpc><a:spcPct val="150000"/></a:lnSpc>  ...

Impress doesn't seem to apply this line spacing to the paragraph.
I think it might be related to other bugs dealing with slide master. 
e.g., when I create a new slide in Impress from the Impress_test.pptx, it shows an object placeholder instead of a text placeholder

Possible related bugs include:
https://bugs.freedesktop.org/show_bug.cgi?id=47425
https://bugs.freedesktop.org/show_bug.cgi?id=53395
https://bugs.freedesktop.org/show_bug.cgi?id=61894
https://bugs.freedesktop.org/show_bug.cgi?id=63008
https://bugs.freedesktop.org/show_bug.cgi?id=65003

Maybe you should create a new super-bug collecting all of those and give it a higher priority.
Comment 9 Joel Madero 2013-07-25 14:58:52 UTC
We try to avoid a bunch of meta bugs as they just clog FDO and don't help much in terms of getting things fixed.

In terms of "is it really that hard" - our devs time is stretched very thin - prioritizing bugs is a mix of how important the bug is, how much time it will take to fix, the time constraints of devs, the interest of the devs (especially volunteers) in fixing the bug, and a few other things - so to answer your question - it will get fixed and comparing it to the 3000 (or whatever the # is) and saying "why not ONE MORE" isn't incredibly helpful as I promise, our devs are working hard to tackle a long list of issues/interests/features/etc...
Comment 10 René Peinl 2013-11-05 13:14:48 UTC
Problem still present in LibreOffice 4.1.2 on Win7
@Joel: agreed that the question on how hard it is was not helpful. Hopefully my other analysis was more helpful.
Comment 11 Marcos Souza 2014-01-15 02:28:28 UTC
I discovered where's the code who imports the linespacing:
oox/source/drawingml/textspacingcontext.cxx

I put some prints in this code and it seems to import the right value(it imports 150000, 110000 and 423 a lot of time each one)

So, what's the next step? Maybe I need to track where are used these values? How can I do this?

Thanks since now for the help!

(I'm planning to debug this code and look who's calling  this method and who's using these values)
Comment 12 René Peinl 2014-01-29 09:14:20 UTC
Nice, it seems that someone has worked on this, since the result is different in LibreOffice 4.1.4.2.
Unfortunately, things got worse now, as you can see in the new screenshot. 
I've also included the PPT slide that served as a basis for the screenshot.
Comment 13 René Peinl 2014-01-29 09:16:22 UTC
Created attachment 92978 [details]
Another test PPTX - screenshot showing different behavior in 4.1.4.2
Comment 14 René Peinl 2014-01-29 09:17:04 UTC
Created attachment 92979 [details]
Another test PPTX related to the screenshots
Comment 15 Kevin Suo 2014-03-28 07:58:42 UTC
Should be a duplicate of bug 48350:
FILESAVE: missing <w:spacing w:after="0" w:before="0"/> in new document.docx

*** This bug has been marked as a duplicate of bug 48350 ***
Comment 16 René Peinl 2014-03-28 09:14:51 UTC
If the problem will be fixed, I'm fine with that, but currently it seems a bit like lowering the number of open bugs without having to fix them.
Please have a detailed look at comment 4 and then rethink your judgement regarding duplication of bugs.
Comment 17 Owen Genat (retired) 2014-09-13 11:02:42 UTC
Attachment 92979 [details] tested under GNU/Linux using:

- v3.5.7.2 Build ID: 3215f89-f603614-ab984f2-7348103-1225a5b
- v4.1.6.2 Build ID: 40ff705089295be5be0aae9b15123f687c05b0a
- v4.2.6.3 Build ID: 3fd416d4c6db7d3204c17ce57a1d70f6e531ee21
- v4.3.1.2 Build ID: 958349dc3b25111dbca392fbc281a05559ef6848
- v4.4.0.0.alpha0+ Build ID: 037d03b9facb414ba6be01fa6ee92fc7ca89f70c TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-09-11_00:32:52

In all cases it renders as indicated in the right hand side of attachment 74361 [details].
Comment 18 Timur 2016-10-25 15:30:16 UTC
attachment 63864 [details]: Line spacing was 1,5 lines in OO (it looked wrong because of wrong text size). Regression from LO 3.5.
Comment 19 Timur 2016-10-25 15:50:48 UTC
Created attachment 128256 [details]
Simple PPTX created from scratch in MSO 2010

Looks like this can't be repro from scratch, as in my example. Please test other cases and add "specific PPTX" to the title if confirmed.
Comment 20 Timur 2016-10-25 16:06:58 UTC
Created attachment 128262 [details]
Third PPTX example, opposite behavior

This is the third PPTX example, but with opposite behavior. Unlike the first one, which was OK until LO 3.4 and wrong from 3.5, this one was wrong before and fine since - speaking about fileopen. 
This one attached has a problem with filesave, original spacing is changed from before 12pt and after 2pt to 0.00cm (as seen with FORMAT -> PARAGRAPH -> tab INDENTS & SPACING).
Comment 21 René Peinl 2016-10-25 18:19:03 UTC
Created attachment 128265 [details]
Simple PPTX example, created from scratch in MSO 2016

It can be reproduced from scratch. Here is what I did: 

1) Open MS PowerPoint (I have version 2016 installed, but as the history shows, this can be reproduced with all versions back to 2010 at least, I think 2007 will work as well).

2) Open master slide view

3) go to slide master "title with content"

4) change the line spacing of the contents (I used spacing 1,5 and after 12pt)

5) close master view

6) change slide layout to "title with content"

7) create three lines of text

8) change the font of all lines to Arial 

9) change the line spacing of the second line (I used 18pt before)

10) create some reference objects (I used squares and lines) to indicate the upper limit of the text lines

11) save as pptx

12) open in LibreOffice Impress (I currently have 5.1.0.3 but it works back in all the other versions as well as the bug history shows). See the difference (see screenshot attached)
Comment 22 René Peinl 2016-10-25 18:20:34 UTC
Created attachment 128266 [details]
Image showing view in PPTX to the left and view in Impress to the right
Comment 23 Yousuf Philips (jay) (retired) 2017-05-14 06:57:32 UTC
(In reply to René Peinl from comment #21)
> Created attachment 128265 [details]
> Simple PPTX example, created from scratch in MSO 2016

So i investigated the file and things arent aligned correctly for 2 reasons.

1) Line spacing on 'Second Line' is incorrectly being imported as single rather than 1.5 lines, likely because of the above paragraph spacing on that line is set to 18pt with direct formatting. This is the relevant xml code

<a:p>
  <a:pPr>
    <a:spcBef>
      <a:spcPts val="1800" />
    </a:spcBef>
  </a:pPr>
  <a:r>
    <a:rPr lang="de-DE" dirty="0">
      <a:latin typeface="Arial" ... />
      <a:cs typeface="Arial" ... />
    </a:rPr>
    <a:t>Second Line</a:t>
  </a:r>
</a:p>

2) The above paragraph spacing isnt moving the first line down, which is a global problem, so i've opened a separate bug for that (bug 107840).
Comment 24 Xisco Faulí 2018-01-26 17:44:33 UTC
Still reproducible in

Version: 6.1.0.0.alpha0+
Build ID: 5cb225b0b3dbb55fd44899b1fb16bdcfeb866849
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded
Comment 25 Tamás Zolnai 2018-02-14 01:12:35 UTC
*** Bug 115693 has been marked as a duplicate of this bug. ***
Comment 26 Commit Notification 2018-02-14 03:09:13 UTC
Tamás Zolnai committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=53551d49d3be2301985f2cf2d8bb23ff374ecfd1

tdf#51340: Line spacing is imported incorrectly from PPTX

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 27 Commit Notification 2018-02-15 12:16:42 UTC
Tamás Zolnai committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5fba3d6ddef478b12bd15906682474400845a02b&h=libreoffice-6-0

tdf#51340: Line spacing is imported incorrectly from PPTX

It will be available in 6.0.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 28 Tamás Zolnai 2018-02-15 19:53:00 UTC
I tested more test documents attached to this bug report and the result seems good, so I close this bug as fixed. If there is still any test case with the same issue, leave a comment pointing to the exact test document.