summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-05-27 17:09:44 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-05-30 15:54:13 +0200
commit74657a03218e37fc833c002a22c42950768ad7a3 (patch)
treede9d62d121e22287b9f556a70f5f734ad69ec8f8 /writerfilter
parent6272a497cdb97d2d6b697e0abfe74d42b97470ce (diff)
bnc#817956 DOCX import of document background color
See wwSectionManager::SetSegmentToPageDesc(), this has to be applied to every page style. Change-Id: Iea2707ae665a55eabda3ed7575cf3658f7af5237 (cherry picked from commit 992da0d5cf04497bad55637f6a6ebfcdaec03e16) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx3
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.hxx3
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx3
-rw-r--r--writerfilter/source/ooxml/model.xml2
4 files changed, 10 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 66b1e6ce1f61..5acfb0c7e2e2 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1446,6 +1446,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 8d513bba31ea..e2a43b631f31 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -680,6 +680,9 @@ public:
bool m_bInTableStyleRunProps;
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 8f19057bc6f1..284dfbf16668 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -889,6 +889,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 33b3414dbb96..6fc27981d1d6 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -14997,7 +14997,7 @@
<ref name="CT_PictureBase"/>
<optional>
<attribute name="color">
- <text/>
+ <ref name="ST_HexColor"/>
<xs:documentation>Background Color</xs:documentation>
</attribute>
</optional>