From 0dca68a55a853e62dbbf8caee51db05b7d8c85cc Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 4 Jun 2014 14:51:44 +0200 Subject: [PATCH] CppunitTest_sw_ooxmlimport's testMceNested: port to textboxes Change-Id: Ie1cc83963ccd2d9d6f7833302af6cdb3078d60de --- sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 22 +++++++++++++++++----- 1 file 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 xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); - uno::Reference 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(xFrame, "VertOrientPosition")); - // This was -1 (default), make sure the background color is set. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), getProperty(xFrame, "BackColor")); + if (xIndexAccess->getCount()) + { + // TODO TextBox: remove this when TextBox is enabled by default + uno::Reference 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(xFrame, "VertOrientPosition")); + // This was -1 (default), make sure the background color is set. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), getProperty(xFrame, "BackColor")); + } + else + { + uno::Reference xShape(getShape(1), uno::UNO_QUERY); + // positionV's posOffset from the bugdoc, was 0. + CPPUNIT_ASSERT_EQUAL(sal_Int32(6987), getProperty(xShape, "VertOrientPosition")); + // This was -1 (default), make sure the background color is set. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), getProperty(xShape, "FillColor")); + } uno::Reference 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.