diff options
author | Henry Castro <hcastro@collabora.com> | 2023-03-17 10:34:15 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2023-03-23 07:10:54 +0000 |
commit | 02880f9796a93bab73fa6f71f2d60155f786870d (patch) | |
tree | 601078b8edec4686d63db1d0a53055b416136e2c /sc/source/filter | |
parent | 87c1d93fd2b192f341112a609c741370561879a2 (diff) |
sc: filter: oox: add missing tag "fillcolor"
To fill the positive color of the conditional format data bar:
<x14:dataBar maxLength="100" minLength="0" axisPosition="automatic" direction="context" gradient="0" negativeBarBorderColorSameAsPositive="0">
<x14:cfvo type="autoMin"/>
<x14:cfvo type="autoMax"/>
<x14:fillColor rgb="FF638EC6"/>
<x14:negativeFillColor indexed="2"/>
<x14:axisColor indexed="64"/>
</x14:dataBar>
Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I17e83a01affff292ff941d92f6ae59954aa246ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149340
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sc/source/filter')
-rw-r--r-- | sc/source/filter/inc/condformatbuffer.hxx | 3 | ||||
-rw-r--r-- | sc/source/filter/oox/condformatbuffer.cxx | 15 | ||||
-rw-r--r-- | sc/source/filter/oox/extlstcontext.cxx | 6 |
3 files changed, 24 insertions, 0 deletions
diff --git a/sc/source/filter/inc/condformatbuffer.hxx b/sc/source/filter/inc/condformatbuffer.hxx index 92c7463a5b6a..43158e330c83 100644 --- a/sc/source/filter/inc/condformatbuffer.hxx +++ b/sc/source/filter/inc/condformatbuffer.hxx @@ -237,6 +237,7 @@ struct ExCfRuleModel ExCfRuleModel() : mnAxisColor( ColorTransparency, UNSIGNED_RGB_TRANSPARENT ), mnNegativeColor( ColorTransparency, UNSIGNED_RGB_TRANSPARENT ), mbGradient( false ), mbIsLower( true ) {} // AxisColor ::Color mnAxisColor; + ::Color mnPositiveColor; // NegativeFillColor ::Color mnNegativeColor; OUString maAxisPosition; // DataBar @@ -250,6 +251,7 @@ class ExtCfDataBarRule : public WorksheetHelper enum RuleType { DATABAR, + POSITIVEFILLCOLOR, NEGATIVEFILLCOLOR, AXISCOLOR, CFVO, @@ -263,6 +265,7 @@ public: ExtCfDataBarRule(ScDataBarFormatData* pTarget, const WorksheetHelper& rParent); void finalizeImport(); void importDataBar( const AttributeList& rAttribs ); + void importPositiveFillColor( const AttributeList& rAttribs ); void importNegativeFillColor( const AttributeList& rAttribs ); void importAxisColor( const AttributeList& rAttribs ); void importCfvo( const AttributeList& rAttribs ); diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index 13ca11ed9333..9f7512d912e7 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -1299,6 +1299,12 @@ void ExtCfDataBarRule::finalizeImport() pDataBar->maAxisColor = maModel.mnAxisColor; break; } + case POSITIVEFILLCOLOR: + { + ScDataBarFormatData* pDataBar = mpTarget; + pDataBar->maPositiveColor = maModel.mnPositiveColor; + break; + } case NEGATIVEFILLCOLOR: { ScDataBarFormatData* pDataBar = mpTarget; @@ -1344,6 +1350,15 @@ void ExtCfDataBarRule::importDataBar( const AttributeList& rAttribs ) maModel.maAxisPosition = rAttribs.getString( XML_axisPosition, "automatic" ); } +void ExtCfDataBarRule::importPositiveFillColor( const AttributeList& rAttribs ) +{ + mnRuleType = POSITIVEFILLCOLOR; + ThemeBuffer& rThemeBuffer = getTheme(); + GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper(); + ::Color aColor = importOOXColor(rAttribs, rThemeBuffer, rGraphicHelper); + maModel.mnPositiveColor = aColor; +} + void ExtCfDataBarRule::importNegativeFillColor( const AttributeList& rAttribs ) { mnRuleType = NEGATIVEFILLCOLOR; diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index 67d52fc69da9..eb470999f40f 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -56,6 +56,12 @@ void ExtCfRuleContext::onStartElement( const AttributeList& rAttribs ) xRule->importDataBar( rAttribs ); break; } + case XLS14_TOKEN( fillColor ): + { + ExtCfDataBarRuleRef xRule = getCondFormats().createExtCfDataBarRule(mpTarget); + xRule->importPositiveFillColor( rAttribs ); + break; + } case XLS14_TOKEN( negativeFillColor ): { ExtCfDataBarRuleRef xRule = getCondFormats().createExtCfDataBarRule(mpTarget); |