summaryrefslogtreecommitdiff
path: root/xmloff/qa/unit
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-07-26 08:50:03 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-07-27 13:40:59 +0200
commitc5df13ad4c22e8878eec0c2d5e431515537799ad (patch)
tree40c4306512a5fda21e9438c044afa63bc4f218ec /xmloff/qa/unit
parentbdc4f593b3dbc5e9e21fa0a732f8986b029c5c06 (diff)
crashtest: fix crash on ODT export of forum-mso-de-84211.docx
XMLTextParagraphExport::ExportContentControl() disables the export of the <loext:list-item> XML element in autostyle mode, then it should also disable the export of the matching attributes. (cherry picked from commit 6cf1f3c09c43bd3bbcda611a9476ff5e64c5164f) Change-Id: Ia65fc8bd3398df0ab1b71973695c9bc8d10deaa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137496 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'xmloff/qa/unit')
-rw-r--r--xmloff/qa/unit/data/content-control-dropdown.docxbin0 -> 65391 bytes
-rw-r--r--xmloff/qa/unit/text.cxx19
2 files changed, 19 insertions, 0 deletions
diff --git a/xmloff/qa/unit/data/content-control-dropdown.docx b/xmloff/qa/unit/data/content-control-dropdown.docx
new file mode 100644
index 000000000000..1391c90f1a63
--- /dev/null
+++ b/xmloff/qa/unit/data/content-control-dropdown.docx
Binary files differ
diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index 99bb0ce3ba91..94d7da5e30a9 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -795,6 +795,25 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testPlainTextContentControlImport)
CPPUNIT_ASSERT(bPlainText);
}
+CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testDropdownContentControlAutostyleExport)
+{
+ // Given a document with a dropdown content control, and formatting that forms an autostyle in
+ // ODT:
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "content-control-dropdown.docx";
+ getComponent() = loadFromDesktop(aURL);
+
+ // When saving that document to ODT, then make sure no assertion failure happens:
+ uno::Reference<frame::XStorable> xStorable(getComponent(), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aStoreProps = comphelper::InitPropertySequence({
+ { "FilterName", uno::Any(OUString("writer8")) },
+ });
+ utl::TempFile aTempFile;
+ aTempFile.EnableKillingFile();
+ // Without the accompanying fix in place, this test would have failed, we had duplicated XML
+ // attributes.
+ xStorable->storeToURL(aTempFile.GetURL(), aStoreProps);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */