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

Noel Grandin noelgrandin at gmail.com
Mon May 16 09:19:41 UTC 2016


 include/tools/rc.h            |    4 ---
 include/tools/rcid.h          |    1 
 include/vcl/accel.hxx         |    5 ---
 rsc/inc/rscdb.hxx             |    1 
 rsc/source/parser/rscicpx.cxx |   23 -----------------
 rsc/source/parser/rscinit.cxx |   13 ---------
 vcl/source/window/accel.cxx   |   55 ------------------------------------------
 7 files changed, 102 deletions(-)

New commits:
commit d9bdc157b43ce412ad4689ee78b81068b1224d30
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Sun May 15 12:35:32 2016 +0200

    remove ACCELITEM stuff from rsc
    
    Change-Id: I97dade0324edfb2d67ee33ef07498166b499c13c
    Reviewed-on: https://gerrit.libreoffice.org/25003
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/tools/rc.h b/include/tools/rc.h
index 1aed995..97e17fb 100644
--- a/include/tools/rc.h
+++ b/include/tools/rc.h
@@ -88,10 +88,6 @@ namespace o3tl {
     template<> struct typed_flags<RscMenuItem> : is_typed_flags<RscMenuItem, 0xd7f> {};
 }
 
-// "AccelKey" resource options:
-#define ACCELITEM_ACCEL                 0x01
-#define ACCELITEM_KEY                   0x02
-
 // For "Field" resources:
 
 enum class RscNumFormatterFlags {
diff --git a/include/tools/rcid.h b/include/tools/rcid.h
index 122c48e..492e078 100644
--- a/include/tools/rcid.h
+++ b/include/tools/rcid.h
@@ -37,7 +37,6 @@
 #define RSC_STRING              (RSC_NOTYPE + 0x11)
 #define RSC_BITMAP              (RSC_NOTYPE + 0x13)
 #define RSC_ACCEL               (RSC_NOTYPE + 0x1a)
-#define RSC_ACCELITEM           (RSC_NOTYPE + 0x1b) // only used internally
 #define RSC_MENU                (RSC_NOTYPE + 0x1c)
 #define RSC_MENUITEM            (RSC_NOTYPE + 0x1d) // only used internally
 #define RSC_KEYCODE             (RSC_NOTYPE + 0x1f)
diff --git a/include/vcl/accel.hxx b/include/vcl/accel.hxx
index 7e96580..f34b443 100644
--- a/include/vcl/accel.hxx
+++ b/include/vcl/accel.hxx
@@ -58,20 +58,15 @@ private:
     SAL_DLLPRIVATE  ImplAccelEntry*
                             ImplGetAccelData( const vcl::KeyCode& rKeyCode ) const;
 
-protected:
-    SAL_DLLPRIVATE  void    ImplLoadRes( const ResId& rResId );
-
 public:
                             Accelerator();
                             Accelerator( const Accelerator& rAccel );
-                            Accelerator( const ResId& rResId );
     virtual                 ~Accelerator();
 
     void                    Activate();
     void                    Select();
 
     void                    InsertItem( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode );
-    void                    InsertItem( const ResId& rResId );
 
     sal_uInt16              GetCurItemId() const { return mnCurId; }
     const vcl::KeyCode&     GetCurKeyCode() const { return maCurKeyCode; }
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index d6a2408..a1dc47a 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -194,7 +194,6 @@ class RscTypCont
     RscTop *    InitClassFixedImage( RscTop * pSuper, RscTop * pClassImage );
     RscTop *    InitClassRadioButton( RscTop * pSuper );
     RscTop *    InitClassKeyCode( RscTop * pSuper, RscEnum * pKey );
-    RscTop *    InitClassAccelItem( RscTop * pSuper, RscTop * pKeyCode );
     RscTop *    InitClassAccel( RscTop * pSuper, RscTop * pClassAccelItem );
     RscTop *    InitClassMenuItem( RscTop * pSuper, RscTop * pClassBitmap );
     RscTop *    InitClassMenu( RscTop * pSuper, RscTop * pMenuItem );
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index 9bd53b5..1e07291 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -665,29 +665,6 @@ RscTop * RscTypCont::InitClassKeyCode( RscTop * pSuper, RscEnum * pKey )
     return pClassKeyCode;
 }
 
-RscTop * RscTypCont::InitClassAccelItem( RscTop * pSuper,
-                                         RscTop * pClassKeyCode )
-{
-    Atom        nId;
-    RscTop *    pClassAccelItem;
-
-    // initialize class
-    nId = pHS->getID( "AcceleratorItem" );
-    pClassAccelItem = new RscClass( nId, RSC_ACCELITEM, pSuper );
-    aNmTb.Put( nId, CLASSNAME, pClassAccelItem );
-
-    // initialize variables
-    nId = aNmTb.Put( "Identifier", VARNAME );
-    pClassAccelItem->SetVariable( nId, &aIdNoZeroUShort );
-    nId = aNmTb.Put( "Disable", VARNAME );
-    pClassAccelItem->SetVariable( nId, &aBool );
-    nId = aNmTb.Put( "Key", VARNAME );
-    pClassAccelItem->SetVariable( nId, pClassKeyCode, nullptr, 0,
-                                  ACCELITEM_KEY );
-
-    return pClassAccelItem;
-}
-
 RscTop * RscTypCont::InitClassAccel( RscTop * pSuper, RscTop * pClassAccelItem )
 {
     Atom        nId;
diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx
index e7a55ac..eb02f71 100644
--- a/rsc/source/parser/rscinit.cxx
+++ b/rsc/source/parser/rscinit.cxx
@@ -79,9 +79,7 @@ void RscTypCont::Init()
     RscTop   *  pClassFixedImage;
     RscTop   *  pClassKeyCode;
     RscTop   *  pLangClassKeyCode;
-    RscTop   *  pClassAccelItem;
     RscTop   *  pClassSpinField;
-    RscTop   *  pClassAccel;
 
     Atom        nId;
 
@@ -356,19 +354,8 @@ void RscTypCont::Init()
     aBaseLst.push_back( pLangClassKeyCode );
     }
 
-    pClassAccelItem = InitClassAccelItem( pClassMgr, pLangClassKeyCode );
-    pRoot->Insert( pClassAccelItem );
 }
 {
-    pClassAccel = InitClassAccel( pClassMgr, pClassAccelItem );
-    pRoot->Insert( pClassAccel );
-    nAcceleratorType = pClassAccel->GetId();
-
-    // pClassAccel is only completely defined here
-    nId = aNmTb.Put( "SubAccelerator", VARNAME );
-    pClassAccelItem->SetVariable( nId, pClassAccel, nullptr, VAR_SVDYNAMIC,
-                               ACCELITEM_ACCEL );
-
     RscTop* pClassMenuItem = InitClassMenuItem( pClassMgr, pClassBitmap);
     pRoot->Insert( pClassMenuItem );
 
diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx
index 9e62503..01d75c7 100644
--- a/vcl/source/window/accel.cxx
+++ b/vcl/source/window/accel.cxx
@@ -263,29 +263,6 @@ Accelerator::Accelerator( const Accelerator& rAccel ) :
     ImplCopyData(*rAccel.mpData);
 }
 
-Accelerator::Accelerator( const ResId& rResId )
-{
-
-    ImplInit();
-    mpData = new ImplAccelData;
-    rResId.SetRT( RSC_ACCEL );
-    ImplLoadRes( rResId );
-}
-
-void Accelerator::ImplLoadRes( const ResId& rResId )
-{
-    GetRes( rResId );
-
-    maHelpStr = ReadStringRes();
-    sal_uLong nObjFollows = ReadLongRes();
-
-    for( sal_uLong i = 0; i < nObjFollows; i++ )
-    {
-        InsertItem( ResId( static_cast<RSHEADER_TYPE *>(GetClassRes()), *rResId.GetResMgr() ) );
-        IncrementRes( GetObjSizeRes( static_cast<RSHEADER_TYPE *>(GetClassRes()) ) );
-    }
-}
-
 Accelerator::~Accelerator()
 {
 
@@ -312,38 +289,6 @@ void Accelerator::InsertItem( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode )
     ImplInsertAccel( nItemId, rKeyCode, true, nullptr );
 }
 
-void Accelerator::InsertItem( const ResId& rResId )
-{
-
-    sal_uLong               nObjMask;
-    sal_uInt16              nAccelKeyId;
-    sal_uInt16              bDisable;
-    vcl::KeyCode            aKeyCode;
-    Accelerator*        pAutoAccel  = nullptr;
-
-    GetRes( rResId.SetRT( RSC_ACCELITEM ) );
-    nObjMask        = ReadLongRes();
-    nAccelKeyId     = sal::static_int_cast<sal_uInt16>(ReadLongRes());
-    bDisable        = ReadShortRes();
-
-    if ( nObjMask & ACCELITEM_KEY )
-    {
-        // new context was created
-        RSHEADER_TYPE * pKeyCodeRes = static_cast<RSHEADER_TYPE *>(GetClassRes());
-        ResId aResId( pKeyCodeRes, *rResId.GetResMgr());
-        aKeyCode = vcl::KeyCode( aResId );
-        IncrementRes( GetObjSizeRes( static_cast<RSHEADER_TYPE *>(GetClassRes()) ) );
-    }
-
-    if ( nObjMask & ACCELITEM_ACCEL )
-    {
-        pAutoAccel = new Accelerator( ResId( static_cast<RSHEADER_TYPE *>(GetClassRes()), *rResId.GetResMgr() ) );
-        IncrementRes( GetObjSizeRes( static_cast<RSHEADER_TYPE *>(GetClassRes()) ) );
-    }
-
-    ImplInsertAccel( nAccelKeyId, aKeyCode, !bDisable, pAutoAccel );
-}
-
 sal_uInt16 Accelerator::GetItemCount() const
 {
 


More information about the Libreoffice-commits mailing list