summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2019-12-27 21:06:08 +0300
committerAndras Timar <andras.timar@collabora.com>2020-01-07 14:49:34 +0100
commit1bc8726a3ae59c10c87abc993aa053da621c4436 (patch)
tree6d8b5749662f80b9c0d6d95b3f69976180663a2a /sd
parentf05e5581badb9a258f778333007173512076fe0b (diff)
tdf#107604 Handle predefined table styles.
Handle table styles that we have just style-id and have not corresponding style defination in tableStyle.xml Change-Id: Id06f5508d5eb1330b5bac1634c520c3066c09139 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86068 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86326
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/predefined-table-style.pptxbin0 -> 36430 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx30
2 files changed, 30 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/predefined-table-style.pptx b/sd/qa/unit/data/pptx/predefined-table-style.pptx
new file mode 100644
index 000000000000..5c3429f9e949
--- /dev/null
+++ b/sd/qa/unit/data/pptx/predefined-table-style.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 5cab4e7ae8cd..79a856d031f6 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -137,6 +137,7 @@ public:
void testN862510_4();
void testBnc870237();
void testBnc887225();
+ void testPredefinedTableStyle();
void testBnc591147();
void testCreationDate();
void testBnc584721_1();
@@ -236,6 +237,7 @@ public:
CPPUNIT_TEST(testN862510_4);
CPPUNIT_TEST(testBnc870237);
CPPUNIT_TEST(testBnc887225);
+ CPPUNIT_TEST(testPredefinedTableStyle);
CPPUNIT_TEST(testBnc591147);
CPPUNIT_TEST(testCreationDate);
CPPUNIT_TEST(testBnc584721_1);
@@ -877,6 +879,34 @@ void SdImportTest::testCreationDate()
xDocShRef->DoClose();
}
+void SdImportTest::testPredefinedTableStyle()
+{
+ // 073A0DAA-6AF3-43AB-8588-CEC1D06C72B9 (Medium Style 2)
+ sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/predefined-table-style.pptx"), PPTX );
+ const SdrPage *pPage = GetPage( 1, xDocShRef );
+
+ 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(0), nColor);
+
+ xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
+ xCell->getPropertyValue("FillColor") >>= nColor;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(13421772), nColor);
+
+ xCell.set(xTable->getCellByPosition(0, 2), uno::UNO_QUERY_THROW);
+ xCell->getPropertyValue("FillColor") >>= nColor;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(15198183), nColor);
+
+ xDocShRef->DoClose();
+}
+
void SdImportTest::testBnc887225()
{
sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/bnc887225.pptx"), PPTX );