summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-03-28 17:35:44 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-03-28 17:37:08 +0200
commitbbb03549db3ecb9e4e5a3c4c3cb58059c06ea7e8 (patch)
tree8c42012f3c788270c016825243625211edce0346 /sw
parent61d1533961d002ff0630a0505686dc37b5c393ca (diff)
add testcase for n#751117
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmltok/data/n751117.docxbin0 -> 10312 bytes
-rw-r--r--sw/qa/extras/ooxmltok/ooxmltok.cxx29
2 files changed, 29 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmltok/data/n751117.docx b/sw/qa/extras/ooxmltok/data/n751117.docx
new file mode 100644
index 000000000000..17cc9c53d1cb
--- /dev/null
+++ b/sw/qa/extras/ooxmltok/data/n751117.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx b/sw/qa/extras/ooxmltok/ooxmltok.cxx
index 32d39af96ca6..364d66d59a43 100644
--- a/sw/qa/extras/ooxmltok/ooxmltok.cxx
+++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <test/bootstrapfixture.hxx>
@@ -44,10 +45,12 @@ public:
virtual void setUp();
virtual void tearDown();
void testN751054();
+ void testN751117();
CPPUNIT_TEST_SUITE(OoxmlModelTest);
#if !defined(MACOSX) && !defined(WNT)
CPPUNIT_TEST(testN751054);
+ CPPUNIT_TEST(testN751117);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -90,6 +93,32 @@ void OoxmlModelTest::testN751054()
CPPUNIT_ASSERT(eValue != text::TextContentAnchorType_AS_CHARACTER);
}
+void OoxmlModelTest::testN751117()
+{
+ load("n751117.docx");
+
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+
+ // First shape: the end should be an arrow, should be rotated and should be flipped.
+ uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY);
+ OUString aValue;
+ xPropertySet->getPropertyValue("LineEndName") >>= aValue;
+ CPPUNIT_ASSERT(aValue.indexOf("Arrow") != -1);
+
+ sal_Int32 nValue = 0;
+ xPropertySet->getPropertyValue("RotateAngle") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(90 * 100), nValue);
+
+ uno::Reference<drawing::XShape> xShape(xPropertySet, uno::UNO_QUERY);
+ awt::Size aActualSize(xShape->getSize());
+ CPPUNIT_ASSERT(aActualSize.Width < 0);
+
+ // The second shape should be a line
+ uno::Reference<lang::XServiceInfo> xServiceInfo(xDraws->getByIndex(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.drawing.LineShape"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(OoxmlModelTest);
CPPUNIT_PLUGIN_IMPLEMENT();