summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-06-13 13:20:22 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-06-13 13:21:37 +0200
commit743d423258dec9f4f3b6ddd004a578147b56b2df (patch)
tree323bc14420224533b4c33f0d4ff161782aaf7bac
parent6c968d5d1974a205f6b5a320cc277ad23cb8518b (diff)
n#766477 testcase
Change-Id: I6dec02fbcf6c2f518f0d9003ded71040a7c1c30c
-rw-r--r--sw/qa/extras/ooxmltok/data/n766477.docxbin0 -> 10104 bytes
-rw-r--r--sw/qa/extras/ooxmltok/ooxmltok.cxx19
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmltok/data/n766477.docx b/sw/qa/extras/ooxmltok/data/n766477.docx
new file mode 100644
index 000000000000..a144463b7111
--- /dev/null
+++ b/sw/qa/extras/ooxmltok/data/n766477.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx b/sw/qa/extras/ooxmltok/ooxmltok.cxx
index c53a35fe154b..5165ab004033 100644
--- a/sw/qa/extras/ooxmltok/ooxmltok.cxx
+++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx
@@ -35,6 +35,7 @@
#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/XFormField.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
#include <com/sun/star/text/XTextFramesSupplier.hpp>
@@ -66,6 +67,7 @@ public:
void testN764005();
void testSmartart();
void testN764745();
+ void testN766477();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -85,6 +87,7 @@ public:
CPPUNIT_TEST(testN764005);
CPPUNIT_TEST(testSmartart);
CPPUNIT_TEST(testN764745);
+ CPPUNIT_TEST(testN766477);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -496,6 +499,22 @@ void Test::testN764745()
CPPUNIT_ASSERT( pos.X > 10000 );
}
+void Test::testN766477()
+{
+ load("n766477.docx");
+ 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<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRunEnum(xRunEnumAccess->createEnumeration());
+ uno::Reference<beans::XPropertySet> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<text::XFormField> xFormField(xRun->getPropertyValue("Bookmark"), uno::UNO_QUERY);
+ uno::Reference<container::XNameContainer> xParameters(xFormField->getParameters());
+ uno::Sequence<OUString> aElementNames(xParameters->getElementNames());
+ // The problem was that the checkbox was not checked.
+ CPPUNIT_ASSERT_EQUAL(OUString("Checkbox_Checked"), aElementNames[0]);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();