diff options
author | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-06-06 13:21:50 +0200 |
---|---|---|
committer | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-06-06 13:56:55 +0200 |
commit | 4f1684dc3724f9364f226fd0eb21b01ba07cf017 (patch) | |
tree | 62eab442a2e6c92325885727973a237f470fad2a | |
parent | 06a5bbd720b89d629ebf6ccf0d9a62a77c2d9a28 (diff) |
fdo#79558: Preserve missing attributes in paragraph w:shd
The missing attributes are w:val, w:color, w:themeColor, w:themeShade,
w:themeTint, w:themeFillShade and w:themeFillTint.
Change-Id: I67dd7c367d820216c1d11f82e3430fbf550cede8
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 095137f7c60f..f357a6f3b389 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -6876,6 +6876,7 @@ void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) if( sOriginalFill.isEmpty() ) { m_pBackgroundAttrList->add( FSNS( XML_w, XML_fill ), sColor.getStr() ); + m_pBackgroundAttrList->add( FSNS( XML_w, XML_val ), "clear" ); } else if ( sOriginalFill != sColor ) { @@ -6883,8 +6884,8 @@ void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) delete m_pBackgroundAttrList; m_pBackgroundAttrList = m_pSerializer->createAttrList(); m_pBackgroundAttrList->add( FSNS( XML_w, XML_fill ), sColor.getStr() ); + m_pBackgroundAttrList->add( FSNS( XML_w, XML_val ), "clear" ); } - m_pBackgroundAttrList->add( FSNS( XML_w, XML_val ), "clear" ); } } @@ -7271,17 +7272,40 @@ void DocxAttributeOutput::ParaGrabBag(const SfxGrabBagItem& rItem) { uno::Sequence<beans::PropertyValue> aGrabBagSeq; i->second >>= aGrabBagSeq; - OUString sThemeFill, sOriginalFill; + OUString sVal, sOriginalFill, sShdColor, + sThemeColor, sThemeTint, sThemeShade, + sThemeFill, sThemeFillTint, sThemeFillShade; for (sal_Int32 j=0; j < aGrabBagSeq.getLength(); ++j) { - if (aGrabBagSeq[j].Name == "themeFill") - aGrabBagSeq[j].Value >>= sThemeFill; + if (aGrabBagSeq[j].Name == "val") + aGrabBagSeq[j].Value >>= sVal; + else if (aGrabBagSeq[j].Name == "color") + aGrabBagSeq[j].Value >>= sShdColor; + else if (aGrabBagSeq[j].Name == "themeColor") + aGrabBagSeq[j].Value >>= sThemeColor; + else if (aGrabBagSeq[j].Name == "themeTint") + aGrabBagSeq[j].Value >>= sThemeTint; + else if (aGrabBagSeq[j].Name == "themeShade") + aGrabBagSeq[j].Value >>= sThemeShade; else if (aGrabBagSeq[j].Name == "fill") aGrabBagSeq[j].Value >>= sOriginalFill; + else if (aGrabBagSeq[j].Name == "themeFill") + aGrabBagSeq[j].Value >>= sThemeFill; + else if (aGrabBagSeq[j].Name == "themeFillTint") + aGrabBagSeq[j].Value >>= sThemeFillTint; + else if (aGrabBagSeq[j].Name == "themeFillShade") + aGrabBagSeq[j].Value >>= sThemeFillShade; } - AddToAttrList(m_pBackgroundAttrList, 2, + AddToAttrList(m_pBackgroundAttrList, 9, + FSNS(XML_w, XML_val), OUStringToOString(sVal, RTL_TEXTENCODING_UTF8).getStr(), + FSNS(XML_w, XML_color), OUStringToOString(sShdColor, RTL_TEXTENCODING_UTF8).getStr(), + FSNS(XML_w, XML_themeColor), OUStringToOString(sThemeColor, RTL_TEXTENCODING_UTF8).getStr(), + FSNS(XML_w, XML_themeTint), OUStringToOString(sThemeTint, RTL_TEXTENCODING_UTF8).getStr(), + FSNS(XML_w, XML_themeShade), OUStringToOString(sThemeShade, RTL_TEXTENCODING_UTF8).getStr(), + FSNS(XML_w, XML_fill), OUStringToOString(sOriginalFill, RTL_TEXTENCODING_UTF8).getStr(), FSNS(XML_w, XML_themeFill), OUStringToOString(sThemeFill, RTL_TEXTENCODING_UTF8).getStr(), - FSNS(XML_w, XML_fill), OUStringToOString(sOriginalFill, RTL_TEXTENCODING_UTF8).getStr()); + FSNS(XML_w, XML_themeFillTint), OUStringToOString(sThemeFillTint, RTL_TEXTENCODING_UTF8).getStr(), + FSNS(XML_w, XML_themeFillShade), OUStringToOString(sThemeFillShade, RTL_TEXTENCODING_UTF8).getStr()); } else if (i->first == "SdtPr") { |