diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-05-27 17:09:44 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-05-30 16:51:53 +0200 |
commit | b532f43821d83134e413186d385060a75d851cf7 (patch) | |
tree | 665de294970c33a0bacfe3dad900c542c1744df4 | |
parent | 487e34c741231b939b314442b091edb6ab7216a8 (diff) |
bnc#817956 DOCX import of document background color
See wwSectionManager::SetSegmentToPageDesc(), this has to be applied to
every page style.
(cherry picked from commit 992da0d5cf04497bad55637f6a6ebfcdaec03e16)
Conflicts:
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Change-Id: Iea2707ae665a55eabda3ed7575cf3658f7af5237
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 3 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.hxx | 3 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.cxx | 3 | ||||
-rw-r--r-- | writerfilter/source/ooxml/model.xml | 2 |
4 files changed, 10 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 58cbb4d4d048..1dd4acf3e94a 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1506,6 +1506,9 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) case NS_ooxml::LN_CT_SdtListItem_value: m_pImpl->m_pSdtHelper->getDropDownItems().push_back(sStringValue); break; + case NS_ooxml::LN_CT_Background_color: + m_pImpl->m_oBackgroundColor.reset(nIntValue); + break; default: { #if OSL_DEBUG_LEVEL > 0 diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index cc6fd63c2f4d..5906a42fb532 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -661,6 +661,9 @@ public: bool IsNewDoc(); SdtHelper* m_pSdtHelper; + + /// Document background color, applied to every page style. + boost::optional<sal_Int32> m_oBackgroundColor; }; } //namespace dmapper } //namespace writerfilter diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 4dcea8ea2d71..4781a671daa2 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -885,6 +885,9 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) operator[]( PropertyDefinition( PROP_LEFT_MARGIN, false )) = uno::makeAny( m_nLeftMargin ); operator[]( PropertyDefinition( PROP_RIGHT_MARGIN, false )) = uno::makeAny( m_nRightMargin ); + if (rDM_Impl.m_oBackgroundColor) + operator[](PropertyDefinition(PROP_BACK_COLOR, false)) = uno::makeAny(*rDM_Impl.m_oBackgroundColor); + /*** if headers/footers are available then the top/bottom margins of the header/footer are copied to the top/bottom margin of the page */ diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index 47971ff529d3..a4d4069172a9 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -14974,7 +14974,7 @@ <ref name="CT_PictureBase"/> <optional> <attribute name="color"> - <text/> + <ref name="ST_HexColor"/> <xs:documentation>Background Color</xs:documentation> </attribute> </optional> |