summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2022-04-04 18:05:18 +0300
committerVasily Melenchuk <vasily.melenchuk@cib.de>2022-04-05 16:50:21 +0200
commitfafadd7aee8c384af210008f693b5007a9f5ea48 (patch)
tree24d8e94e3347e2548ae0370ccfe7ab7c7427e71e /sw
parent28318bed905f21d25aa69d4153858e91b6d13cd1 (diff)
tdf#148361: docx sdt: cleanup databinding data after inserting
Databinding data is used only for current sdt block. It should be clean up after usage to avoid impact on next sdt blocks. Change-Id: I53f47dd655ed027d40eb518784dcae69813e612f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132524 Tested-by: Jenkins Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf148361.docxbin0 -> 10663 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport17.cxx16
2 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf148361.docx b/sw/qa/extras/ooxmlexport/data/tdf148361.docx
new file mode 100644
index 000000000000..ecf9a5f0087c
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf148361.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index f199b1fa6671..00f54a17c561 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -232,6 +232,22 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123642_BookmarkAtDocEnd, "tdf123642.docx")
CPPUNIT_ASSERT_EQUAL(OUString("Bookmark1"), getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:bookmarkStart[1]", "name"));
}
+DECLARE_OOXMLEXPORT_TEST(testTdf148361, "tdf148361.docx")
+{
+ // Refresh fields and ensure cross-reference to numbered para is okay
+ uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
+
+ uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
+ CPPUNIT_ASSERT(xFields->hasMoreElements());
+
+ uno::Reference<text::XTextField> xTextField1(xFields->nextElement(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("itadmin"), xTextField1->getPresentation(false));
+
+ uno::Reference<text::XTextField> xTextField2(xFields->nextElement(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("[Type text]"), xTextField2->getPresentation(false));
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf142407, "tdf142407.docx")
{
uno::Reference<container::XNameAccess> xPageStyles = getStyles("PageStyles");