summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-04 14:51:44 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-04 15:08:36 +0200
commit0dca68a55a853e62dbbf8caee51db05b7d8c85cc (patch)
tree6841f1ab4e72a0fceaee689a922a5ba2e4a68d42 /sw
parent6f2edd4514dc59f5cbac8c653c6e4b1a96ec28a2 (diff)
CppunitTest_sw_ooxmlimport's testMceNested: port to textboxes
Change-Id: Ie1cc83963ccd2d9d6f7833302af6cdb3078d60de
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx22
1 files changed, 17 insertions, 5 deletions
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index b9ecb553f4a2..14aa543d7aab 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1700,11 +1700,23 @@ DECLARE_OOXMLIMPORT_TEST(testMceNested, "mce-nested.docx")
// Vertical position of the textbox was incorrect due to incorrect nested mce handling.
uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
- // positionV's posOffset from the bugdoc, was 0.
- CPPUNIT_ASSERT_EQUAL(sal_Int32(EMU_TO_MM100(2514600)), getProperty<sal_Int32>(xFrame, "VertOrientPosition"));
- // This was -1 (default), make sure the background color is set.
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), getProperty<sal_Int32>(xFrame, "BackColor"));
+ if (xIndexAccess->getCount())
+ {
+ // TODO TextBox: remove this when TextBox is enabled by default
+ uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+ // positionV's posOffset from the bugdoc, was 0.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(EMU_TO_MM100(2514600)), getProperty<sal_Int32>(xFrame, "VertOrientPosition"));
+ // This was -1 (default), make sure the background color is set.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), getProperty<sal_Int32>(xFrame, "BackColor"));
+ }
+ else
+ {
+ uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY);
+ // positionV's posOffset from the bugdoc, was 0.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(6987), getProperty<sal_Int32>(xShape, "VertOrientPosition"));
+ // This was -1 (default), make sure the background color is set.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), getProperty<sal_Int32>(xShape, "FillColor"));
+ }
uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor(getShape(2), uno::UNO_QUERY);
// This was a com.sun.star.drawing.CustomShape, due to incorrect handling of wpg elements after a wps textbox.