Commits

Anonymous committed e7d12d3

vcl122: #i117746# remove completely unused KeyboardSettings

Comments (0)

Files changed (2)

vcl/inc/vcl/settings.hxx

                                         { return !(*this == rSet); }
 };
 
-// --------------------
-// - ImplKeyboardData -
-// --------------------
-
-class ImplKeyboardData
-{
-    friend class KeyboardSettings;
-
-                                    ImplKeyboardData();
-                                    ImplKeyboardData( const ImplKeyboardData& rData );
-
-private:
-    sal_uLong                           mnRefCount;
-    Accelerator                     maStandardAccel;
-    sal_uLong                           mnOptions;
-};
-
-// --------------------
-// - KeyboardSettings -
-// --------------------
-
-#define KEYBOARD_OPTION_QUICKCURSOR ((sal_uLong)0x00000001)
-
-class VCL_DLLPUBLIC KeyboardSettings
-{
-    void                            CopyData();
-
-private:
-    ImplKeyboardData*               mpData;
-
-public:
-                                    KeyboardSettings();
-                                    KeyboardSettings( const KeyboardSettings& rSet );
-                                    ~KeyboardSettings();
-
-    void                            SetStandardAccel( const Accelerator& rAccelerator )
-                                        { CopyData(); mpData->maStandardAccel = rAccelerator; }
-    const Accelerator&              GetStandardAccel() const
-                                        { return mpData->maStandardAccel; }
-
-    void                            SetOptions( sal_uLong nOptions )
-                                        { CopyData(); mpData->mnOptions = nOptions; }
-    sal_uLong                           GetOptions() const
-                                        { return mpData->mnOptions; }
-
-    const KeyboardSettings&         operator =( const KeyboardSettings& rSet );
-
-    sal_Bool                            operator ==( const KeyboardSettings& rSet ) const;
-    sal_Bool                            operator !=( const KeyboardSettings& rSet ) const
-                                        { return !(*this == rSet); }
-};
-
 // -----------------
 // - ImplStyleData -
 // -----------------
     sal_uLong                                   mnRefCount;
     MachineSettings                         maMachineSettings;
     MouseSettings                           maMouseSettings;
-    KeyboardSettings                        maKeyboardSettings;
     StyleSettings                           maStyleSettings;
     MiscSettings                            maMiscSettings;
     NotificationSettings                    maNotificationSettings;
 
 #define SETTINGS_MACHINE            ((sal_uLong)0x00000001)
 #define SETTINGS_MOUSE              ((sal_uLong)0x00000002)
-#define SETTINGS_KEYBOARD           ((sal_uLong)0x00000004)
+// #define SETTINGS_KEYBOARD           ((sal_uLong)0x00000004)
 #define SETTINGS_STYLE              ((sal_uLong)0x00000008)
 #define SETTINGS_MISC               ((sal_uLong)0x00000010)
 #define SETTINGS_SOUND              ((sal_uLong)0x00000020)
 #define SETTINGS_LOCALE             ((sal_uLong)0x00000200)
 #define SETTINGS_UILOCALE           ((sal_uLong)0x00000400)
 #define SETTINGS_ALLSETTINGS        (SETTINGS_MACHINE |\
-                                     SETTINGS_MOUSE | SETTINGS_KEYBOARD |\
+                                     SETTINGS_MOUSE |\
                                      SETTINGS_STYLE | SETTINGS_MISC |\
                                      SETTINGS_SOUND | SETTINGS_NOTIFICATION |\
                                      SETTINGS_HELP |\
     const MouseSettings&                    GetMouseSettings() const
                                                 { return mpData->maMouseSettings; }
 
-    void                                    SetKeyboardSettings( const KeyboardSettings& rSet )
-                                                { CopyData(); mpData->maKeyboardSettings = rSet; }
-    const KeyboardSettings&                 GetKeyboardSettings() const
-                                                { return mpData->maKeyboardSettings; }
-
     void                                    SetStyleSettings( const StyleSettings& rSet )
                                                 { CopyData(); mpData->maStyleSettings = rSet; }
     const StyleSettings&                    GetStyleSettings() const

vcl/source/app/settings.cxx

 
 // =======================================================================
 
-ImplKeyboardData::ImplKeyboardData()
-{
-    mnRefCount                  = 1;
-    mnOptions                   = 0;
-}
-
-// -----------------------------------------------------------------------
-
-ImplKeyboardData::ImplKeyboardData( const ImplKeyboardData& rData )
-{
-    mnRefCount                  = 1;
-    mnOptions                   = rData.mnOptions;
-}
-
-// -----------------------------------------------------------------------
-
-KeyboardSettings::KeyboardSettings()
-{
-    mpData = new ImplKeyboardData();
-}
-
-// -----------------------------------------------------------------------
-
-KeyboardSettings::KeyboardSettings( const KeyboardSettings& rSet )
-{
-    DBG_ASSERT( rSet.mpData->mnRefCount < 0xFFFFFFFE, "KeyboardSettings: RefCount overflow" );
-
-    // shared Instance Daten uebernehmen und Referenzcounter erhoehen
-    mpData = rSet.mpData;
-    mpData->mnRefCount++;
-}
-
-// -----------------------------------------------------------------------
-
-KeyboardSettings::~KeyboardSettings()
-{
-    // Daten loeschen, wenn letzte Referenz
-    if ( mpData->mnRefCount == 1 )
-        delete mpData;
-    else
-        mpData->mnRefCount--;
-}
-
-// -----------------------------------------------------------------------
-
-const KeyboardSettings& KeyboardSettings::operator =( const KeyboardSettings& rSet )
-{
-    DBG_ASSERT( rSet.mpData->mnRefCount < 0xFFFFFFFE, "KeyboardSettings: RefCount overflow" );
-
-    // Zuerst Referenzcounter erhoehen, damit man sich selbst zuweisen kann
-    rSet.mpData->mnRefCount++;
-
-    // Daten loeschen, wenn letzte Referenz
-    if ( mpData->mnRefCount == 1 )
-        delete mpData;
-    else
-        mpData->mnRefCount--;
-
-    mpData = rSet.mpData;
-
-    return *this;
-}
-
-// -----------------------------------------------------------------------
-
-void KeyboardSettings::CopyData()
-{
-    // Falls noch andere Referenzen bestehen, dann kopieren
-    if ( mpData->mnRefCount != 1 )
-    {
-        mpData->mnRefCount--;
-        mpData = new ImplKeyboardData( *mpData );
-    }
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool KeyboardSettings::operator ==( const KeyboardSettings& rSet ) const
-{
-    if ( mpData == rSet.mpData )
-        return sal_True;
-
-    if ( (mpData->mnOptions             == rSet.mpData->mnOptions) )
-        return sal_True;
-    else
-        return sal_False;
-}
-
-// =======================================================================
-
 ImplStyleData::ImplStyleData()
 {
     mnRefCount                  = 1;
 
 ImplAllSettingsData::ImplAllSettingsData( const ImplAllSettingsData& rData ) :
     maMouseSettings( rData.maMouseSettings ),
-    maKeyboardSettings( rData.maKeyboardSettings ),
     maStyleSettings( rData.maStyleSettings ),
     maMiscSettings( rData.maMiscSettings ),
     maNotificationSettings( rData.maNotificationSettings ),
         }
     }
 
-    if ( nFlags & SETTINGS_KEYBOARD )
-    {
-        if ( mpData->maKeyboardSettings != rSet.mpData->maKeyboardSettings )
-        {
-            CopyData();
-            mpData->maKeyboardSettings = rSet.mpData->maKeyboardSettings;
-            nChangeFlags |= SETTINGS_KEYBOARD;
-        }
-    }
-
     if ( nFlags & SETTINGS_STYLE )
     {
         if ( mpData->maStyleSettings != rSet.mpData->maStyleSettings )
     if ( mpData->maMouseSettings != rSet.mpData->maMouseSettings )
         nChangeFlags |= SETTINGS_MOUSE;
 
-    if ( mpData->maKeyboardSettings != rSet.mpData->maKeyboardSettings )
-        nChangeFlags |= SETTINGS_KEYBOARD;
-
     if ( mpData->maStyleSettings != rSet.mpData->maStyleSettings )
         nChangeFlags |= SETTINGS_STYLE;
 
 
     if ( (mpData->maMachineSettings         == rSet.mpData->maMachineSettings)      &&
          (mpData->maMouseSettings           == rSet.mpData->maMouseSettings)        &&
-         (mpData->maKeyboardSettings        == rSet.mpData->maKeyboardSettings)     &&
          (mpData->maStyleSettings           == rSet.mpData->maStyleSettings)        &&
          (mpData->maMiscSettings            == rSet.mpData->maMiscSettings)         &&
          (mpData->maNotificationSettings    == rSet.mpData->maNotificationSettings) &&