diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-04-20 10:10:54 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-04-20 11:49:37 +0200 |
commit | 0350c84a5e6bf7c48cd77c7fcb29a3bbdc1d8c8d (patch) | |
tree | e25eab4f188a713b2d0a1d577aceaec78d5de68d /sd | |
parent | f2ab1375b266d7465ef31d06ec8f949c6b91d853 (diff) |
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf119649.pptx | bin | 0 -> 21228 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests2.cxx | 43 |
2 files changed, 43 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf119649.pptx b/sd/qa/unit/data/pptx/tdf119649.pptx Binary files differnew file mode 100644 index 000000000000..303d4c0ad877 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf119649.pptx 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 |