summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-12-05 19:23:01 +0100
committerAndras Timar <andras.timar@collabora.com>2015-03-31 16:04:40 +0000
commitdebf3ffb87d607704ddea97f6710c3ceaa9a243d (patch)
tree060f4255e50a522f41376c6919a5316aeaee37a0 /sd
parente27d7c38ba1de0f4bbb1197bd84c063a0fdee9d1 (diff)
bnc#910045 wrong cell fill color defined by table style
Problems were with those table styles which used color themes to define cell fill color. Change-Id: Ibde90df81ff253ba65618dde4038093d1caabfe8 Reviewed-on: https://gerrit.libreoffice.org/15089 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/bnc910045.pptxbin0 -> 37522 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx23
2 files changed, 23 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/bnc910045.pptx b/sd/qa/unit/data/pptx/bnc910045.pptx
new file mode 100644
index 000000000000..5788ea929c0e
--- /dev/null
+++ b/sd/qa/unit/data/pptx/bnc910045.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index fb8264ea6e5c..d9d92b965563 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -97,6 +97,7 @@ public:
void testPDFImport();
void testPDFImportSkipImages();
void testBulletSuffix();
+ void testBnc910045();
CPPUNIT_TEST_SUITE(SdImportTest);
@@ -132,6 +133,7 @@ public:
CPPUNIT_TEST(testPDFImport);
CPPUNIT_TEST(testPDFImportSkipImages);
CPPUNIT_TEST(testBulletSuffix);
+ CPPUNIT_TEST(testBnc910045);
CPPUNIT_TEST_SUITE_END();
};
@@ -1139,6 +1141,27 @@ void SdImportTest::testBulletSuffix()
xDocShRef->DoClose();
}
+void SdImportTest::testBnc910045()
+{
+ // Problem with table style which defines cell color with fill style
+ ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/bnc910045.pptx"), PPTX );
+
+ SdDrawDocument *pDoc = xDocShRef->GetDoc();
+ CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
+ const SdrPage *pPage = pDoc->GetPage(1);
+ CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
+
+ sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
+ CPPUNIT_ASSERT( pTableObj );
+ uno::Reference< table::XCellRange > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
+ uno::Reference< beans::XPropertySet > xCell;
+ sal_Int32 nColor;
+
+ xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
+ xCell->getPropertyValue("FillColor") >>= nColor;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(5210557), nColor);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();