diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2022-04-04 18:05:18 +0300 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-04-06 09:34:49 +0200 |
commit | 2d1bd913d9f896d55c03dd509eb11c81667c5436 (patch) | |
tree | 9415202ac5b781dfbf91b01d1c5e131fd8c10884 /sw/qa | |
parent | 4494e24c29d9a673964feb9c637b13122ee17f87 (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>
(cherry picked from commit fafadd7aee8c384af210008f693b5007a9f5ea48)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132595
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf148361.docx | bin | 0 -> 10663 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 16 |
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 Binary files differnew file mode 100644 index 000000000000..ecf9a5f0087c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf148361.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 370989a9d6b7..51f0d9fb9345 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -143,6 +143,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"); |