summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerge Krot <Serge.Krot@cib.de>2017-10-25 13:07:35 +0200
committerSerge Krot (CIB) <Serge.Krot@cib.de>2017-10-25 20:44:52 +0200
commitb7e8c7631d3ef3af53e873a9435bd954790cab05 (patch)
tree1016a90308cf0a7cd68199fef3882ac09dba148b
parent583b49dca97c26365bd6bafafc422297aa7e9ed1 (diff)
tdf#38778 Added colors into run properties of field run
During export into DOCX all runs inside fields should contain all character properties including character color. Change-Id: I2a7d4fc26f1e1de1080f51de84180a19794709a9 Reviewed-on: https://gerrit.libreoffice.org/43723 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Serge Krot (CIB) <Serge.Krot@cib.de>
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 54d2819c2445..c8e690ac7b9e 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1811,15 +1811,31 @@ void DocxAttributeOutput::DoWriteFieldRunProperties( const SwTextNode * pNode, s
{
m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND );
+ // 1. output webHidden flag
if(GetExport().m_bHideTabLeaderAndPageNumbers && m_pHyperlinkAttrList.is() )
{
m_pSerializer->singleElementNS( XML_w, XML_webHidden, FSEND );
}
+ // 2. output color
+ if ( m_pColorAttrList.is() )
+ {
+ XFastAttributeListRef xAttrList( m_pColorAttrList.get() );
+ m_pColorAttrList.clear();
+
+ m_pSerializer->singleElementNS( XML_w, XML_color, xAttrList );
+ }
+
+ // 3. output all other character properties
SwWW8AttrIter aAttrIt( m_rExport, *pNode );
aAttrIt.OutAttr( nPos, false );
m_pSerializer->endElementNS( XML_w, XML_rPr );
+
+ // During SwWW8AttrIter::OutAttr() call the new value of the text color could be set into [m_pColorAttrList].
+ // But we do not need to keep it any more and should clean up,
+ // While the next run could define a new color that is different to current one.
+ m_pColorAttrList.clear();
}
m_bPreventDoubleFieldsHandling = false;
@@ -6600,9 +6616,6 @@ void DocxAttributeOutput::CharCaseMap( const SvxCaseMapItem& rCaseMap )
void DocxAttributeOutput::CharColor( const SvxColorItem& rColor )
{
- if (m_bPreventDoubleFieldsHandling)
- return;
-
const Color aColor( rColor.GetValue() );
OString aColorString;