summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-04-23 17:00:23 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-04-23 17:04:57 +0200
commit8ee0e1f3fc54727f03674be415302109f6d87dc1 (patch)
tree444df084f8ce752796ddef1cfeea661fc47528ce /sw/qa
parent5dd8e91934618532bdb7f3d80035d8301a782b32 (diff)
n#757890 add testcase
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmltok/data/n757890.docxbin0 -> 11098 bytes
-rw-r--r--sw/qa/extras/ooxmltok/ooxmltok.cxx27
2 files changed, 27 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmltok/data/n757890.docx b/sw/qa/extras/ooxmltok/data/n757890.docx
new file mode 100644
index 000000000000..f70368a9423a
--- /dev/null
+++ b/sw/qa/extras/ooxmltok/data/n757890.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx b/sw/qa/extras/ooxmltok/ooxmltok.cxx
index 5aff21cb3d8c..e5bdece028fa 100644
--- a/sw/qa/extras/ooxmltok/ooxmltok.cxx
+++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx
@@ -28,11 +28,14 @@
#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/HoriOrientation.hpp>
#include <com/sun/star/text/SetVariableType.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/XDependentTextField.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
+#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
+#include <com/sun/star/text/XTextFramesSupplier.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <test/bootstrapfixture.hxx>
@@ -53,6 +56,7 @@ public:
void testN751117();
void testN751017();
void testN750935();
+ void testN757890();
CPPUNIT_TEST_SUITE(OoxmlModelTest);
#if !defined(MACOSX) && !defined(WNT)
@@ -60,6 +64,7 @@ public:
CPPUNIT_TEST(testN751117);
CPPUNIT_TEST(testN751017);
CPPUNIT_TEST(testN750935);
+ CPPUNIT_TEST(testN757890);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -185,6 +190,28 @@ void OoxmlModelTest::testN750935()
CPPUNIT_ASSERT_EQUAL(sal_Int16(5), xCursor->getPage());
}
+void OoxmlModelTest::testN757890()
+{
+ load("n757890.docx");
+
+ // The w:pStyle token affected the text outside the textbox.
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ uno::Reference<beans::XPropertySet> xPara(xParaEnum->nextElement(), uno::UNO_QUERY);
+ OUString aValue;
+ xPara->getPropertyValue("ParaStyleName") >>= aValue;
+ CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), aValue);
+
+ // This wan't centered
+ uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+ sal_Int16 nValue;
+ xFrame->getPropertyValue("HoriOrient") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, nValue);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(OoxmlModelTest);
CPPUNIT_PLUGIN_IMPLEMENT();