diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-08-17 11:33:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-08-17 15:32:00 +0200 |
commit | 1176c982d60b7e97ca063259326772495dbdde2c (patch) | |
tree | 914845d27ba3c375b9652f981e1dc77f66981297 | |
parent | c3d71e0ab926bf5240994179f405be101cd3148b (diff) |
Related: tdf#142003 add a test for this case
Change-Id: I32ca1ccdcf221c0ef6933fa1018b5f2eb753fa7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120571
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/qa/extras/ww8import/data/changes-in-footnote.doc | bin | 0 -> 13312 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8import/ww8import.cxx | 18 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8import/data/changes-in-footnote.doc b/sw/qa/extras/ww8import/data/changes-in-footnote.doc Binary files differnew file mode 100644 index 000000000000..789795eb0b81 --- /dev/null +++ b/sw/qa/extras/ww8import/data/changes-in-footnote.doc diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index b653db7ef85c..0a585dc5e43b 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -20,6 +20,7 @@ #include <sfx2/docfile.hxx> #include <sfx2/docfilt.hxx> +#include <editsh.hxx> #include <ndgrf.hxx> #include <docsh.hxx> #include <unotxdoc.hxx> @@ -280,6 +281,23 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf120761_zOrder) CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), getProperty<sal_uInt32>(xShape, "ZOrder")); } +CPPUNIT_TEST_FIXTURE(Test, testTdf142003) +{ + load(mpTestDocumentPath, "changes-in-footnote.doc"); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + SwEditShell* const pEditShell(pTextDoc->GetDocShell()->GetDoc()->GetEditShell()); + pEditShell->AcceptRedline(0); + + //The changes were offset from where they should have been + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnotes = xFootnotesSupplier->getFootnotes(); + uno::Reference<text::XTextRange> xParagraph(xFootnotes->getByIndex(0), uno::UNO_QUERY); + //before change was incorrect, Loren ipsum , doconsectetur ... + CPPUNIT_ASSERT(xParagraph->getString().startsWith("Lorem ipsum , consectetur adipiscing elit.")); +} // tests should only be added to ww8IMPORT *if* they fail round-tripping in ww8EXPORT |