summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorGrzegorz Araminowicz <grzegorz.araminowicz@collabora.com>2019-03-08 12:45:24 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-03-11 17:38:07 +0100
commitdba1f992d0757b9c353dd41d55dd89ecafd70603 (patch)
treee52e80a41f8a56e41782bc78c22b281be6b664a1 /sd
parent4c4ccdf724dedebce23cc9abd7b74bee43f184d7 (diff)
PPTX import: save SmartArt markup into InteropGrabBag
it will allow to preserve SmartArt when saving PPTX files Change-Id: I9bb66c59d202b4ce426864599014d042d4aa04b0 Reviewed-on: https://gerrit.libreoffice.org/68916 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd')
-rwxr-xr-xsd/qa/unit/data/pptx/smartart-interopgrabbag.pptxbin0 -> 39419 bytes
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx21
2 files changed, 21 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/smartart-interopgrabbag.pptx b/sd/qa/unit/data/pptx/smartart-interopgrabbag.pptx
new file mode 100755
index 000000000000..ef678b6c3398
--- /dev/null
+++ b/sd/qa/unit/data/pptx/smartart-interopgrabbag.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 22513adc312a..81474f2071ae 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -69,6 +69,7 @@ public:
void testOrgChart();
void testCycleMatrix();
void testPictureStrip();
+ void testInteropGrabBag();
CPPUNIT_TEST_SUITE(SdImportTestSmartArt);
@@ -102,6 +103,7 @@ public:
CPPUNIT_TEST(testOrgChart);
CPPUNIT_TEST(testCycleMatrix);
CPPUNIT_TEST(testPictureStrip);
+ CPPUNIT_TEST(testInteropGrabBag);
CPPUNIT_TEST_SUITE_END();
};
@@ -990,6 +992,25 @@ void SdImportTestSmartArt::testPictureStrip()
xDocShRef->DoClose();
}
+void SdImportTestSmartArt::testInteropGrabBag()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-interopgrabbag.pptx"), PPTX);
+ uno::Reference<drawing::XShape> xGroup(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xGroup.is());
+
+ uno::Reference<beans::XPropertySet> xPropertySet(xGroup, uno::UNO_QUERY_THROW);
+ uno::Sequence<beans::PropertyValue> aGrabBagSeq;
+ xPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBagSeq;
+ comphelper::SequenceAsHashMap aGrabBag(aGrabBagSeq);
+ CPPUNIT_ASSERT(aGrabBag.find("OOXData") != aGrabBag.end());
+ CPPUNIT_ASSERT(aGrabBag.find("OOXLayout") != aGrabBag.end());
+ CPPUNIT_ASSERT(aGrabBag.find("OOXStyle") != aGrabBag.end());
+ CPPUNIT_ASSERT(aGrabBag.find("OOXColor") != aGrabBag.end());
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTestSmartArt);
CPPUNIT_PLUGIN_IMPLEMENT();