summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-03-12 11:53:23 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-03-12 11:54:47 +0000
commitcf098d619a6ac5ea1499e05f7d9a71913eb2ed29 (patch)
tree73bf560e2ad8438a76883110bd5517e17a1c44b5
parenta67d0193ff3a4a317ca4a65045fcd2ae244560c6 (diff)
Related: #i120158# add a test-case for tricky am/pm escape problem
Change-Id: I4905fb384694c3f1dadccc6d8513c9a050e3f67b
-rw-r--r--sw/qa/extras/ww8import/data/i120158.docbin0 -> 23040 bytes
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx15
2 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8import/data/i120158.doc b/sw/qa/extras/ww8import/data/i120158.doc
new file mode 100644
index 000000000000..6adf3ec13d52
--- /dev/null
+++ b/sw/qa/extras/ww8import/data/i120158.doc
Binary files differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index d471b7bb8b6c..b6f0166f06fc 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -48,6 +48,7 @@ public:
void testN757905();
void testAllGapsWord();
void testFdo59530();
+ void testI120158();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -70,6 +71,7 @@ void Test::run()
{"n757905.doc", &Test::testN757905},
{"all_gaps_word.doc", &Test::testAllGapsWord},
{"fdo59530.doc", &Test::testFdo59530},
+ {"i120158.doc", &Test::testI120158}
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -253,6 +255,19 @@ void Test::testFdo59530()
CPPUNIT_ASSERT_EQUAL(OUString("M"), getProperty<OUString>(xPropertySet, "Initials"));
}
+void Test::testI120158()
+{
+ // See https://issues.apache.org/ooo/show_bug.cgi?id=120158
+ uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> paraEnumAccess(textDocument->getText(), uno::UNO_QUERY);
+ // list of paragraphs
+ uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
+ // get contents of 1st paragraph as text
+ uno::Reference<uno::XInterface> paragraph0(paraEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> text0(paragraph0, uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL( OUString( "3/12/2013 10:48:00 AM" ), text0->getString());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();