diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-01-21 09:31:26 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-01-21 09:32:28 +0100 |
commit | 7907cc0ef9751d553014bd3bab49be9e7fc31bca (patch) | |
tree | 0578a57307f9cf167641684aa1ccd61b1db0769f /sw/qa/extras | |
parent | af1d3c83a372b096b4c425a2bc976e7ef0cd7ed9 (diff) |
fdo#59530 WW8 import of commented text ranges
Change-Id: I3e2928922ebcec8188c1b5416108373c4f26dd62
Diffstat (limited to 'sw/qa/extras')
-rwxr-xr-x | sw/qa/extras/ww8import/data/fdo59530.doc | bin | 0 -> 22528 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8import/ww8import.cxx | 26 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8import/data/fdo59530.doc b/sw/qa/extras/ww8import/data/fdo59530.doc Binary files differnew file mode 100755 index 000000000000..4e41cb8ecef6 --- /dev/null +++ b/sw/qa/extras/ww8import/data/fdo59530.doc diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index d650e114d019..d471b7bb8b6c 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -47,6 +47,7 @@ public: void testN757118(); void testN757905(); void testAllGapsWord(); + void testFdo59530(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -68,6 +69,7 @@ void Test::run() {"n757118.doc", &Test::testN757118}, {"n757905.doc", &Test::testN757905}, {"all_gaps_word.doc", &Test::testAllGapsWord}, + {"fdo59530.doc", &Test::testFdo59530}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -226,6 +228,30 @@ void Test::testAllGapsWord() borderTest.testTheBorders(mxComponent); } +void Test::testFdo59530() +{ + // See ooxmlexport's testFdo38244(). + // Test comment range feature. + 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(); + xRunEnum->nextElement(); + uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("TextFieldStart"), getProperty<OUString>(xPropertySet, "TextPortionType")); + xRunEnum->nextElement(); + xPropertySet.set(xRunEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("TextFieldEnd"), getProperty<OUString>(xPropertySet, "TextPortionType")); + + // Test initials. + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + xPropertySet.set(xFields->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("346376201"), getProperty<OUString>(xPropertySet, "Name")); + CPPUNIT_ASSERT_EQUAL(OUString("M"), getProperty<OUString>(xPropertySet, "Initials")); +} CPPUNIT_TEST_SUITE_REGISTRATION(Test); |