Bug 51340

Summary: FORMATTING: Line spacing and spacing above/blow paragraph not correctly imported from PPTX 2010
Product: LibreOffice Reporter: René Peinl <rene.peinl>
Component: PresentationAssignee: Not Assigned <libreoffice-bugs>
Status: NEW --- QA Contact:
Severity: normal    
Priority: high CC: bfo.bugmail, jmadero.dev, suokunlong, thb
Version: 3.5.3 release   
Hardware: Other   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=48350
Whiteboard: BSA
i915 platform: i915 features:
Attachments: Test document to show the described problem.
Screenshot showing PPT original slide left and opening the slide in Impress 4.0 right.
New screenshot showing the different behavior in version 4.1.4.2
Test document related to the screenshots

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 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]
Screenshot showing PPT original slide left and opening the slide in 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]
New screenshot showing the different behavior in version 4.1.4.2
Comment 14 René Peinl 2014-01-29 09:17:04 UTC
Created attachment 92979 [details]
Test document 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 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].

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.