summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-07-31 15:45:31 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-07-31 16:21:40 +0200
commitddb24728b2971f6ed64a0372acb166251f1d9c8f (patch)
tree888a151e1d9ea71d66c64b16753767b56ac3d672
parent533b9ab6fc425746ce30882b424715c97631d907 (diff)
DOCX import: merging properties of different SDT's are not wanted
When the document starts with a table and both the A1 cell as well as the document start has an SDT start, then we see both at the same time when we check for pending SDT's in lcl_utext(). This leads to merging the properties of the two SDT's, which is clearly not wanted. Fix the problem by clearning the SDT property list when we see a start of a new property list: that produces a valid document. Change-Id: I8fbe7bec02beebb26ed99fa7b08bc62225bff50c
-rw-r--r--sw/qa/extras/ooxmlexport/data/table-start-2-sdt.docxbin0 -> 34077 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx9
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx6
3 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/table-start-2-sdt.docx b/sw/qa/extras/ooxmlexport/data/table-start-2-sdt.docx
new file mode 100644
index 000000000000..d3bf3bc5d656
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/table-start-2-sdt.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 1e0b98d03c50..73fab5433ee6 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -541,6 +541,15 @@ DECLARE_OOXMLEXPORT_TEST(test2Id, "2-id.docx")
}
}
+DECLARE_OOXMLEXPORT_TEST(testTableStart2Sdt, "table-start-2-sdt.docx")
+{
+ if (xmlDocPtr pXmlDoc = parseExport())
+ {
+ // w:docPartGallery should be a child of <w:docPartObj>, make sure it's not a child of w:text.
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:text/w:docPartGallery", 0);
+ }
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 37af96b094b5..c9973c2e0d79 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2451,6 +2451,12 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext )
}
}
break;
+ case NS_ooxml::LN_CT_SdtPr_rPr:
+ {
+ // Make sure properties from a pervious SDT are not merged with the current ones.
+ m_pImpl->m_pSdtHelper->getInteropGrabBagAndClear();
+ }
+ break;
default:
{
#ifdef DEBUG_DOMAINMAPPER