summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAttila Bakos (NISZ) <bakos.attilakaroly@nisz.hu>2022-02-16 16:09:00 +0100
committerAndras Timar <andras.timar@collabora.com>2022-03-09 09:17:22 +0100
commitfabf1247b4d8091f384f64a89e67cd7049f41d4b (patch)
treead41e070c7a6b662510c0354a45fd45930d23596 /sd
parentc3212cf06128a5e43e127d89be0895e9977c4a4f (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> (cherry picked from commit f29c14e8c36819296d0c66bb995201acf0a2647e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130675 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/tdf147121.pptxbin0 -> 32388 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml3.cxx32
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
new file mode 100644
index 000000000000..5762a4b9216b
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf147121.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx
index 1650680a2c30..db33ac9b88c4 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -123,6 +123,7 @@ public:
void testTdf143222_embeddedWorksheet();
void testTdf142235_TestPlaceholderTextAlignment();
void testTdf143315();
+ void testTdf147121();
void testTdf140912_PicturePlaceholder();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest3);
@@ -197,6 +198,7 @@ public:
CPPUNIT_TEST(testTdf143222_embeddedWorksheet);
CPPUNIT_TEST(testTdf142235_TestPlaceholderTextAlignment);
CPPUNIT_TEST(testTdf143315);
+ CPPUNIT_TEST(testTdf147121);
CPPUNIT_TEST(testTdf140912_PicturePlaceholder);
CPPUNIT_TEST_SUITE_END();
@@ -1847,6 +1849,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(