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 aebf004ae72e914540526269499bae27f39e04bf Author: Henry Castro <hcas...@collabora.com> AuthorDate: Fri Mar 17 10:34:15 2023 -0400 Commit: Henry Castro <hcas...@collabora.com> CommitDate: Tue Jun 13 17:45:46 2023 +0200 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/+/149064 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152965 Tested-by: Jenkins diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt index dee9010df789..eb5239d8a8ac 100644 --- a/oox/source/token/tokens.txt +++ b/oox/source/token/tokens.txt @@ -2228,6 +2228,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 992f14e041a8..1180b1e0aa74 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 ac5c2738aa47..63e75170a367 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -1322,6 +1322,12 @@ void ExtCfDataBarRule::finalizeImport() pDataBar->maAxisColor = maModel.mnAxisColor; break; } + case POSITIVEFILLCOLOR: + { + ScDataBarFormatData* pDataBar = mpTarget; + pDataBar->maPositiveColor = maModel.mnPositiveColor; + break; + } case NEGATIVEFILLCOLOR: { ScDataBarFormatData* pDataBar = mpTarget; @@ -1367,6 +1373,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 45e60e7c6f5e..760ba26c1727 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);