-
Jacobo Aragunde Pérez yazdı
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
55211e61