diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-02-02 14:10:02 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-02-02 14:58:34 +0100 |
commit | 8dadefc35f8b33648fb6adbdaca75ea52b2705db (patch) | |
tree | 9c4126d53c027a2ba4809555bd706571ccf3b599 /xmloff/source/text/txtexppr.cxx | |
parent | 98183c3381ef20c32285027662d7ac4bab23038f (diff) |
xmloff: tdf#96147: ODF export: fix duplicate fo:background-color
... attributes that happen if both CharHighlight and CharBackColor
properties are used, because the CharBackTransparent property wasn't
taken into account, and combining the CharBackColor and
CharBackTransparent properties happens *after*
XMLTextExportPropertySetMapper::ContextFilter() runs.
Also, it looks like a transparent highlight wouldn't export properly but
apparently DomainMapper::getColorFromId() won't create such.
(regression from f880962f5bf26bfaef06bd3f9e67e2d901a2e74c)
Change-Id: Ib628ef8bb377482f74fadb97c81afb95fbbf7184
Diffstat (limited to 'xmloff/source/text/txtexppr.cxx')
-rw-r--r-- | xmloff/source/text/txtexppr.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx index 35a63005a90b..6192bcf0a47f 100644 --- a/xmloff/source/text/txtexppr.cxx +++ b/xmloff/source/text/txtexppr.cxx @@ -669,6 +669,7 @@ void XMLTextExportPropertySetMapper::ContextFilter( // character background and highlight XMLPropertyState* pCharBackground = nullptr; + XMLPropertyState* pCharBackgroundTransparency = nullptr; XMLPropertyState* pCharHighlight = nullptr; bool bNeedsAnchor = false; @@ -831,6 +832,7 @@ void XMLTextExportPropertySetMapper::ContextFilter( break; case CTF_CHAR_BACKGROUND: pCharBackground = propertyState; break; + case CTF_CHAR_BACKGROUND_TRANSPARENCY: pCharBackgroundTransparency = propertyState; break; case CTF_CHAR_HIGHLIGHT: pCharHighlight = propertyState; break; } } @@ -1137,12 +1139,20 @@ void XMLTextExportPropertySetMapper::ContextFilter( // When both background attributes are available export the visible one if( pCharHighlight && pCharBackground ) { + assert(pCharBackgroundTransparency); // always together sal_uInt32 nColor = COL_TRANSPARENT; pCharHighlight->maValue >>= nColor; if( nColor == COL_TRANSPARENT ) + { + // actually this would not be exported as transparent anyway + // and we'd need another property CharHighlightTransparent for that pCharHighlight->mnIndex = -1; + } else + { pCharBackground->mnIndex = -1; + pCharBackgroundTransparency->mnIndex = -1; + } } SvXMLExportPropertyMapper::ContextFilter(bEnableFoFontFamily, rProperties, rPropSet); |