summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/PropertyIds.cxx
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-03-17 13:44:36 +0100
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-03-17 14:08:43 +0100
commit55211e612d2cbed03dd81c039d07ea4e936c2804 (patch)
treec252b9de285d62a661534ce353349578157e6aa3 /writerfilter/source/dmapper/PropertyIds.cxx
parenta45fde7235f95792bf8e6f6979d0040637c5785d (diff)
ooxml: preserve w:sdt blocks containing w:docPartObj properties
The <w:docPartObj> property inside <w:sdt> blocks determines a block inside the document that can be dinamically updated and enables Word 2010 to show a hover button to update it. It is used for TOCs, bibliography, etc. LibreOffice ignored these blocks and removed them from the document on export. In this patch, we make the importer save the <w:docPartObj> tag and its contents in the paragraph interop grab bag. On export we read the paragraph grab bag and restore the sdt block back to the document; we don't know if the paragraph must be enclosed in a sdt block when we start it, so we used the parser marks to be able to prepend the start of the block before the paragraph opening tag. The grab bag on import is managed by the SdtHelper class. Added a set of methods for that purpose. The ooxml model file was modified to assign token ids to the children of w:docPartObj. Fixed several unit tests that didn't expect the <w:sdt> tag to be exported. Also modified testBibliography inside ooxmlexport test suite to add checks for this patch. TODO: in the imported documents the sdtContent block may contain several paragraphs but the exporter code as it is can only wrap one paragraph. As a result, if the sdt block contained several paragraphs the second and next paragraphs will be outside the block in the exported document. Change-Id: I5333fc5ad91a3c50198a4f7647424a2101268c12
Diffstat (limited to 'writerfilter/source/dmapper/PropertyIds.cxx')
-rw-r--r--writerfilter/source/dmapper/PropertyIds.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx
index f78c10ba32bb..a26cdf9d93b9 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -387,6 +387,7 @@ OUString PropertyNameSupplier::GetName( PropertyIds eId ) const
case PROP_CHAR_NUMSPACING_TEXT_EFFECT : sName = "CharNumSpacingTextEffect"; break;
case PROP_CHAR_STYLISTICSETS_TEXT_EFFECT : sName = "CharStylisticSetsTextEffect"; break;
case PROP_CHAR_CNTXTALTS_TEXT_EFFECT : sName = "CharCntxtAltsTextEffect"; break;
+ case PROP_PARA_SDTPR : sName = "ParaSdtPr"; break;
}
::std::pair<PropertyNameMap_t::iterator,bool> aInsertIt =
m_pImpl->aNameMap.insert( PropertyNameMap_t::value_type( eId, sName ));