From 64ad575674e6170ebb8ebeeacd41b14af07a0377 Mon Sep 17 00:00:00 2001 From: Jacobo Aragunde PĂ©rez Date: Wed, 19 Mar 2014 11:19:54 +0100 Subject: ooxml: preserve checkbox sdt control Checkbox controls in docx are implemented with a sdt block containing the property w:14:checkbox, which has several child elements. To implement the preservation of the field, we had to add several tags to the ooxml model file. Notice they belong to namespace w14, that's why we had to add a redundant definitions of CT_STRING, ST_STRING and their actions. Then, we just used the existing mechanisms on the importer and the exporter. Finally, added a unit test. TODO: the checkbox is preserved on export but it cannot be modified. We should import it like we do for combo and date boxes. Change-Id: I40f29b48ec24719c48482b9c8cff10176d1b188d --- writerfilter/source/dmapper/DomainMapper.cxx | 4 +++ writerfilter/source/ooxml/model.xml | 44 +++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) (limited to 'writerfilter') diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 0407fd1907d7..e1215f09e846 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2234,6 +2234,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) } break; case NS_ooxml::LN_CT_SdtPr_equation: + case NS_ooxml::LN_CT_SdtPr_checkbox: case NS_ooxml::LN_CT_SdtPr_docPartObj: case NS_ooxml::LN_CT_SdtPr_docPartList: case NS_ooxml::LN_CT_SdtPr_picture: @@ -2250,6 +2251,9 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) pProperties->resolve(*this); } break; + case NS_ooxml::LN_CT_SdtCheckbox_checked: + case NS_ooxml::LN_CT_SdtCheckbox_checkedState: + case NS_ooxml::LN_CT_SdtCheckbox_uncheckedState: case NS_ooxml::LN_CT_SdtDocPart_docPartGallery: case NS_ooxml::LN_CT_SdtDocPart_docPartCategory: case NS_ooxml::LN_CT_SdtDocPart_docPartUnique: diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index d80f2e2d1a3e..ca9685df01a7 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -6280,9 +6280,47 @@ + + + + String + + + + + + value + + + + + + + + + + + + + + + + + + + + + + + + + checked + checkedState + uncheckedState + bg1 tx1 @@ -18860,6 +18898,9 @@ + + + @@ -24508,7 +24549,7 @@ - + @@ -24520,6 +24561,7 @@ + -- cgit