From 97be55676b87647c099fd316ab528966a35ad2c9 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 15 Aug 2012 12:39:38 +0200 Subject: fdo#53113 testcase Change-Id: I64cb3050dcfd10253daa521b2c5fa69ed1cfa952 --- sw/qa/extras/rtfexport/data/fdo53113.odt | Bin 0 -> 9276 bytes sw/qa/extras/rtfexport/rtfexport.cxx | 37 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 sw/qa/extras/rtfexport/data/fdo53113.odt (limited to 'sw/qa') diff --git a/sw/qa/extras/rtfexport/data/fdo53113.odt b/sw/qa/extras/rtfexport/data/fdo53113.odt new file mode 100644 index 000000000000..1f7c2f1a25d6 Binary files /dev/null and b/sw/qa/extras/rtfexport/data/fdo53113.odt differ diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index ca72d9b408b1..de705d2ef552 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -28,6 +28,7 @@ #include "../swmodeltestbase.hxx" #include +#include #include #include #include @@ -68,6 +69,7 @@ public: void testMathSubscripts(); void testMathVerticalstacks(); void testMathRuns(); + void testFdo53113(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -99,6 +101,7 @@ public: CPPUNIT_TEST(testMathVerticalstacks); CPPUNIT_TEST(testMathRuns); #endif + CPPUNIT_TEST(testFdo53113); #endif CPPUNIT_TEST_SUITE_END(); @@ -406,6 +409,40 @@ void Test::testMathRuns() CPPUNIT_ASSERT_EQUAL(OUString("\\{ left [ right ] left ( right ) \\}"), getFormula(getRun(getParagraph(1), 1))); } +void Test::testFdo53113() +{ + /* + * The problem was that a custom shape was missings its second (and all the other remaining) coordinates. + * + * oShape = ThisComponent.DrawPage(0) + * oPathPropVec = oShape.CustomShapeGeometry(1).Value + * oCoordinates = oPathPropVec(0).Value + * xray oCoordinates(1).First.Value ' 535 + * xray oCoordinates(1).Second.Value ' 102 + */ + + roundtrip("fdo53113.odt"); + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Sequence aProps = getProperty< uno::Sequence >(xDraws->getByIndex(0), "CustomShapeGeometry"); + for (int i = 0; i < aProps.getLength(); ++i) + { + const beans::PropertyValue& rProp = aProps[i]; + if (rProp.Name == "Path") + rProp.Value >>= aProps; + } + uno::Sequence aPairs; + for (int i = 0; i < aProps.getLength(); ++i) + { + const beans::PropertyValue& rProp = aProps[i]; + if (rProp.Name == "Coordinates") + rProp.Value >>= aPairs; + } + CPPUNIT_ASSERT_EQUAL(sal_Int32(16), aPairs.getLength()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(535), aPairs[1].First.Value.get()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(102), aPairs[1].Second.Value.get()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit