summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/data/content-control-grab-bag.docxbin0 -> 30547 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx12
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx3
3 files changed, 14 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/content-control-grab-bag.docx b/sw/qa/extras/ooxmlexport/data/content-control-grab-bag.docx
new file mode 100644
index 000000000000..33c01f08fd25
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/content-control-grab-bag.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 43a7c2a67ce4..688b393a2d29 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -871,6 +871,18 @@ DECLARE_OOXMLEXPORT_TEST( testSdtDatePicker, "test_sdt_datepicker.docx" )
CPPUNIT_ASSERT_EQUAL(OUString("008000"), sColor);
}
+CPPUNIT_TEST_FIXTURE(Test, testContentControlGrabBag)
+{
+ // Given a document with a <w:sdt> tag:
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "content-control-grab-bag.docx";
+ loadURL(aURL, nullptr);
+
+ // When exporting that document back to DOCX:
+ // Then make sure that completes without an assertion failure, which would mean not-well-formed
+ // output was produced:
+ save("Office Open XML Text", maTempFile);
+}
+
CPPUNIT_TEST_FIXTURE(Test, testTdf104823)
{
// Test how we can roundtrip sdt plain text with databindings support
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 27621bec27bb..51aab4ce5364 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3813,7 +3813,8 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
else
{
uno::Sequence<beans::PropertyValue> aGrabBag = m_pImpl->m_pSdtHelper->getInteropGrabBagAndClear();
- if (m_pImpl->GetSdtStarts().empty() || m_pImpl->m_pSdtHelper->getControlType() != SdtControlType::dropDown)
+ if (m_pImpl->GetSdtStarts().empty()
+ || (m_pImpl->m_pSdtHelper->getControlType() != SdtControlType::dropDown && m_pImpl->m_pSdtHelper->getControlType() != SdtControlType::richText))
{
m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH)->Insert(PROP_SDTPR,
uno::Any(aGrabBag), true, PARA_GRAB_BAG);