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 eb2de384f33875dabb98bf91d682111597d81784
Author:     Henry Castro <[email protected]>
AuthorDate: Fri Mar 17 10:34:15 2023 -0400
Commit:     Xisco Fauli <[email protected]>
CommitDate: Wed Jun 14 10:45:35 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 <[email protected]>
    Change-Id: I17e83a01affff292ff941d92f6ae59954aa246ef
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149064
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152965
    Tested-by: Jenkins
    (cherry picked from commit aebf004ae72e914540526269499bae27f39e04bf)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153013
    Reviewed-by: Xisco Fauli <[email protected]>

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 08e9053684e2..cdc8d4727baf 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
@@ -251,6 +252,7 @@ class ExtCfDataBarRule : public WorksheetHelper
     enum RuleType
     {
         DATABAR,
+        POSITIVEFILLCOLOR,
         NEGATIVEFILLCOLOR,
         AXISCOLOR,
         CFVO,
@@ -264,6 +266,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 1b397c2db316..649046e8b3b7 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1398,6 +1398,12 @@ void ExtCfDataBarRule::finalizeImport()
             pDataBar->maAxisColor = maModel.mnAxisColor;
             break;
         }
+        case POSITIVEFILLCOLOR:
+        {
+            ScDataBarFormatData* pDataBar = mpTarget;
+            pDataBar->maPositiveColor = maModel.mnPositiveColor;
+            break;
+        }
         case NEGATIVEFILLCOLOR:
         {
             ScDataBarFormatData* pDataBar = mpTarget;
@@ -1456,6 +1462,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 1ea6b70d8707..2646f0969958 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);

Reply via email to