summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlimport
diff options
context:
space:
mode:
authorMiguel Gomez <magomez@igalia.com>2013-09-16 16:15:59 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-09-20 11:26:59 +0200
commitb5a888d3681cc375657f84239eca391bbb270fd5 (patch)
tree600055f5b60db919ad4f1fe8423543394ec21e76 /sw/qa/extras/ooxmlimport
parentb4380022a664b86bcd29aa5a8ffe27f83afe763f (diff)
fdo#64491: Move SmartArt test from import to export
Now that loading and saving SmartArt components is fully working, move the unit test from the import section to the export one, where both import and export will be tested. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Change-Id: I5e0d182ee941180ba80c2b310d85528ff75ef296 Reviewed-on: https://gerrit.libreoffice.org/6006 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa/extras/ooxmlimport')
-rw-r--r--sw/qa/extras/ooxmlimport/data/smartart.docxbin20453 -> 0 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx90
2 files changed, 0 insertions, 90 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/smartart.docx b/sw/qa/extras/ooxmlimport/data/smartart.docx
deleted file mode 100644
index 7a553f425188..000000000000
--- a/sw/qa/extras/ooxmlimport/data/smartart.docx
+++ /dev/null
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index a76086552101..fc03f75805da 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -64,7 +64,6 @@ public:
void testN652364();
void testN760764();
void testN764005();
- void testSmartart();
void testN764745();
void testN766477();
void testN758883();
@@ -164,7 +163,6 @@ void Test::run()
{"n652364.docx", &Test::testN652364},
{"n760764.docx", &Test::testN760764},
{"n764005.docx", &Test::testN764005},
- {"smartart.docx", &Test::testSmartart},
{"n764745-alignment.docx", &Test::testN764745},
{"n766477.docx", &Test::testN766477},
{"n758883.docx", &Test::testN758883},
@@ -537,94 +535,6 @@ void Test::testN764005()
CPPUNIT_ASSERT_EQUAL(false, bool(bValue));
}
-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
-
- uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
- 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);
- xGroupPropertySet->getPropertyValue(OUString::createFromAscii("InteropGrabBag")) >>= aGrabBag;
- CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty
-
- sal_Bool bData = sal_False, bLayout = sal_False, bQStyle = sal_False, bColor = sal_False, bDrawing = sal_False;
- for(int i = 0; i < aGrabBag.getLength(); ++i)
- {
- if (aGrabBag[i].Name == OUString::createFromAscii("OOXData"))
- {
- bData = sal_True;
- uno::Reference<xml::dom::XDocument> aDataDom;
- CPPUNIT_ASSERT(aGrabBag[i].Value >>= aDataDom); // PropertyValue of proper type
- CPPUNIT_ASSERT(aDataDom.get()); // Reference not empty
- }
- else if (aGrabBag[i].Name == OUString::createFromAscii("OOXLayout"))
- {
- bLayout = sal_True;
- uno::Reference<xml::dom::XDocument> aLayoutDom;
- CPPUNIT_ASSERT(aGrabBag[i].Value >>= aLayoutDom); // PropertyValue of proper type
- CPPUNIT_ASSERT(aLayoutDom.get()); // Reference not empty
- }
- else if (aGrabBag[i].Name == OUString::createFromAscii("OOXStyle"))
- {
- bQStyle = sal_True;
- uno::Reference<xml::dom::XDocument> aStyleDom;
- CPPUNIT_ASSERT(aGrabBag[i].Value >>= aStyleDom); // PropertyValue of proper type
- CPPUNIT_ASSERT(aStyleDom.get()); // Reference not empty
- }
- else if (aGrabBag[i].Name == OUString::createFromAscii("OOXColor"))
- {
- bColor = sal_True;
- uno::Reference<xml::dom::XDocument> aColorDom;
- CPPUNIT_ASSERT(aGrabBag[i].Value >>= aColorDom); // PropertyValue of proper type
- CPPUNIT_ASSERT(aColorDom.get()); // Reference not empty
- }
- else if (aGrabBag[i].Name == OUString::createFromAscii("OOXDrawing"))
- {
- bDrawing = sal_True;
- uno::Reference<xml::dom::XDocument> aDrawingDom;
- CPPUNIT_ASSERT(aGrabBag[i].Value >>= aDrawingDom); // PropertyValue of proper type
- CPPUNIT_ASSERT(aDrawingDom.get()); // Reference not empty
- }
- }
- CPPUNIT_ASSERT(bData && bLayout && bQStyle && bColor && bDrawing); // Grab Bag has all the expected elements
-
- uno::Reference<beans::XPropertySet> xPropertySet(xGroup->getByIndex(1), uno::UNO_QUERY);
- sal_Int32 nValue(0);
- xPropertySet->getPropertyValue("FillColor") >>= nValue;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), nValue); // If fill color is right, theme import is OK
-
- uno::Reference<text::XTextRange> xTextRange(xGroup->getByIndex(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString("Sample"), xTextRange->getString()); // Shape has text
-
- uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextRange->getText(), uno::UNO_QUERY);
- uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
- xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY);
- xPropertySet->getPropertyValue("ParaAdjust") >>= nValue;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(style::ParagraphAdjust_CENTER), nValue); // Paragraph properties are imported
-}
-
void Test::testN764745()
{
/*