sd/qa/unit/data/pptx/tdf119649.pptx |binary sd/qa/unit/import-tests2.cxx | 43 ++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+)
New commits: commit 0350c84a5e6bf7c48cd77c7fcb29a3bbdc1d8c8d Author: Xisco Fauli <[email protected]> AuthorDate: Wed Apr 20 10:10:54 2022 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Wed Apr 20 11:49:37 2022 +0200 tdf#119649: sd_import_tests2: Add unittest Change-Id: Ib09e740a4b0e6b5c6e2769c0310aaf44e3392328 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133199 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sd/qa/unit/data/pptx/tdf119649.pptx b/sd/qa/unit/data/pptx/tdf119649.pptx new file mode 100644 index 000000000000..303d4c0ad877 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf119649.pptx differ diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 7a67debd38d9..0bb99100b9dd 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -74,6 +74,7 @@ public: void testTdf103792(); void testTdf103876(); void testTdf79007(); + void testTdf119649(); void testTdf118776(); void testTdf129686(); void testTdf104015(); @@ -143,6 +144,7 @@ public: CPPUNIT_TEST(testTdf103792); CPPUNIT_TEST(testTdf103876); CPPUNIT_TEST(testTdf79007); + CPPUNIT_TEST(testTdf119649); CPPUNIT_TEST(testTdf118776); CPPUNIT_TEST(testTdf129686); CPPUNIT_TEST(testTdf104015); @@ -511,6 +513,47 @@ void SdImportTest2::testTdf79007() xDocShRef->DoClose(); } +void SdImportTest2::testTdf119649() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf119649.pptx"), PPTX); + uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(1, 0, xDocShRef)); + + // Get first paragraph of the text + uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape)); + + uno::Reference<text::XTextRange> xRun(getRunFromParagraph(0, xParagraph)); + CPPUNIT_ASSERT_EQUAL(OUString("default_color("), xRun->getString()); + + uno::Reference<beans::XPropertySet> xPropSet(xRun, uno::UNO_QUERY_THROW); + + Color nCharColor; + xPropSet->getPropertyValue("CharColor") >>= nCharColor; + CPPUNIT_ASSERT_EQUAL(COL_AUTO, nCharColor); + + xRun.set(getRunFromParagraph(1, xParagraph)); + + // Without the fix in place, this test would have failed with + // - Expected: colored_text + // - Actual : colored_text) + CPPUNIT_ASSERT_EQUAL(OUString("colored_text"), xRun->getString()); + + xPropSet.set(xRun, uno::UNO_QUERY_THROW); + + xPropSet->getPropertyValue("CharColor") >>= nCharColor; + CPPUNIT_ASSERT_EQUAL(Color(0xCE181E), nCharColor); + + xRun.set(getRunFromParagraph(2, xParagraph)); + CPPUNIT_ASSERT_EQUAL(OUString(")"), xRun->getString()); + + xPropSet.set(xRun, uno::UNO_QUERY_THROW); + + xPropSet->getPropertyValue("CharColor") >>= nCharColor; + CPPUNIT_ASSERT_EQUAL(COL_AUTO, nCharColor); + + xDocShRef->DoClose(); +} + void SdImportTest2::testTdf118776() { sd::DrawDocShellRef xDocShRef
