From 1eed2e57b1848e8f129e98d1bbdb5f8851740d6b Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Thu, 27 Jul 2023 08:43:59 +0200 Subject: pptx: import shape text from master page If shape has custom text defined in master page but no text itself - don't prefer placeholder text but text from master page. Change-Id: Id4f7aeca0e74ecd8565905cd656a182c1195fa30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154980 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro --- sd/qa/unit/data/pptx/shape-master-text.pptx | Bin 0 -> 32645 bytes sd/qa/unit/import-tests2.cxx | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 sd/qa/unit/data/pptx/shape-master-text.pptx (limited to 'sd') diff --git a/sd/qa/unit/data/pptx/shape-master-text.pptx b/sd/qa/unit/data/pptx/shape-master-text.pptx new file mode 100644 index 000000000000..ca056b852d3a Binary files /dev/null and b/sd/qa/unit/data/pptx/shape-master-text.pptx differ diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index e3fe25a955ac..1168fdabeb55 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -147,6 +147,7 @@ public: void testTdf149961AutofitIndentation(); void testTdf149588TransparentSolidFill(); void testOverflowBehaviorClip(); + void testShapeMasterText(); CPPUNIT_TEST_SUITE(SdImportTest2); @@ -227,6 +228,7 @@ public: CPPUNIT_TEST(testTdf149961AutofitIndentation); CPPUNIT_TEST(testTdf149588TransparentSolidFill); CPPUNIT_TEST(testOverflowBehaviorClip); + CPPUNIT_TEST(testShapeMasterText); CPPUNIT_TEST_SUITE_END(); }; @@ -2051,6 +2053,17 @@ void SdImportTest2::testOverflowBehaviorClip() } } +void SdImportTest2::testShapeMasterText() +{ + createSdImpressDoc("pptx/shape-master-text.pptx"); + uno::Reference xShape(getShapeFromPage(0, 0)); + + uno::Reference const xParagraph(getParagraphFromShape(0, xShape)); + + uno::Reference xRun(getRunFromParagraph(0, xParagraph)); + CPPUNIT_ASSERT_EQUAL(OUString("Custom"), xRun->getString()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest2); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit v1.2.3