summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@collabora.com>2022-01-11 02:06:52 +0300
committerAndras Timar <andras.timar@collabora.com>2022-02-20 13:48:34 +0100
commitc92aa69bc63ffb2dddbde0bfb3fe80c7de67a06f (patch)
tree7c6b5cf771b1a5b75dfd21dab6200b0fcdeb8e41 /oox
parent2b80f5a1646308ed43d1d7fee6ce3cefdc9e05e3 (diff)
tdf#146690: pptx export: fix endParaRPr size value for empty paragraphs
Fixes paragraphs made from a single new line, not getting the correct sz(text size) value in EndParagraphRunProperties on pptx export Change-Id: I31ebb5735ad392e081aa2f43b0b60a845e4de9c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128265 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'oox')
-rwxr-xr-xoox/qa/unit/data/endParaRPr-newline-textsize.pptxbin0 -> 13349 bytes
-rw-r--r--oox/qa/unit/export.cxx21
-rw-r--r--oox/source/export/drawingml.cxx4
3 files changed, 25 insertions, 0 deletions
diff --git a/oox/qa/unit/data/endParaRPr-newline-textsize.pptx b/oox/qa/unit/data/endParaRPr-newline-textsize.pptx
new file mode 100755
index 000000000000..109f818ec8a7
--- /dev/null
+++ b/oox/qa/unit/data/endParaRPr-newline-textsize.pptx
Binary files differ
diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx
index 86656a0f8f68..24090b8e3cb3 100644
--- a/oox/qa/unit/export.cxx
+++ b/oox/qa/unit/export.cxx
@@ -395,6 +395,27 @@ CPPUNIT_TEST_FIXTURE(Test, testReferToTheme)
"75000");
assertXPath(pXmlDoc, "//p:sp[3]/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:schemeClr/a:lumOff", 0);
}
+
+CPPUNIT_TEST_FIXTURE(Test, testTdf146690_endParagraphRunPropertiesNewLinesTextSize)
+{
+ // Given a PPTX file that contains references to a theme:
+ OUString aURL
+ = m_directories.getURLFromSrc(DATA_DIRECTORY) + "endParaRPr-newline-textsize.pptx";
+
+ // When saving that document:
+ loadAndSave(aURL, "Impress Office Open XML");
+
+ std::unique_ptr<SvStream> pStream = parseExportStream(getTempFile(), "ppt/slides/slide1.xml");
+ xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get());
+ // Then make sure the shape text color is a scheme color:
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 500
+ // - Actual : 1800
+ // i.e. the endParaRPr 'size' wasn't exported correctly
+ assertXPath(pXmlDoc, "//p:sp[1]/p:txBody/a:p[1]/a:endParaRPr", "sz", "500");
+ assertXPath(pXmlDoc, "//p:sp[1]/p:txBody/a:p[2]/a:endParaRPr", "sz", "500");
+ assertXPath(pXmlDoc, "//p:sp[1]/p:txBody/a:p[3]/a:endParaRPr", "sz", "500");
+}
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 87bbe81bd88a..cb5383104a61 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -3142,7 +3142,11 @@ void DrawingML::WriteParagraph( const Reference< XTextContent >& rParagraph,
Reference< XPropertySet > xFirstRunPropSet (run, UNO_QUERY);
Reference< XPropertySetInfo > xFirstRunPropSetInfo = xFirstRunPropSet->getPropertySetInfo();
if( xFirstRunPropSetInfo->hasPropertyByName("CharHeight") )
+ {
fFirstCharHeight = xFirstRunPropSet->getPropertyValue("CharHeight").get<float>();
+ rnCharHeight = 100 * fFirstCharHeight;
+ rbOverridingCharHeight = true;
+ }
WriteParagraphProperties(rParagraph, fFirstCharHeight, XML_pPr);
bPropertiesWritten = true;
}