diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-10-02 10:49:28 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-10-02 12:34:16 +0200 |
commit | 800bf1071a30955ff70373b2fb5886eadce59dee (patch) | |
tree | 18b19588dc41a64ed8444114e6364365d8f1c476 /sd/qa/unit/import-tests.cxx | |
parent | dbd4d6963280da4c3465532da8778e67ed3271c5 (diff) |
Related: tdf#120028 PPTX import: fix font color of multi-col shape text
Not just font color, anything defined via list styles were not imported.
Change-Id: I95e6fc52e30a09ff93fb55d0836e45e177a7b099
Reviewed-on: https://gerrit.libreoffice.org/61230
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'sd/qa/unit/import-tests.cxx')
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 37e50f3ef931..cff2292aaca0 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -190,6 +190,7 @@ public: void testPptCrop(); void testTdf119015(); void testTdf120028(); + void testTdf120028b(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -273,6 +274,7 @@ public: CPPUNIT_TEST(testPptCrop); CPPUNIT_TEST(testTdf119015); CPPUNIT_TEST(testTdf120028); + CPPUNIT_TEST(testTdf120028b); CPPUNIT_TEST_SUITE_END(); }; @@ -2595,6 +2597,43 @@ void SdImportTest::testTdf120028() xDocShRef->DoClose(); } +void SdImportTest::testTdf120028b() +{ + // Check that the table shape has 4 columns. + ::sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf120028b.pptx"), PPTX); + uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(), + uno::UNO_QUERY); + CPPUNIT_ASSERT(xDoc.is()); + + uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xPage.is()); + + uno::Reference<beans::XPropertySet> xShape(getShape(0, xPage)); + CPPUNIT_ASSERT(xShape.is()); + + uno::Reference<table::XColumnRowRange> xModel(xShape->getPropertyValue("Model"), + uno::UNO_QUERY); + CPPUNIT_ASSERT(xModel.is()); + + uno::Reference<table::XTableColumns> xColumns = xModel->getColumns(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), xColumns->getCount()); + + // Check font color in the A1 cell. + uno::Reference<table::XCellRange> xCells(xModel, uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xCell(xCells->getCellByPosition(0, 0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xParagraph(getParagraphFromShape(0, xCell)); + uno::Reference<text::XTextRange> xRun(getRunFromParagraph(0, xParagraph)); + uno::Reference<beans::XPropertySet> xPropSet(xRun, uno::UNO_QUERY); + sal_Int32 nCharColor = 0; + xPropSet->getPropertyValue("CharColor") >>= nCharColor; + // This was 0x1f497d, not white: text list style from placeholder shape + // from slide layout was ignored. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffff), nCharColor); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |