oox/source/export/drawingml.cxx | 7 +++++-- sd/qa/unit/data/odp/tdf118045.odp |binary sd/qa/unit/export-tests-ooxml1.cxx | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-)
New commits: commit 5db7694a6377d32bdef293b4ece27b471c3ea427 Author: Tibor Nagy <nagy.tib...@nisz.hu> AuthorDate: Thu Nov 18 09:05:30 2021 +0100 Commit: László Németh <nem...@numbertext.org> CommitDate: Mon Nov 29 08:50:47 2021 +0100 tdf#118045 PPTX export: fix proportional line spacing If line spacing differs from the default 100%, export it as direct paragraph formatting (similar to the other paragraph style properties). Change-Id: Id5db9ae36018c8a20b832470685bdfbba19d80f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125438 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index af96b14f1ac6..fbe13359dd9b 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -2877,8 +2877,11 @@ bool DrawingML::WriteParagraphProperties( const Reference< XTextContent >& rPara bool bHasLinespacing = false; LineSpacing aLineSpacing; if (GetPropertyAndState(rXPropSet, rXPropState, "ParaLineSpacing", eState) - && eState == beans::PropertyState_DIRECT_VALUE) - bHasLinespacing = ( mAny >>= aLineSpacing ); + && (mAny >>= aLineSpacing) + && (eState == beans::PropertyState_DIRECT_VALUE || + // only export if it differs from the default 100% line spacing + aLineSpacing.Mode != LineSpacingMode::PROP || aLineSpacing.Height != 100)) + bHasLinespacing = true; bool bRtl = false; if (GetProperty(rXPropSet, "WritingMode")) diff --git a/sd/qa/unit/data/odp/tdf118045.odp b/sd/qa/unit/data/odp/tdf118045.odp new file mode 100644 index 000000000000..8b5fac36af4f Binary files /dev/null and b/sd/qa/unit/data/odp/tdf118045.odp differ diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 52b580a95e05..9efb79ae9cf1 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -124,6 +124,7 @@ public: void testPlaceholderFillAndOutlineExport(); void testTdf143126(); void testTdf143129(); + void testTdf118045(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest1); @@ -190,6 +191,7 @@ public: CPPUNIT_TEST(testPlaceholderFillAndOutlineExport); CPPUNIT_TEST(testTdf143126); CPPUNIT_TEST(testTdf143129); + CPPUNIT_TEST(testTdf118045); CPPUNIT_TEST_SUITE_END(); @@ -1733,6 +1735,19 @@ void SdOOXMLExportTest1::testTdf143129() assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:custShow", "id", "0" ); } +void SdOOXMLExportTest1::testTdf118045() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf118045.odp"), ODP); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + xDocShRef->DoClose(); + + xmlDocUniquePtr pXmlDoc1 = parseExport(tempFile, "ppt/slides/slide1.xml"); + assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr/a:lnSpc/a:spcPct", "val", + "110000"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest1); CPPUNIT_PLUGIN_IMPLEMENT();