diff options
author | Grzegorz Araminowicz <grzegorz.araminowicz@collabora.com> | 2019-04-29 14:44:20 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-04-30 09:13:28 +0200 |
commit | cd08835d1bd9274412c7326db32fb3752bc94fb3 (patch) | |
tree | c451e877b3534e44ae05372d5bd1d2c472dcbce9 /sd/qa/unit | |
parent | cd2a7acd789297e613424a59b2fe24cedd9a72b6 (diff) |
PPTX import: store OOXTheme in InteropGrabBag for SmartArt re-generation
Change-Id: I343dc3a275ecbbb483e179d8cc2deebfb71b9c8f
Reviewed-on: https://gerrit.libreoffice.org/71530
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd/qa/unit')
-rw-r--r-- | sd/qa/unit/data/pptx/ooxtheme.pptx | bin | 0 -> 44886 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 28 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/ooxtheme.pptx b/sd/qa/unit/data/pptx/ooxtheme.pptx Binary files differnew file mode 100644 index 000000000000..f0f3f2575894 --- /dev/null +++ b/sd/qa/unit/data/pptx/ooxtheme.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 5d690c8a1491..566818755c5b 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -79,6 +79,7 @@ #include <com/sun/star/style/NumberingType.hpp> #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/text/GraphicCrop.hpp> +#include <com/sun/star/xml/dom/XDocument.hpp> #include <stlpool.hxx> #include <comphelper/processfactory.hxx> @@ -199,6 +200,7 @@ public: void testTdf83247(); void testTdf47365(); void testTdf122899(); + void testOOXTheme(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -288,6 +290,7 @@ public: CPPUNIT_TEST(testTdf83247); CPPUNIT_TEST(testTdf47365); CPPUNIT_TEST(testTdf122899); + CPPUNIT_TEST(testOOXTheme); CPPUNIT_TEST_SUITE_END(); }; @@ -2743,6 +2746,31 @@ void SdImportTest::testTdf122899() xDocShRef->DoClose(); } +void SdImportTest::testOOXTheme() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/ooxtheme.pptx"), PPTX); + + uno::Reference<beans::XPropertySet> xPropSet(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW); + uno::Sequence<beans::PropertyValue> aGrabBag; + xPropSet->getPropertyValue("InteropGrabBag") >>= aGrabBag; + + bool bTheme = false; + for (int i = 0; i < aGrabBag.getLength(); i++) + { + if (aGrabBag[i].Name == "OOXTheme") + { + bTheme = true; + uno::Reference<xml::dom::XDocument> aThemeDom; + CPPUNIT_ASSERT(aGrabBag[i].Value >>= aThemeDom); // PropertyValue of proper type + CPPUNIT_ASSERT(aThemeDom.get()); // Reference not empty + } + } + CPPUNIT_ASSERT(bTheme); // Grab Bag has all the expected elements + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |