Description: Saving a created Impress file to PPTX format changes the line spacing. In the original (ODP) file the line spacing was set to 'At Least 1.00 cm'. In the saved PPTX file the line spacing has changed to 'Fixed 1.00 cm'. The lines are squeezed both when opened in Powerpoint on Windows, and in LibreOffice, so the error is on saving the file. The slightly unusual line spacing is because the text was copied from a Microsoft Word document, but that shouldn't matter, as it happens also when manually setting the line spacing to that value. Steps to Reproduce: 1. Create a new Impress document 2. Add some text in a text box 3. Set the line spacing of the text to 'At Least' '1 cm /0.2 inch or similar value 4. Save to PPTX format 5. Close the file 6. reopen the PPTX file and see the lines squeezed (inspect the line spacing) Actual Results: Lines are squeezed in the PPTX file Expected Results: Lines should have adequate line spacing Reproducible: Always User Profile Reset: Yes Additional Info: Version: 6.3.4.2 Build ID: 60da17e045e08f1793c57c00ba83cdfce946d0aa CPU threads: 4; OS: Mac OS X 10.13.6; UI render: default; VCL: osx; Locale: nl-NL (en_NL.UTF-8); UI-Language: en-US Calc: threaded
Created attachment 156607 [details] Test file in ODP format This is the ODP file that has the correct layout.
Created attachment 156608 [details] PPTX file This is the PPTX file that has the wrong spacing
Regression introduced by: https://cgit.freedesktop.org/libreoffice/core/commit/?id=ef2e9b19a52e04ae0ed45900bcf64bf375a910ef author Tamás Zolnai <tamas.zolnai@collabora.com> 2017-09-25 21:42:57 +0200 committer Tamás Zolnai <tamas.zolnai@collabora.com> 2017-09-26 14:06:22 +0200 commit ef2e9b19a52e04ae0ed45900bcf64bf375a910ef (patch) tree 84ed81f6c7c56618623c4b38512287916065b184 parent 616fc7a79f35f4db65b58d34ff6d6e806ff9a6ef (diff) tdf#112647: Fixed line spacing is saved incorrectly to PPTX Bisected with: bibisect-linux64-6.0 Adding Cc: to Tamás Zolnai
It appears that PPT does not have the option 'At Least' for line spacing. It only has proportional (a:spcPct) and fixed (a:spcPts). So on import a:spcPts is always converted to LineSpacingMode::FIX, although there is a test in textspacing.hxx TextSpacing() for bExactValue, but this is set to true in the import. On export, the value is always output as fixed in DrawingML::WriteLinespacing, as there is no other choice. So there will always be a loss of information. I would propose to convert LineSpacingMode::MINIMUM to a fixed linespace in the PPT file with a value that is the maximum of the supplied value, and the value for single line spacing. That seems to me the best approximation. It is this code in DrawingML::WriteLinespacing else { mpFS->singleElementNS( XML_a, XML_spcPts, XML_val, OString::number(std::lround(rSpacing.Height / 25.4 * 72))); }
Tibor Nagy committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/fc1e5202cbfb36b28b0e597811f39895c19ae6ba tdf#129430 PPTX export: fix workaround for "At least" line spacing It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Verified in: Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community Build ID: 3a61cce54277fd12570103a191c50d9b37ef3dd3 CPU threads: 8; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win Locale: hu-HU (hu_HU); UI: hu-HU Calc: CL
Tibor Nagy committed a patch related to this issue. It has been pushed to "libreoffice-7-3": https://git.libreoffice.org/core/commit/8cb29f4154730713878ddd3c273600411ddaf5fe tdf#129430 PPTX export: fix workaround for "At least" line spacing It will be available in 7.3.0.0.beta2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.