diff options
author | Attila Bakos (NISZ) <bakos.attilakaroly@nisz.hu> | 2022-02-16 16:09:00 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2022-02-28 14:53:55 +0100 |
commit | f29c14e8c36819296d0c66bb995201acf0a2647e (patch) | |
tree | 528471db78d9f19ace0242fd11c4a27d9bacd5bb /sd | |
parent | 259a8e59107bb0a3d4f4f4bb7e056ce1e4231da2 (diff) |
tdf#147121 PPTX: fix regression of font size export of empty lines
If the empty line has got direct formatted font size,
don't forget to export it, unless the master setting
is applied.
Regression from commit b6b02e0b4c9d739836e1f61a886ea45b01e6696e
"tdf#111903 tdf#137152 PPTX export: fix placeholders".
Change-Id: If686e487bca9c198fd7c96860a21e4efe91381bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130005
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf147121.pptx | bin | 0 -> 32388 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml3.cxx | 32 |
2 files changed, 32 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf147121.pptx b/sd/qa/unit/data/pptx/tdf147121.pptx Binary files differnew file mode 100644 index 000000000000..5762a4b9216b --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf147121.pptx diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index cb1ad50ac2ed..58b4d3680da9 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -103,6 +103,7 @@ public: void testTdf143222_embeddedWorksheet(); void testTdf142235_TestPlaceholderTextAlignment(); void testTdf143315(); + void testTdf147121(); void testTdf140912_PicturePlaceholder(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest3); @@ -177,6 +178,7 @@ public: CPPUNIT_TEST(testTdf143222_embeddedWorksheet); CPPUNIT_TEST(testTdf142235_TestPlaceholderTextAlignment); CPPUNIT_TEST(testTdf143315); + CPPUNIT_TEST(testTdf147121); CPPUNIT_TEST(testTdf140912_PicturePlaceholder); CPPUNIT_TEST_SUITE_END(); @@ -1828,6 +1830,36 @@ void SdOOXMLExportTest3::testTdf143315() assertXPath(pXml, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr/a:buChar", 0); } +void SdOOXMLExportTest3::testTdf147121() +{ + // Get the bugdoc + ::sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf147121.pptx"), PPTX); + + CPPUNIT_ASSERT(xDocShRef); + // Get the second line props of the placeholder + uno::Reference<drawing::XDrawPage> xPage(getPage(0, xDocShRef)); + uno::Reference<beans::XPropertySet> xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xRun( + getRunFromParagraph(2, getParagraphFromShape(0, xShape)), uno::UNO_QUERY_THROW); + + // Save the font size + const auto nFontSizeBefore = xRun->getPropertyValue("CharHeight").get<float>() * 100; + + // Save and reload + utl::TempFile tmpfile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tmpfile); + xDocShRef->DoClose(); + + // Parse the export + xmlDocUniquePtr pXml = parseExport(tmpfile, "ppt/slides/slide1.xml"); + const auto nFontSizeAfter + = getXPath(pXml, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:br[1]/a:rPr", "sz").toFloat(); + + // The font size was not saved before now it must be equal with the saved one. + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected font size", nFontSizeBefore, nFontSizeAfter); +} + void SdOOXMLExportTest3::testTdf140912_PicturePlaceholder() { ::sd::DrawDocShellRef xDocShRef = loadURL( |