summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-09-21 11:50:57 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-09-21 13:30:20 +0200
commitaef569ed83a3ccc02639e5b2a1c7cc131ba262fc (patch)
tree90bf85cdf5359ec5e300000d396cd13d33e924fb /sd
parent356db87a6b622722d0d04ee3e17730a96865770a (diff)
tdf#120028 PPTX import: map shapes with multiple columns to table shapes
Longer term the core Impress shape has to be improved so that it can have text in multiple columns. Shorter term, map text with multiple columns to table shapes, that gives correct layout in many cases and requires changes to the import filter only. Change-Id: Id7942b16882ab1f083ded2f0e577e8c9e128697c Reviewed-on: https://gerrit.libreoffice.org/60859 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/tdf120028.pptxbin0 -> 30465 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx26
2 files changed, 26 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf120028.pptx b/sd/qa/unit/data/pptx/tdf120028.pptx
new file mode 100644
index 000000000000..035c36730663
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf120028.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index cb06f043a0aa..cca17846c666 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -189,6 +189,7 @@ public:
void testPatternImport();
void testPptCrop();
void testTdf119015();
+ void testTdf120028();
CPPUNIT_TEST_SUITE(SdImportTest);
@@ -271,6 +272,7 @@ public:
CPPUNIT_TEST(testTdf116266);
CPPUNIT_TEST(testPptCrop);
CPPUNIT_TEST(testTdf119015);
+ CPPUNIT_TEST(testTdf120028);
CPPUNIT_TEST_SUITE_END();
};
@@ -2557,6 +2559,30 @@ void SdImportTest::testTdf119015()
xDocShRef->DoClose();
}
+void SdImportTest::testTdf120028()
+{
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf120028.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());
+
+ // This failed, shape was not a table, all text was rendered in a single
+ // column.
+ uno::Reference<beans::XPropertySet> xShape(getShape(0, xPage));
+ 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());
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();