summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlimport
diff options
context:
space:
mode:
authorAndres Gomez <agomez@igalia.com>2013-09-13 18:18:39 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-09-20 08:51:37 +0000
commit290f03e8bb5071d7716fb6563e3274caa51102f0 (patch)
tree0eb52118efb357d309461baf9e1098cdaf650ca0 /sw/qa/extras/ooxmlimport
parent44c5fcb7eb4077740ef497ff4bb6c4cf23224dbf (diff)
writerfilter: OOXML theme saved in InteropGrabBag
The XDocuments representing the DOM of an OOXML's theme document is now stored as the PropertyValue "OOXTheme" into the "InteropGraBag" property of the SwXTextDocument. Added the importSubStream() method to the writerfilter::ooxml::OOXMLDocumentImpl class in order to create the XDocument for the theme XML fragment stream and invoked it during the resolve() method. Modified the writerfilter::ooxml::OOXMLDocument abstract class to be able to hold the OOXML's theme XDocument. Added the set/getTheme() methods to store and obtain the XDocument directly. Modified the WriterFilter::filter() method to store the OOXML's theme XDocument in the "InteropGrabBag" property of the TextDocument service SwXTextDocument implementation. Updated the UTs accordingly. Change-Id: I3960590fcf4856caf770908b983ffb6898f061c0 Reviewed-on: https://gerrit.libreoffice.org/6002 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa/extras/ooxmlimport')
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx20
1 files changed, 19 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 9a0a10cbe805..a76086552101 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -539,6 +539,25 @@ void Test::testN764005()
void Test::testSmartart()
{
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xTextDocumentPropertySet(xTextDocument, uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aGrabBag(0);
+ xTextDocumentPropertySet->getPropertyValue(OUString("InteropGrabBag")) >>= aGrabBag;
+ CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty
+
+ sal_Bool bTheme = sal_False;
+ for(int i = 0; i < aGrabBag.getLength(); ++i)
+ {
+ if (aGrabBag[i].Name == OUString("OOXTheme"))
+ {
+ bTheme = sal_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
+
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); // One groupshape in the doc
@@ -547,7 +566,6 @@ void Test::testSmartart()
CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xGroup->getCount()); // 3 rectangles and an arrow in the group
uno::Reference<beans::XPropertySet> xGroupPropertySet(getShape(1), uno::UNO_QUERY);
- uno::Sequence<beans::PropertyValue> aGrabBag(0);
xGroupPropertySet->getPropertyValue(OUString::createFromAscii("InteropGrabBag")) >>= aGrabBag;
CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty