[Libreoffice-commits] core.git: sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Thu Jul 31 07:37:23 PDT 2014
sw/qa/extras/ooxmlexport/data/table-start-2-sdt.docx |binary
sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 9 +++++++++
writerfilter/source/dmapper/DomainMapper.cxx | 6 ++++++
3 files changed, 15 insertions(+)
New commits:
commit ddb24728b2971f6ed64a0372acb166251f1d9c8f
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Jul 31 15:45:31 2014 +0200
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
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 0000000..d3bf3bc
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/table-start-2-sdt.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 1e0b98d..73fab54 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 37af96b..c9973c2 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
More information about the Libreoffice-commits
mailing list