From 25526046e7edad50924e93dffe7dbc9f9c99a5fd Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 12 Jun 2014 09:55:22 +0200 Subject: [PATCH] CppunitTest_sw_ooxmlexport: port testFloatingTablePosition to textboxes Change-Id: I200520a28335fb62cecb91175fc6cefc2cfb51ec --- sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 900c8659d959..27752df4a0e8 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2661,11 +2661,23 @@ DECLARE_OOXMLEXPORT_TEST(testFloatingTablePosition, "floating-table-position.doc // Position of text frame was wrong, because some conversion was missing. uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); - uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - // This was 3295. - CPPUNIT_ASSERT_EQUAL(sal_Int32(5964), getProperty(xFrame, "HoriOrientPosition")); - // This was 4611. - CPPUNIT_ASSERT_EQUAL(sal_Int32(8133), getProperty(xFrame, "VertOrientPosition")); + if (xIndexAccess->getCount()) + { + // TODO TextBox: remove this when TextBox is enabled by default + uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + // This was 3295. + CPPUNIT_ASSERT_EQUAL(sal_Int32(5964), getProperty(xFrame, "HoriOrientPosition")); + // This was 4611. + CPPUNIT_ASSERT_EQUAL(sal_Int32(8133), getProperty(xFrame, "VertOrientPosition")); + } + else + { + uno::Reference xShape(getShape(1), uno::UNO_QUERY); + // This was 3295. + CPPUNIT_ASSERT_EQUAL(sal_Int32(5964), getProperty(xShape, "HoriOrientPosition")); + // This was 4611. + CPPUNIT_ASSERT_EQUAL(sal_Int32(8133), getProperty(xShape, "VertOrientPosition")); + } } DECLARE_OOXMLEXPORT_TEST(testAbi11739, "abi11739.docx")