diff options
-rw-r--r-- | sc/inc/colorscale.hxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/colorscale.cxx | 21 |
2 files changed, 23 insertions, 2 deletions
diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx index 593a662387d0..dd28d47f51e8 100644 --- a/sc/inc/colorscale.hxx +++ b/sc/inc/colorscale.hxx @@ -338,6 +338,10 @@ struct ScIconSetFormatData */ bool mbReverse; boost::ptr_vector<ScColorScaleEntry> maEntries; + bool mbCustom; + // the std::pair points to exactly one image + // std..pair::second == -1 means no image + std::vector<std::pair<ScIconSetType, sal_Int32> > maCustomVector; ScIconSetFormatData(): eIconSetType(IconSet_3Arrows), diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 9ef4aea7900d..cefb5cc962c3 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -1067,11 +1067,28 @@ ScIconSetInfo* ScIconSetFormat::GetIconSetInfo(const ScAddress& rAddr) const if(mpFormatData->mbReverse) { sal_Int32 nMaxIndex = mpFormatData->maEntries.size() - 1; - pInfo->nIconIndex = nMaxIndex - nIndex; + nIndex = nMaxIndex - nIndex; + } + + if (mpFormatData->mbCustom && sal_Int32(mpFormatData->maCustomVector.size()) > nIndex) + { + ScIconSetType eCustomType = mpFormatData->maCustomVector[nIndex].first; + sal_Int32 nCustomIndex = mpFormatData->maCustomVector[nIndex].second; + if (nCustomIndex == -1) + { + delete pInfo; + return NULL; + } + + pInfo->eIconSetType = eCustomType; + pInfo->nIconIndex = nCustomIndex; } else + { pInfo->nIconIndex = nIndex; - pInfo->eIconSetType = mpFormatData->eIconSetType; + pInfo->eIconSetType = mpFormatData->eIconSetType; + } + pInfo->mbShowValue = mpFormatData->mbShowValue; return pInfo; } |