summaryrefslogtreecommitdiff
path: root/sc/source/core/data/colorscale.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data/colorscale.cxx')
-rw-r--r--sc/source/core/data/colorscale.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx
index 52496653ab1b..8b1a8987acbb 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -379,6 +379,9 @@ ScColorScaleFormat::ScColorScaleFormat(ScDocument* pDoc, const ScColorScaleForma
{
maColorScales.emplace_back(new ScColorScaleEntry(pDoc, *rxEntry));
}
+
+ auto aCache = rFormat.GetCache();
+ SetCache(aCache);
}
ScColorFormat* ScColorScaleFormat::Clone(ScDocument* pDoc) const
@@ -440,6 +443,18 @@ const ScRangeList& ScColorFormat::GetRange() const
return mpParent->GetRange();
}
+std::vector<double> ScColorFormat::GetCache() const
+{
+ std::vector<double> empty;
+ return mpCache ? mpCache->maValues : empty;
+}
+
+void ScColorFormat::SetCache(const std::vector<double>& aValues)
+{
+ mpCache.reset(new ScColorFormatCache);
+ mpCache->maValues = aValues;
+}
+
std::vector<double>& ScColorFormat::getValues() const
{
if(!mpCache)
@@ -512,6 +527,12 @@ void ScColorFormat::endRendering()
mpCache.reset();
}
+void ScColorFormat::updateValues()
+{
+ getMinValue();
+ getMaxValue();
+}
+
namespace {
sal_uInt8 GetColorValue( double nVal, double nVal1, sal_uInt8 nColVal1, double nVal2, sal_uInt8 nColVal2 )