Kaydet (Commit) 9c76f393 authored tarafından Caolán McNamara's avatar Caolán McNamara

manage OutlineBitmap imagelist directly in its owner user

Change-Id: I4437484192016db7ce72614ae07c5a7d1bd9ec5b
üst 96d0506f
......@@ -505,8 +505,6 @@ class ScGlobal
static SvxBrushItem* pEmbeddedBrushItem;
static SvxBrushItem* pProtectedBrushItem;
static ImageList* pOutlineBitmaps;
static ScFunctionList* pStarCalcFunctionList;
static ScFunctionMgr* pStarCalcFunctionMgr;
......@@ -589,9 +587,6 @@ public:
static SvxBrushItem* GetProtectedBrushItem() { return pProtectedBrushItem; }
SC_DLLPUBLIC static const OUString& GetEmptyOUString();
/** Returns the specified image list with outline symbols. */
static ImageList* GetOutlineSymbols();
static bool HasStarCalcFunctionList();
static ScFunctionList* GetStarCalcFunctionList();
static ScFunctionMgr* GetStarCalcFunctionMgr();
......
......@@ -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);
......
......@@ -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.
......
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment