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>
This commit is contained in:
Xisco Fauli 2022-04-20 10:10:54 +02:00
parent f2ab1375b2
commit 0350c84a5e
2 changed files with 43 additions and 0 deletions

Binary file not shown.

View File

@ -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