sc/source/filter/oox/condformatbuffer.cxx |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit ab491cf1dfe97c256050f75d3746bac91f16a7f9
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Mon Jun 19 11:41:52 2023 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Tue Jun 20 13:40:03 2023 +0200

    sc: filter: oox: fix setting value to color scale
    
    The COLORSCALE_VALUE setValue method reset the mpCell
    that contains formula.
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: Idbbfcdc5bce78542ce671753d9a70dcd375e7966
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153281
    Tested-by: Jenkins
    (cherry picked from commit 3a827ee8f05a5188eebda90d0e306cc90ee28638)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153284

diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index 046f37d2c4aa..75171441c23d 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1486,16 +1486,17 @@ void ExtCfDataBarRule::finalizeImport()
             else if (maModel.maColorScaleType == "formula")
                 pEntry->SetType(COLORSCALE_FORMULA);
             else if (maModel.maColorScaleType == "num")
-                pEntry->SetType(COLORSCALE_VALUE);
-
-            if (!maModel.msScaleTypeValue.isEmpty())
             {
-                sal_Int32 nSize = 0;
-                rtl_math_ConversionStatus eStatus = 
rtl_math_ConversionStatus_Ok;
-                double fValue = 
rtl::math::stringToDouble(maModel.msScaleTypeValue, '.', '\0', &eStatus, 
&nSize);
-                if (eStatus == rtl_math_ConversionStatus_Ok && nSize == 
maModel.msScaleTypeValue.getLength())
+                pEntry->SetType(COLORSCALE_VALUE);
+                if (!maModel.msScaleTypeValue.isEmpty())
                 {
-                    pEntry->SetValue(fValue);
+                    sal_Int32 nSize = 0;
+                    rtl_math_ConversionStatus eStatus = 
rtl_math_ConversionStatus_Ok;
+                    double fValue = 
rtl::math::stringToDouble(maModel.msScaleTypeValue, '.', '\0', &eStatus, 
&nSize);
+                    if (eStatus == rtl_math_ConversionStatus_Ok && nSize == 
maModel.msScaleTypeValue.getLength())
+                    {
+                        pEntry->SetValue(fValue);
+                    }
                 }
             }
             break;

Reply via email to