https://bugs.documentfoundation.org/show_bug.cgi?id=168979

Julien Nabet <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #7 from Julien Nabet <[email protected]> ---
On pc Debian x86-64 with master sources updated today, I could reproduce this.

I had 2 bts:
#4  0x00007f1b78c32420 in __assert_fail_base (fmt=<optimized out>,
assertion=<optimized out>, file=<optimized out>, line=617, function=<optimized
out>) at ./assert/assert.c:118
#5  0x00007f1b36486dcd in (anonymous namespace)::GetPercentile
(rArray=std::__debug::vector of length 0, capacity 0,
fPercentile=0.98499999999999999)
    at /home/julien/lo/libreoffice/sc/source/core/data/colorscale.cxx:617
#6  0x00007f1b3648897c in ScDataBarFormat::getMax (this=0x55fbd19ab750, nMin=0,
nMax=0) at /home/julien/lo/libreoffice/sc/source/core/data/colorscale.cxx:946
#7  0x00007f1b36488aa6 in ScDataBarFormat::GetDataBarInfo (this=0x55fbd19ab750,
rAddr=...) at
/home/julien/lo/libreoffice/sc/source/core/data/colorscale.cxx:967
#8  0x00007f1b364a523f in ScConditionalFormat::GetData (this=0x55fbd19ab7f0,
rCell=..., rPos=...) at
/home/julien/lo/libreoffice/sc/source/core/data/conditio.cxx:1908
#9  0x00007f1b367e53b7 in (anonymous namespace)::handleConditionalFormat
    (rCondFormList=..., rCondFormats=..., pInfo=0x55fbd76c58f8,
pTableInfo=0x7ffd2290b5d8, pStlPool=0x55fbd06a2fc0, rAddr=...,
bHidden=@0x7ffd2290adf7: false, bHideFormula=@0x7ffd2290adf6: false,
bTabProtect=false) at
/home/julien/lo/libreoffice/sc/source/core/data/fillinfo.cxx:292

#4  0x00007feabbe32420 in __assert_fail_base (fmt=<optimized out>,
assertion=<optimized out>, file=<optimized out>, line=617, function=<optimized
out>) at ./assert/assert.c:118
#5  0x00007fea7dc86dcd in (anonymous namespace)::GetPercentile
(rArray=std::__debug::vector of length 0, capacity 0,
fPercentile=0.98499999999999999)
    at /home/julien/lo/libreoffice/sc/source/core/data/colorscale.cxx:617
#6  0x00007fea7dc86d3b in ScColorScaleFormat::CalcValue (this=0x56208e45ccf0,
nMin=0, nMax=0, itr=std::unique_ptr<ScColorScaleEntry> = {...})
    at /home/julien/lo/libreoffice/sc/source/core/data/colorscale.cxx:659
#7  0x00007fea7dc87357 in ScColorScaleFormat::GetColor (this=0x56208e45ccf0,
rAddr=...) at
/home/julien/lo/libreoffice/sc/source/core/data/colorscale.cxx:694
#8  0x00007fea7dca51bf in ScConditionalFormat::GetData (this=0x56208e4b4f60,
rCell=..., rPos=...) at
/home/julien/lo/libreoffice/sc/source/core/data/conditio.cxx:1903
#9  0x00007fea7dfe53c7 in (anonymous namespace)::handleConditionalFormat
    (rCondFormList=..., rCondFormats=..., pInfo=0x562094708190,
pTableInfo=0x7ffc4bc97d48, pStlPool=0x56208d700280, rAddr=...,
bHidden=@0x7ffc4bc97567: false, bHideFormula=@0x7ffc4bc97566: false,
bTabProtect=false) at
/home/julien/lo/libreoffice/sc/source/core/data/fillinfo.cxx:292


With this patch, I could open the file:
diff --git a/sc/source/core/data/colorscale.cxx
b/sc/source/core/data/colorscale.cxx
index 5891c10566f1..9f4dfdf9918c 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -656,8 +656,10 @@ double ScColorScaleFormat::CalcValue(double nMin, double
nMax, const ScColorScal
             else
             {
                 double fPercentile = (*itr)->GetValue()/100.0;
-                return GetPercentile(rValues, fPercentile);
+                if (!rValues.empty())
+                    return GetPercentile(rValues, fPercentile);
             }
+            break;
         }

         default:
@@ -943,7 +945,9 @@ double ScDataBarFormat::getMax(double nMin, double nMax)
const
         {
             double fPercentile = mpFormatData->mpUpperLimit->GetValue()/100.0;
             std::vector<double>& rValues = getValues();
-            return GetPercentile(rValues, fPercentile);
+            if (!rValues.empty())
+                return GetPercentile(rValues, fPercentile);
+            break;
         }

         default:

As always, perhaps I didn't really fix the root pb.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to