summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-04-07 14:17:57 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2017-04-15 15:40:56 +0200
commit2436cf17304f25c7d34da52a321d6da0e9011d19 (patch)
tree1299d57a1849367a1c44e01f558b8910486b8e95 /sd
parenta0755ab8772d01797f4945016a978a2bbd8fdf20 (diff)
tdf#100926: PPTX import of table with rotated text
Change-Id: I05a8e979ac11b179e15784023032a56edc5b569b
Diffstat (limited to 'sd')
-rwxr-xr-xsd/qa/unit/data/pptx/tdf100926.pptxbin0 -> 32382 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx28
2 files changed, 28 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf100926.pptx b/sd/qa/unit/data/pptx/tdf100926.pptx
new file mode 100755
index 000000000000..71627394ec84
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf100926.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index c194e0314769..8b980353d5d4 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -157,6 +157,7 @@ public:
void testTdf104445();
void testTdf105150();
void testTdf105150PPT();
+ void testTdf100926();
bool checkPattern(sd::DrawDocShellRef& rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected);
void testPatternImport();
@@ -222,6 +223,7 @@ public:
CPPUNIT_TEST(testTdf104445);
CPPUNIT_TEST(testTdf105150);
CPPUNIT_TEST(testTdf105150PPT);
+ CPPUNIT_TEST(testTdf100926);
CPPUNIT_TEST(testPatternImport);
CPPUNIT_TEST_SUITE_END();
@@ -2155,6 +2157,32 @@ void SdImportTest::testPatternImport()
xDocRef->DoClose();
}
+void SdImportTest::testTdf100926()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf100926.pptx"), PPTX);
+ const SdrPage* pPage = GetPage(1, xDocShRef);
+ CPPUNIT_ASSERT(pPage != nullptr);
+
+ sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
+ CPPUNIT_ASSERT(pTableObj != nullptr);
+ uno::Reference< table::XCellRange > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
+
+ sal_Int32 nRotation = 0;
+ uno::Reference< beans::XPropertySet > xCell(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
+ xCell->getPropertyValue("RotateAngle") >>= nRotation;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(27000), nRotation);
+
+ xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW);
+ xCell->getPropertyValue("RotateAngle") >>= nRotation;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(9000), nRotation);
+
+ xCell.set(xTable->getCellByPosition(2, 0), uno::UNO_QUERY_THROW);
+ xCell->getPropertyValue("RotateAngle") >>= nRotation;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nRotation);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();