oox/source/token/tokens.txt | 1 + sc/source/filter/inc/condformatbuffer.hxx | 3 +++ sc/source/filter/oox/condformatbuffer.cxx | 15 +++++++++++++++ sc/source/filter/oox/extlstcontext.cxx | 6 ++++++ 4 files changed, 25 insertions(+)
New commits: commit 02880f9796a93bab73fa6f71f2d60155f786870d Author: Henry Castro <hcas...@collabora.com> AuthorDate: Fri Mar 17 10:34:15 2023 -0400 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Mar 23 07:10:54 2023 +0000 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 <hcas...@collabora.com> Change-Id: I17e83a01affff292ff941d92f6ae59954aa246ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149340 Tested-by: Andras Timar <andras.ti...@collabora.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt index c68d10f7de1e..1fd750d72dad 100644 --- a/oox/source/token/tokens.txt +++ b/oox/source/token/tokens.txt @@ -2227,6 +2227,7 @@ fileType fileVersion filetime fill +fillColor fillClrLst fillFormulas fillId 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);