[Libreoffice-commits] core.git: 4 commits - framework/source include/tools include/vcl rsc/inc rsc/source svtools/source vcl/source

Caolán McNamara caolanm at redhat.com
Fri Dec 30 16:34:21 UTC 2016


 framework/source/uielement/controlmenucontroller.cxx |   73 ++++++++-----------
 include/tools/rc.h                                   |    9 --
 include/tools/rcid.h                                 |    1 
 include/vcl/image.hxx                                |    1 
 rsc/inc/rscdb.hxx                                    |    2 
 rsc/source/parser/rscdb.cxx                          |    2 
 rsc/source/parser/rscicpx.cxx                        |   30 -------
 rsc/source/parser/rscinit.cxx                        |    6 -
 svtools/source/graphic/provider.cxx                  |   20 -----
 vcl/source/image/ImageList.cxx                       |   37 ---------
 10 files changed, 32 insertions(+), 149 deletions(-)

New commits:
commit 73545e2efae49af7bdf1e7fd43ae0d68f3bb3225
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Dec 30 14:37:42 2016 +0000

    RscImageListFlags is newly unused
    
    Change-Id: Ic6ed613496ce1903f752ae3b6258121870f99558

diff --git a/include/tools/rc.h b/include/tools/rc.h
index c1da806..9ca1e8f 100644
--- a/include/tools/rc.h
+++ b/include/tools/rc.h
@@ -58,15 +58,6 @@ namespace o3tl {
     template<> struct typed_flags<RscImageFlags> : is_typed_flags<RscImageFlags, 0x01> {};
 }
 
-// For "ImageList":
-enum class RscImageListFlags {
-    IdList            = 0x08,
-    IdCount           = 0x10
-};
-namespace o3tl {
-    template<> struct typed_flags<RscImageListFlags> : is_typed_flags<RscImageListFlags, 0x18> {};
-}
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 70fb9e0f48d38d7fb01cb54dab7d5ed775f65d9c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Dec 30 14:36:46 2016 +0000

    aIdUShort is now unused
    
    Change-Id: I44c2748be879f083bc6ebb6c17e3a3a7038f8ad8

diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index d9654b0..133b7a8 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -102,7 +102,6 @@ public:
     RscRange            aShort;
     RscRange            aUShort;
     RscLongEnumRange    aEnumLong;
-    RscIdRange          aIdUShort;
     RscIdRange          aIdNoZeroUShort;
     RscString           aString;
     RscString           aStringLiteral;
diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx
index f9a7afa..bb0fecf 100644
--- a/rsc/source/parser/rscdb.cxx
+++ b/rsc/source/parser/rscdb.cxx
@@ -49,7 +49,6 @@ RscTypCont::RscTypCont( RscError * pErrHdl,
     , aShort( pHS->getID( "short" ), RSC_NOTYPE )
     , aUShort( pHS->getID( "sal_uInt16" ), RSC_NOTYPE )
     , aEnumLong( pHS->getID( "enum_long" ), RSC_NOTYPE )
-    , aIdUShort( pHS->getID( "IDUSHORT" ), RSC_NOTYPE )
     , aIdNoZeroUShort( pHS->getID( "IDUSHORT" ), RSC_NOTYPE )
     , aString( pHS->getID( "Chars" ), RSC_NOTYPE )
     , aStringLiteral( pHS->getID( "Chars" ), RSC_NOTYPE )
@@ -176,7 +175,6 @@ RscTypCont::~RscTypCont()
     aBool.Pre_dtor();
     aShort.Pre_dtor();
     aUShort.Pre_dtor();
-    aIdUShort.Pre_dtor();
     aIdNoZeroUShort.Pre_dtor();
     aString.Pre_dtor();
     aVersion.pClass->Pre_dtor();
diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx
index 60ade77..85023b8 100644
--- a/rsc/source/parser/rscinit.cxx
+++ b/rsc/source/parser/rscinit.cxx
@@ -76,8 +76,6 @@ void RscTypCont::Init()
 
     aEnumLong.SetRange( SAL_MIN_INT32, SAL_MAX_INT32 );
 
-    aIdUShort.SetRange( 0, 0xFFFF );
-
     aIdNoZeroUShort.SetRange( 1, 0xFFFF );
 }
 {
commit 21f934a7c54e6a62aac046b99e05bbcf394c4de4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Dec 30 14:35:24 2016 +0000

    ImageLists no longer loaded from resource files
    
    Change-Id: I5bf1c75dce7bc9af6aaa92447fab7239dff4b676

diff --git a/include/tools/rcid.h b/include/tools/rcid.h
index 924b3d2..708a0e1 100644
--- a/include/tools/rcid.h
+++ b/include/tools/rcid.h
@@ -41,7 +41,6 @@
 #define RSC_MENUITEM            (RSC_NOTYPE + 0x1d) // only used internally
 #define RSC_KEYCODE             (RSC_NOTYPE + 0x1f)
 #define RSC_IMAGE               (RSC_NOTYPE + 0x23)
-#define RSC_IMAGELIST           (RSC_NOTYPE + 0x24)
 
 #define RSC_STRINGARRAY         (RSC_NOTYPE + 0x79)
 
diff --git a/include/vcl/image.hxx b/include/vcl/image.hxx
index a571fab..f6ed44a 100644
--- a/include/vcl/image.hxx
+++ b/include/vcl/image.hxx
@@ -75,7 +75,6 @@ class VCL_DLLPUBLIC ImageList
 {
 public:
                     explicit ImageList();
-                    explicit ImageList( const ResId& rResId );
                     ImageList( const std::vector<OUString>& rNameVector,
                                const OUString& rPrefix);
 
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index 695c9c3..d9654b0 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -93,7 +93,6 @@ class RscTypCont
     RscTop *    InitClassString( RscTop * pSuper );
     RscTop *    InitClassBitmap( RscTop * pSuper );
     RscTop *    InitClassImage( RscTop * pSuper, RscTop *pClassBitmap );
-    RscTop *    InitClassImageList( RscTop * pSuper, RscCont * pStrLst );
     RscTop *    InitClassKeyCode( RscTop * pSuper, RscEnum * pKey );
     RscTop *    InitClassMenuItem( RscTop * pSuper );
     RscTop *    InitClassMenu( RscTop * pSuper, RscTop * pMenuItem );
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index 05a6920..0a7e476 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -115,36 +115,6 @@ RscTop * RscTypCont::InitClassImage( RscTop * pSuper, RscTop * pClassBitmap )
     return pClassImage;
 }
 
-RscTop * RscTypCont::InitClassImageList( RscTop * pSuper, RscCont * pStrLst )
-{
-    Atom        nId;
-    RscTop *    pClassImageList;
-
-    // initialize class
-    nId = pHS->getID( "ImageList" );
-    pClassImageList = new RscClass( nId, RSC_IMAGELIST, pSuper );
-    pClassImageList->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType );
-    aNmTb.Put( nId, CLASSNAME, pClassImageList );
-
-    nId = aNmTb.Put( "Prefix", VARNAME );
-    pClassImageList->SetVariable( nId, &aString );
-
-    RscCont * pCont = new RscCont( pHS->getID( "sal_uInt16 *" ), RSC_NOTYPE );
-    pCont->SetTypeClass( &aIdUShort );
-    aBaseLst.push_back( pCont );
-    nId = aNmTb.Put( "IdList", VARNAME );
-    pClassImageList->SetVariable( nId, pCont, nullptr, RSCVAR::NONE,
-                                      (sal_uInt32)RscImageListFlags::IdList );
-
-    nId = aNmTb.Put( "FileList", VARNAME );
-    pClassImageList->SetVariable( nId, pStrLst );
-
-    nId = aNmTb.Put( "IdCount", VARNAME );
-    pClassImageList->SetVariable( nId, &aUShort, nullptr, RSCVAR::NONE,
-                                  (sal_uInt32)RscImageListFlags::IdCount );
-    return pClassImageList;
-}
-
 RscTop * RscTypCont::InitClassKeyCode( RscTop * pSuper, RscEnum * pKey )
 {
     Atom        nId;
diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx
index 18b96a8..60ade77 100644
--- a/rsc/source/parser/rscinit.cxx
+++ b/rsc/source/parser/rscinit.cxx
@@ -50,7 +50,6 @@ void RscTypCont::Init()
     RscTop   *  pClassStringArray;
     RscTop   *  pClassBitmap;
     RscTop   *  pClassImage;
-    RscTop   *  pClassImageList;
     RscTop   *  pClassKeyCode;
 
     Atom        nId;
@@ -121,9 +120,6 @@ void RscTypCont::Init()
 {
     pClassImage = InitClassImage( pClassMgr, pClassBitmap );
     pRoot->Insert( pClassImage );
-
-    pClassImageList = InitClassImageList( pClassMgr, pStringLongTupelList );
-    pRoot->Insert( pClassImageList );
 }
 {
     pClassKeyCode = InitClassKeyCode( pClassMgr, pKey );
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index 908d816..3666fdc 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -294,26 +294,6 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadResource( const O
                         aBmpEx = aImage.GetBitmapEx();
                     }
                 }
-                else if( aResourceType == "imagelist" )
-                {
-                    aResId.SetRT( RSC_IMAGELIST );
-
-                    if( pResMgr->IsAvailable( aResId ) )
-                    {
-                        const ImageList aImageList( aResId );
-                        sal_Int32       nImageId = ( nIndex > -1 ) ? rResourceURL.getToken( 0, '/', nIndex ).toInt32() : 0;
-
-                        if( 0 < nImageId )
-                        {
-                            const Image aImage( aImageList.GetImage( sal::static_int_cast< sal_uInt16 >(nImageId) ) );
-                            aBmpEx = aImage.GetBitmapEx();
-                        }
-                        else
-                        {
-                            aBmpEx = aImageList.GetAsHorizontalStrip();
-                        }
-                    }
-                }
 
                 if( !aBmpEx.IsEmpty() )
                 {
diff --git a/vcl/source/image/ImageList.cxx b/vcl/source/image/ImageList.cxx
index 57eaf89..748e19d 100644
--- a/vcl/source/image/ImageList.cxx
+++ b/vcl/source/image/ImageList.cxx
@@ -37,43 +37,6 @@ ImageList::ImageList()
 {
 }
 
-ImageList::ImageList(const ResId& rResId)
-{
-    SAL_INFO( "vcl", "vcl: ImageList::ImageList( const ResId& rResId )" );
-
-    rResId.SetRT( RSC_IMAGELIST );
-
-    ResMgr* pResMgr = rResId.GetResMgr();
-
-    if( pResMgr && pResMgr->GetResource( rResId ) )
-    {
-        pResMgr->Increment( sizeof( RSHEADER_TYPE ) );
-
-        RscImageListFlags nObjMask = (RscImageListFlags)pResMgr->ReadLong();
-        pResMgr->ReadString(); //skip string
-
-        if( nObjMask & RscImageListFlags::IdList )
-        {
-            for( sal_Int32 i = 0, nCount = pResMgr->ReadLong(); i < nCount; ++i )
-                pResMgr->ReadLong();
-        }
-
-        sal_Int32 nCount = pResMgr->ReadLong();
-        ImplInit( static_cast< sal_uInt16 >( nCount ), Size() );
-
-        BitmapEx aEmpty;
-        for( sal_Int32 i = 0; i < nCount; ++i )
-        {
-            OUString aName = pResMgr->ReadString();
-            sal_uInt16 nId = static_cast< sal_uInt16 >( pResMgr->ReadLong() );
-            mpImplData->AddImage( aName, nId, aEmpty );
-        }
-
-        if( nObjMask & RscImageListFlags::IdCount )
-            pResMgr->ReadShort();
-    }
-}
-
 ImageList::ImageList(const std::vector< OUString >& rNameVector,
                      const OUString& rPrefix)
 {
commit 3ff74ff16b43cccf86cfd56c1f6b7ce30ce0b65d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Dec 30 14:29:33 2016 +0000

    hidden use of removed RID_SVXIMGLIST_FMEXPL resource
    
    Change-Id: I23c64f0071640cb9946340151b7648f47894a113

diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx
index 8035f20..c9092644 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -45,11 +45,11 @@
 #include <memory>
 
 #include "svx/svxids.hrc"
+#include "svx/fmresids.hrc"
 
 // Copied from svx
 // Function-Id's
 #define RID_FMSHELL_CONVERSIONMENU (RID_FORMS_START + 4)
-#define RID_SVXIMGLIST_FMEXPL      (RID_FORMS_START + 0)
 
 static const sal_Int16 nConvertSlots[] =
 {
@@ -61,7 +61,6 @@ static const sal_Int16 nConvertSlots[] =
     SID_FM_CONVERTTO_RADIOBUTTON,
     SID_FM_CONVERTTO_GROUPBOX,
     SID_FM_CONVERTTO_COMBOBOX,
-//  SID_FM_CONVERTTO_GRID,
     SID_FM_CONVERTTO_IMAGEBUTTON,
     SID_FM_CONVERTTO_FILECONTROL,
     SID_FM_CONVERTTO_DATE,
@@ -75,30 +74,6 @@ static const sal_Int16 nConvertSlots[] =
     SID_FM_CONVERTTO_SPINBUTTON
 };
 
-static const sal_Int16 nCreateSlots[] =
-{
-    SID_FM_EDIT,
-    SID_FM_PUSHBUTTON,
-    SID_FM_FIXEDTEXT,
-    SID_FM_LISTBOX,
-    SID_FM_CHECKBOX,
-    SID_FM_RADIOBUTTON,
-    SID_FM_GROUPBOX,
-    SID_FM_COMBOBOX,
-//  SID_FM_DBGRID,
-    SID_FM_IMAGEBUTTON,
-    SID_FM_FILECONTROL,
-    SID_FM_DATEFIELD,
-    SID_FM_TIMEFIELD,
-    SID_FM_NUMERICFIELD,
-    SID_FM_CURRENCYFIELD,
-    SID_FM_PATTERNFIELD,
-    SID_FM_IMAGECONTROL,
-    SID_FM_FORMATTEDFIELD,
-    SID_FM_SCROLLBAR,
-    SID_FM_SPINBUTTON
-};
-
 static const char* aCommands[] =
 {
     ".uno:ConvertToEdit",
@@ -109,7 +84,6 @@ static const char* aCommands[] =
     ".uno:ConvertToRadio",
     ".uno:ConvertToGroup",
     ".uno:ConvertToCombo",
-//    ".uno:ConvertToGrid",
     ".uno:ConvertToImageBtn",
     ".uno:ConvertToFileControl",
     ".uno:ConvertToDate",
@@ -123,6 +97,30 @@ static const char* aCommands[] =
     ".uno:ConvertToSpinButton"
 };
 
+static const sal_Int16 nImgIds[] =
+{
+    RID_SVXBMP_EDITBOX,
+    RID_SVXBMP_BUTTON,
+    RID_SVXBMP_FIXEDTEXT,
+    RID_SVXBMP_LISTBOX,
+    RID_SVXBMP_CHECKBOX,
+    RID_SVXBMP_RADIOBUTTON,
+    RID_SVXBMP_GROUPBOX,
+    RID_SVXBMP_COMBOBOX,
+    RID_SVXBMP_IMAGEBUTTON,
+    RID_SVXBMP_FILECONTROL,
+    RID_SVXBMP_DATEFIELD,
+    RID_SVXBMP_TIMEFIELD,
+    RID_SVXBMP_NUMERICFIELD,
+    RID_SVXBMP_CURRENCYFIELD,
+    RID_SVXBMP_PATTERNFIELD,
+    RID_SVXBMP_IMAGECONTROL,
+    RID_SVXBMP_FORMATTEDFIELD,
+    RID_SVXBMP_SCROLLBAR,
+    RID_SVXBMP_SPINBUTTON,
+    RID_SVXBMP_NAVIGATIONBAR
+};
+
 using namespace css;
 using namespace css::uno;
 using namespace css::lang;
@@ -206,21 +204,14 @@ ControlMenuController::ControlMenuController( const css::uno::Reference< css::un
 // private function
 void ControlMenuController::updateImagesPopupMenu( PopupMenu* pPopupMenu )
 {
-    std::unique_ptr<ResMgr> pResMgr(ResMgr::CreateResMgr("svx", Application::GetSettings().GetUILanguageTag()));
-    ResId aResId( RID_SVXIMGLIST_FMEXPL, *pResMgr );
-    aResId.SetRT( RSC_IMAGELIST );
-
-    if ( pResMgr->IsAvailable( aResId ))
+    std::unique_ptr<ResMgr> xResMgr(ResMgr::CreateResMgr("svx", Application::GetSettings().GetUILanguageTag()));
+    for (sal_uInt32 i=0; i < SAL_N_ELEMENTS(nConvertSlots); ++i)
     {
-        ImageList aImageList( aResId );
-        for ( sal_uInt32 i=0; i < SAL_N_ELEMENTS(nConvertSlots); ++i )
-        {
-            // das entsprechende Image dran
-            if ( m_bShowMenuImages )
-                pPopupMenu->SetItemImage( nConvertSlots[i], aImageList.GetImage(nCreateSlots[i]));
-            else
-                pPopupMenu->SetItemImage( nConvertSlots[i], Image() );
-        }
+        ResId aResId(nImgIds[i], *xResMgr);
+        if (m_bShowMenuImages && xResMgr->IsAvailable(aResId))
+            pPopupMenu->SetItemImage(nConvertSlots[i], Image(BitmapEx(aResId)));
+        else
+            pPopupMenu->SetItemImage(nConvertSlots[i], Image());
     }
 }
 


More information about the Libreoffice-commits mailing list