summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-12-12 12:16:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-12-12 12:33:33 +0000
commit9c76f393431bb38259ec5465393ec86da026399e (patch)
tree3d350887c53c823e609e92a3a1099d3fed7ddffc /sc/source
parent96d0506fceb8064c5ae156dfaf12d5b45623c557 (diff)
manage OutlineBitmap imagelist directly in its owner user
Change-Id: I4437484192016db7ce72614ae07c5a7d1bd9ec5b
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/global.cxx11
-rw-r--r--sc/source/ui/inc/olinewin.hxx2
-rw-r--r--sc/source/ui/view/olinewin.cxx10
3 files changed, 5 insertions, 18 deletions
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 68d1d83937a9..2d5c3ad6264f 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -111,8 +111,6 @@ SvxBrushItem* ScGlobal::pButtonBrushItem = nullptr;
SvxBrushItem* ScGlobal::pEmbeddedBrushItem = nullptr;
SvxBrushItem* ScGlobal::pProtectedBrushItem = nullptr;
-ImageList* ScGlobal::pOutlineBitmaps = nullptr;
-
ScFunctionList* ScGlobal::pStarCalcFunctionList = nullptr;
ScFunctionMgr* ScGlobal::pStarCalcFunctionMgr = nullptr;
@@ -480,14 +478,6 @@ const OUString& ScGlobal::GetEmptyOUString()
return *pEmptyOUString;
}
-ImageList* ScGlobal::GetOutlineSymbols()
-{
- ImageList*& rpImageList = pOutlineBitmaps;
- if( !rpImageList )
- rpImageList = new ImageList( ScResId( RID_OUTLINEBITMAPS ) );
- return rpImageList;
-}
-
void ScGlobal::Init()
{
pEmptyOUString = new OUString;
@@ -610,7 +600,6 @@ void ScGlobal::Clear()
DELETEZ(pButtonBrushItem);
DELETEZ(pEmbeddedBrushItem);
DELETEZ(pProtectedBrushItem);
- DELETEZ(pOutlineBitmaps);
DELETEZ(pEnglishFormatter);
DELETEZ(pCaseTransliteration);
DELETEZ(pTransliteration);
diff --git a/sc/source/ui/inc/olinewin.hxx b/sc/source/ui/inc/olinewin.hxx
index 904ea1dbf61f..7c9f09a60097 100644
--- a/sc/source/ui/inc/olinewin.hxx
+++ b/sc/source/ui/inc/olinewin.hxx
@@ -38,7 +38,7 @@ private:
bool mbMirrorEntries; /// true = mirror the order of entries (including header)
bool mbMirrorLevels; /// true = mirror the order of levels, including the border
- ImageList* mpSymbols; /// Symbols for buttons.
+ ImageList maSymbols; /// Symbols for buttons.
Color maLineColor; /// Line color for expanded groups.
long mnHeaderSize; /// Size of the header area in entry direction.
long mnHeaderPos; /// Position of the header area in entry direction.
diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx
index 57b1feacfbc6..c332835559bd 100644
--- a/sc/source/ui/view/olinewin.cxx
+++ b/sc/source/ui/view/olinewin.cxx
@@ -26,6 +26,7 @@
#include "document.hxx"
#include "dbfunc.hxx"
#include "sc.hrc"
+#include "scresid.hxx"
const long SC_OL_BITMAPSIZE = 12;
const long SC_OL_POSOFFSET = 2;
@@ -45,7 +46,7 @@ ScOutlineWindow::ScOutlineWindow( vcl::Window* pParent, ScOutlineMode eMode, ScV
mbHoriz( eMode == SC_OUTLINE_HOR ),
mbMirrorEntries( false ), // updated in SetHeaderSize
mbMirrorLevels( false ), // updated in SetHeaderSize
- mpSymbols( nullptr ),
+ maSymbols(ScResId(RID_OUTLINEBITMAPS)),
maLineColor( COL_BLACK ),
mnHeaderSize( 0 ),
mnHeaderPos( 0 ),
@@ -155,7 +156,6 @@ void ScOutlineWindow::InitSettings()
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
SetBackground( rStyleSettings.GetFaceColor() );
maLineColor = rStyleSettings.GetButtonTextColor();
- mpSymbols = ScGlobal::GetOutlineSymbols();
Invalidate();
}
@@ -535,8 +535,7 @@ void ScOutlineWindow::DrawRectRel(
void ScOutlineWindow::DrawImageRel( long nLevelPos, long nEntryPos, sal_uInt16 nId )
{
- OSL_ENSURE( mpSymbols, "ScOutlineWindow::DrawImageRel - no images" );
- const Image& rImage = mpSymbols->GetImage( nId );
+ const Image& rImage = maSymbols.GetImage( nId );
SetLineColor();
SetFillColor( GetBackground().GetColor() );
Point aPos( GetPoint( nLevelPos, nEntryPos ) );
@@ -549,12 +548,11 @@ void ScOutlineWindow::DrawBorderRel( size_t nLevel, size_t nEntry, bool bPressed
Point aPos;
if ( GetImagePos( nLevel, nEntry, aPos ) )
{
- OSL_ENSURE( mpSymbols, "ScOutlineWindow::DrawBorderRel - no images" );
sal_uInt16 nId = bPressed ? SC_OL_IMAGE_PRESSED : SC_OL_IMAGE_NOTPRESSED;
bool bClip = (nEntry != SC_OL_HEADERENTRY);
if ( bClip )
SetEntryAreaClipRegion();
- DrawImage( aPos, mpSymbols->GetImage( nId ) );
+ DrawImage( aPos, maSymbols.GetImage( nId ) );
if ( bClip )
SetClipRegion();
}