diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-30 18:49:04 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-30 19:04:26 +0100 |
commit | 0ec0ec267986644084baaa5bda5ba917dc5744df (patch) | |
tree | 2dbfd8e8509e5a81a2677645c64353f58c758c1e /sw/qa | |
parent | 677fdd4fa235466649911042577bc4980d42deb6 (diff) |
i#93570 DOC import: handle commented text ranges via RES_FLTR_ANNOTATIONMARK
And add a minimal reproducer that shows how the old way was broken.
Change-Id: Ic2dadf9905d603b0fd0573651b235ecd5dd70e71
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ww8export/data/commented-table.doc | bin | 0 -> 27136 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export.cxx | 12 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/data/commented-table.doc b/sw/qa/extras/ww8export/data/commented-table.doc Binary files differnew file mode 100644 index 000000000000..049c7e3a4b2e --- /dev/null +++ b/sw/qa/extras/ww8export/data/commented-table.doc diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 8a4596aa54a4..11cf7782ffd7 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -441,6 +441,18 @@ DECLARE_WW8EXPORT_TEST(testWw8Cjklist35, "cjklist35.doc") CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_LOWER_ZH, numFormat); } +DECLARE_WW8EXPORT_TEST(testCommentedTable, "commented-table.doc") +{ + // Document has a non-trivial commented text range, as the range contains a table. + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + uno::Reference<text::XTextContent> xField(xFields->nextElement(), uno::UNO_QUERY); + // After first import, there was an off-by-one during import, so this was "efore.\nA1\nB1\nAfte". (Notice the additional "e" prefix.) + // After export and import, things got worse, this was "\nA1\nB1\nAfte". + CPPUNIT_ASSERT_EQUAL(OUString("fore.\nA1\nB1\nAfte"), xField->getAnchor()->getString()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |