summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-08-15 12:39:38 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-08-15 12:47:23 +0200
commit97be55676b87647c099fd316ab528966a35ad2c9 (patch)
tree943276c495e91d5211e77e7c460eca20e589feef /sw/qa
parente40f2678ab4ec8116e562cda51281762a76bb166 (diff)
fdo#53113 testcase
Change-Id: I64cb3050dcfd10253daa521b2c5fa69ed1cfa952
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/rtfexport/data/fdo53113.odtbin0 -> 9276 bytes
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx37
2 files changed, 37 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/fdo53113.odt
Binary files 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 <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
@@ -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<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(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<drawing::EnhancedCustomShapeParameterPair> 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<sal_Int32>());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(102), aPairs[1].Second.Value.get<sal_Int32>());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();