[Libreoffice-commits] core.git: 2 commits - basctl/inc basctl/source sc/inc sc/source

Caolán McNamara caolanm at redhat.com
Mon Dec 12 12:34:04 UTC 2016


 basctl/inc/basidesh.hrc             |    6 ++++--
 basctl/source/basicide/baside2.hrc  |    6 ------
 basctl/source/basicide/baside2b.cxx |    9 ++++-----
 basctl/source/basicide/basidesh.src |   27 ++++++++++++++++++---------
 sc/inc/global.hxx                   |    5 -----
 sc/source/core/data/global.cxx      |   11 -----------
 sc/source/ui/inc/olinewin.hxx       |    2 +-
 sc/source/ui/view/olinewin.cxx      |   10 ++++------
 8 files changed, 31 insertions(+), 45 deletions(-)

New commits:
commit 9c76f393431bb38259ec5465393ec86da026399e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 12 12:16:20 2016 +0000

    manage OutlineBitmap imagelist directly in its owner user
    
    Change-Id: I4437484192016db7ce72614ae07c5a7d1bd9ec5b

diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 5c1bc6a..1761e2f 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -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();
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 68d1d83..2d5c3ad 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 904ea1d..7c9f09a 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 57b1fea..c332835 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();
     }
commit 96d0506fceb8064c5ae156dfaf12d5b45623c557
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 12 12:11:05 2016 +0000

    unwind RID_IMGLST_LAYOUT imagelist
    
    Change-Id: I17146905c93162977effe9179c844ba691320d35

diff --git a/basctl/inc/basidesh.hrc b/basctl/inc/basidesh.hrc
index 7f21dc6c..738540b 100644
--- a/basctl/inc/basidesh.hrc
+++ b/basctl/inc/basidesh.hrc
@@ -38,7 +38,6 @@
 #define RID_IMG_DLGLIBNOTLOADED         ( RID_BASICIDE_START + 34 )
 #define RID_IMG_DIALOG                  ( RID_BASICIDE_START + 36 )
 #define RID_IMG_LOCKED                  ( RID_BASICIDE_START + 41 )
-#define RID_IMGLST_LAYOUT               ( RID_BASICIDE_START + 49 )
 
 #define RID_STR_SEARCHALLMODULES        ( RID_BASICIDE_START +  1 )
 #define RID_STR_SEARCHFROMSTART         ( RID_BASICIDE_START +  2 )
@@ -141,8 +140,11 @@
 #define RID_STR_USERFORMS               ( RID_BASICIDE_START + 119 )
 #define RID_STR_NORMAL_MODULES          ( RID_BASICIDE_START + 120 )
 #define RID_STR_CLASS_MODULES           ( RID_BASICIDE_START + 121 )
+#define RID_BMP_BRKENABLED              ( SID_BASICIDE_START + 122 )
+#define RID_BMP_BRKDISABLED             ( SID_BASICIDE_START + 123 )
+#define RID_BMP_STEPMARKER              ( SID_BASICIDE_START + 124 )
+#define RID_BMP_ERRORMARKER             ( SID_BASICIDE_START + 125 )
 //free slots
-
 #define RID_STR_PRINTDLG_RANGE          ( RID_BASICIDE_START + 130 )
 #define RID_STR_PRINTDLG_ALLPAGES       ( RID_BASICIDE_START + 131 )
 #define RID_STR_PRINTDLG_PAGES          ( RID_BASICIDE_START + 132 )
diff --git a/basctl/source/basicide/baside2.hrc b/basctl/source/basicide/baside2.hrc
index bdb5019..e208d0f 100644
--- a/basctl/source/basicide/baside2.hrc
+++ b/basctl/source/basicide/baside2.hrc
@@ -33,12 +33,6 @@
 // RID_POPUP_TABBAR
 #define RID_INSERT              1
 
-// ModulWindowLayout
-#define IMGID_BRKENABLED        ( SID_BASICIDE_IMAGESTART + 20 )
-#define IMGID_BRKDISABLED       ( SID_BASICIDE_IMAGESTART + 21 )
-#define IMGID_STEPMARKER        ( SID_BASICIDE_IMAGESTART + 22 )
-#define IMGID_ERRORMARKER       ( SID_BASICIDE_IMAGESTART + 23 )
-
 #endif // BASCTL_BASIDE2_HRC
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 2ae1b95..a8c6d9f 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -76,8 +76,7 @@ SbxVariable* IsSbxVariable (SbxBase* pBase)
 
 Image GetImage (unsigned nId)
 {
-    static ImageList const aImagesNormal(IDEResId(RID_IMGLST_LAYOUT));
-    return aImagesNormal.GetImage(nId);
+    return Image(BitmapEx(IDEResId(nId)));
 }
 
 int const nScrollLine = 12;
@@ -1352,8 +1351,8 @@ void BreakPointWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle
 
     Image const aBrk[2] =
     {
-        GetImage(IMGID_BRKDISABLED),
-        GetImage(IMGID_BRKENABLED)
+        GetImage(RID_BMP_BRKDISABLED),
+        GetImage(RID_BMP_BRKENABLED)
     };
 
     Size const aBmpSz = rRenderContext.PixelToLogic(aBrk[1].GetSizePixel());
@@ -1379,7 +1378,7 @@ void BreakPointWindow::ShowMarker(vcl::RenderContext& rRenderContext)
     Size const aOutSz = GetOutputSize();
     long const nLineHeight = GetTextHeight();
 
-    Image aMarker = GetImage(bErrorMarker ? IMGID_ERRORMARKER : IMGID_STEPMARKER);
+    Image aMarker = GetImage(bErrorMarker ? RID_BMP_ERRORMARKER : RID_BMP_STEPMARKER);
 
     Size aMarkerSz(aMarker.GetSizePixel());
     aMarkerSz = rRenderContext.PixelToLogic(aMarkerSz);
diff --git a/basctl/source/basicide/basidesh.src b/basctl/source/basicide/basidesh.src
index 133f699..88ba620 100644
--- a/basctl/source/basicide/basidesh.src
+++ b/basctl/source/basicide/basidesh.src
@@ -422,17 +422,26 @@ Menu RID_POPUP_TABBAR
     };
 };
 
-ImageList RID_IMGLST_LAYOUT
+Bitmap RID_BMP_BRKENABLED
 {
-    Prefix = "im";
-    IdList =
-    {
-        IMGID_BRKENABLED ;
-        IMGID_BRKDISABLED ;
-        IMGID_STEPMARKER ;
-        IMGID_ERRORMARKER ;
-    };
+    File = "im30820.png";
+};
+
+Bitmap RID_BMP_BRKDISABLED
+{
+    File = "im30821.png";
+};
+
+Bitmap RID_BMP_STEPMARKER
+{
+    File = "im30822.png";
+};
+
+Bitmap RID_BMP_ERRORMARKER
+{
+    File = "im30823.png";
 };
+
 Image RID_IMG_LOCKED
 {
     ImageBitmap = Bitmap { File = "lock.png" ; };


More information about the Libreoffice-commits mailing list