From cf098d619a6ac5ea1499e05f7d9a71913eb2ed29 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Mar 2013 11:53:23 +0000 Subject: Related: #i120158# add a test-case for tricky am/pm escape problem Change-Id: I4905fb384694c3f1dadccc6d8513c9a050e3f67b --- sw/qa/extras/ww8import/data/i120158.doc | Bin 0 -> 23040 bytes sw/qa/extras/ww8import/ww8import.cxx | 15 +++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 sw/qa/extras/ww8import/data/i120158.doc 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 Binary files /dev/null and b/sw/qa/extras/ww8import/data/i120158.doc 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(xPropertySet, "Initials")); } +void Test::testI120158() +{ + // See https://issues.apache.org/ooo/show_bug.cgi?id=120158 + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference paraEnumAccess(textDocument->getText(), uno::UNO_QUERY); + // list of paragraphs + uno::Reference paraEnum = paraEnumAccess->createEnumeration(); + // get contents of 1st paragraph as text + uno::Reference paragraph0(paraEnum->nextElement(), uno::UNO_QUERY); + uno::Reference 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(); -- cgit