diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-12 09:06:49 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-12 09:07:16 +0100 |
commit | b0058366190b63fcbc112b43d387f7600a7fe55d (patch) | |
tree | 8eea47c8653d19e2dc7e81d96f269c1663593f79 /sw/source/filter/ww8/rtfexport.cxx | |
parent | 813a319fe836d1ed1c967928bc044643d0b4c07d (diff) |
tdf#61511 RTF export: handle page background solid color fill
Change-Id: I562419b6d4fb791ef5b255effe9a4510d930bdbc
Diffstat (limited to 'sw/source/filter/ww8/rtfexport.cxx')
-rw-r--r-- | sw/source/filter/ww8/rtfexport.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 29e4ae0436ad..4fed09fa55cd 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -386,6 +386,30 @@ void RtfExport::WriteMainText() { SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start"); + if (boost::optional<SvxBrushItem> oBrush = getBackground()) + { + Strm().WriteCharPtr(LO_STRING_SVTOOLS_RTF_VIEWBKSP).WriteChar('1'); + Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_BACKGROUND); + Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_SHP); + Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPINST); + + std::vector< std::pair<OString, OString> > aProperties; + aProperties.push_back(std::make_pair<OString, OString>("shapeType", "1")); + aProperties.push_back(std::make_pair<OString, OString>("fillColor", OString::number(msfilter::util::BGRToRGB(oBrush->GetColor().GetColor())))); + for (size_t i = 0; i < aProperties.size(); ++i) + { + Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_SP "{"); + Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_SN " "); + Strm().WriteCharPtr(aProperties[i].first.getStr()); + Strm().WriteCharPtr("}{" OOO_STRING_SVTOOLS_RTF_SV " "); + Strm().WriteCharPtr(aProperties[i].second.getStr()); + Strm().WriteCharPtr("}}"); + } + Strm().WriteChar('}'); // shpinst + Strm().WriteChar('}'); // shp + Strm().WriteChar('}'); // background + } + SwTableNode* pTableNode = m_pCurPam->GetNode().FindTableNode(); if (m_pWriter && m_pWriter->bWriteOnlyFirstTable && pTableNode != nullptr) |