summaryrefslogtreecommitdiffstats
path: root/sc/source/ui/view/output.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-11-17 22:33:28 +0100
committerMichael Stahl <mstahl@redhat.com>2015-11-17 23:49:04 +0100
commit05896a16412dd48d19ffd2e360ae7da5e41c2725 (patch)
treeeb9ff3428b6175c0c9f5cacfeb762fdcd00b87d9 /sc/source/ui/view/output.cxx
parentNo point to link against pure UNO component library fwk (diff)
downloadcore-05896a16412dd48d19ffd2e360ae7da5e41c2725.tar.gz
core-05896a16412dd48d19ffd2e360ae7da5e41c2725.zip
sc: loplugin:badstatics
Not sure if there would be a performance penalty to re-loading these icons every time, so move the static map from ScIconSetFormat::getBitmap() to a member of ScDocument. Change-Id: If560d70cea27e25396dd821d9e77a785e3b79820
Diffstat (limited to 'sc/source/ui/view/output.cxx')
-rw-r--r--sc/source/ui/view/output.cxx20
1 files changed, 11 insertions, 9 deletions
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 12970ceb0dee..16e24992f9fd 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -873,24 +873,26 @@ void drawDataBars(vcl::RenderContext& rRenderContext, const ScDataBarInfo* pOldD
}
}
-BitmapEx& getIcon( ScIconSetType eType, sal_Int32 nIndex )
+BitmapEx& getIcon(sc::IconSetBitmapMap & rIconSetBitmapMap, ScIconSetType eType, sal_Int32 nIndex)
{
- return ScIconSetFormat::getBitmap( eType, nIndex );
+ return ScIconSetFormat::getBitmap(rIconSetBitmapMap, eType, nIndex);
}
-void drawIconSets(vcl::RenderContext& rRenderContext, const ScIconSetInfo* pOldIconSetInfo, const Rectangle& rRect, long nOneX, long nOneY)
+void drawIconSets(vcl::RenderContext& rRenderContext, const ScIconSetInfo* pOldIconSetInfo, const Rectangle& rRect, long nOneX, long nOneY,
+ sc::IconSetBitmapMap & rIconSetBitmapMap)
{
//long nSize = 16;
ScIconSetType eType = pOldIconSetInfo->eIconSetType;
sal_Int32 nIndex = pOldIconSetInfo->nIconIndex;
- BitmapEx& rIcon = getIcon( eType, nIndex );
+ BitmapEx& rIcon = getIcon(rIconSetBitmapMap, eType, nIndex);
long aOrigSize = std::max<long>(0,std::min(rRect.GetSize().getWidth() - 4 * nOneX, rRect.GetSize().getHeight() -4 * nOneY));
rRenderContext.DrawBitmapEx( Point( rRect.Left() + 2 * nOneX, rRect.Top() + 2 * nOneY), Size(aOrigSize, aOrigSize), rIcon );
}
void drawCells(vcl::RenderContext& rRenderContext, const Color* pColor, const SvxBrushItem* pBackground, const Color*& pOldColor, const SvxBrushItem*& pOldBackground,
Rectangle& rRect, long nPosX, long nLayoutSign, long nOneX, long nOneY, const ScDataBarInfo* pDataBarInfo, const ScDataBarInfo*& pOldDataBarInfo,
- const ScIconSetInfo* pIconSetInfo, const ScIconSetInfo*& pOldIconSetInfo)
+ const ScIconSetInfo* pIconSetInfo, const ScIconSetInfo*& pOldIconSetInfo,
+ sc::IconSetBitmapMap & rIconSetBitmapMap)
{
long nSignedOneX = nOneX * nLayoutSign;
// need to paint if old color scale has been used and now
@@ -907,7 +909,7 @@ void drawCells(vcl::RenderContext& rRenderContext, const Color* pColor, const Sv
if( pOldDataBarInfo )
drawDataBars(rRenderContext, pOldDataBarInfo, rRect, nOneX, nOneY);
if( pOldIconSetInfo )
- drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY);
+ drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, rIconSetBitmapMap);
rRect.Left() = nPosX - nSignedOneX;
}
@@ -927,7 +929,7 @@ void drawCells(vcl::RenderContext& rRenderContext, const Color* pColor, const Sv
if( pOldDataBarInfo )
drawDataBars(rRenderContext, pOldDataBarInfo, rRect, nOneX, nOneY);
if( pOldIconSetInfo )
- drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY);
+ drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, rIconSetBitmapMap);
rRect.Left() = nPosX - nSignedOneX;
}
@@ -1087,7 +1089,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
if (bWorksInPixels)
nPosXLogic = rRenderContext.PixelToLogic(Point(nPosX, 0)).X();
- drawCells(rRenderContext, pColor, pBackground, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, pDataBarInfo, pOldDataBarInfo, pIconSetInfo, pOldIconSetInfo);
+ drawCells(rRenderContext, pColor, pBackground, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, pDataBarInfo, pOldDataBarInfo, pIconSetInfo, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap());
// extend for all merged cells
nMergedCells = 1;
@@ -1111,7 +1113,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
if (bWorksInPixels)
nPosXLogic = rRenderContext.PixelToLogic(Point(nPosX, 0)).X();
- drawCells(rRenderContext, nullptr, nullptr, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, nullptr, pOldDataBarInfo, nullptr, pOldIconSetInfo);
+ drawCells(rRenderContext, nullptr, nullptr, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, nullptr, pOldDataBarInfo, nullptr, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap());
nArrY += nSkip;
}