Anonymous avatar Anonymous committed 2700bed

vcl122: #i117746# remove unused MachineSettings

Comments (0)

Files changed (2)

vcl/inc/vcl/settings.hxx

     class I18nHelper;
 }
 
-// -------------------
-// - ImplMachineData -
-// -------------------
-
-class ImplMachineData
-{
-    friend class MachineSettings;
-
-                                    ImplMachineData();
-                                    ImplMachineData( const ImplMachineData& rData );
-
-private:
-    sal_uLong                           mnRefCount;
-    sal_uLong                           mnOptions;
-    sal_uLong                           mnScreenOptions;
-    sal_uLong                           mnPrintOptions;
-    long                            mnScreenRasterFontDeviation;
-};
-
-// -------------------
-// - MachineSettings -
-// -------------------
-
-class VCL_DLLPUBLIC MachineSettings
-{
-    void                            CopyData();
-
-private:
-    ImplMachineData*                mpData;
-
-public:
-                                    MachineSettings();
-                                    MachineSettings( const MachineSettings& rSet );
-                                    ~MachineSettings();
-
-    void                            SetOptions( sal_uLong nOptions )
-                                        { CopyData(); mpData->mnOptions = nOptions; }
-    sal_uLong                           GetOptions() const
-                                        { return mpData->mnOptions; }
-    void                            SetScreenOptions( sal_uLong nOptions )
-                                        { CopyData(); mpData->mnScreenOptions = nOptions; }
-    sal_uLong                           GetScreenOptions() const
-                                        { return mpData->mnScreenOptions; }
-    void                            SetPrintOptions( sal_uLong nOptions )
-                                        { CopyData(); mpData->mnPrintOptions = nOptions; }
-    sal_uLong                           GetPrintOptions() const
-                                        { return mpData->mnPrintOptions; }
-
-    void                            SetScreenRasterFontDeviation( long nDeviation )
-                                        { CopyData(); mpData->mnScreenRasterFontDeviation = nDeviation; }
-    long                            GetScreenRasterFontDeviation() const
-                                        { return mpData->mnScreenRasterFontDeviation; }
-
-    const MachineSettings&          operator =( const MachineSettings& rSet );
-
-    sal_Bool                            operator ==( const MachineSettings& rSet ) const;
-    sal_Bool                            operator !=( const MachineSettings& rSet ) const
-                                        { return !(*this == rSet); }
-};
-
 // -----------------
 // - ImplMouseData -
 // -----------------
 
 private:
     sal_uLong                                   mnRefCount;
-    MachineSettings                         maMachineSettings;
     MouseSettings                           maMouseSettings;
     StyleSettings                           maStyleSettings;
     MiscSettings                            maMiscSettings;
 // - AllSettings -
 // ---------------
 
-#define SETTINGS_MACHINE            ((sal_uLong)0x00000001)
+//#define SETTINGS_MACHINE            ((sal_uLong)0x00000001)
 #define SETTINGS_MOUSE              ((sal_uLong)0x00000002)
 // #define SETTINGS_KEYBOARD           ((sal_uLong)0x00000004)
 #define SETTINGS_STYLE              ((sal_uLong)0x00000008)
 #define SETTINGS_INTERNATIONAL      ((sal_uLong)0x00000100) /* was for class International, has no effect anymore */
 #define SETTINGS_LOCALE             ((sal_uLong)0x00000200)
 #define SETTINGS_UILOCALE           ((sal_uLong)0x00000400)
-#define SETTINGS_ALLSETTINGS        (SETTINGS_MACHINE |\
-                                     SETTINGS_MOUSE |\
+#define SETTINGS_ALLSETTINGS        (SETTINGS_MOUSE |\
                                      SETTINGS_STYLE | SETTINGS_MISC |\
                                      SETTINGS_SOUND | SETTINGS_NOTIFICATION |\
                                      SETTINGS_HELP |\
                                             AllSettings( const AllSettings& rSet );
                                             ~AllSettings();
 
-    void                                    SetMachineSettings( const MachineSettings& rSet )
-                                                { CopyData(); mpData->maMachineSettings = rSet; }
-    const MachineSettings&                  GetMachineSettings() const
-                                                { return mpData->maMachineSettings; }
-
     void                                    SetMouseSettings( const MouseSettings& rSet )
                                                 { CopyData(); mpData->maMouseSettings = rSet; }
     const MouseSettings&                    GetMouseSettings() const

vcl/source/app/settings.cxx

                                  STYLE_OPTION_NOMNEMONICS)
 
 // =======================================================================
-ImplMachineData::ImplMachineData()
-{
-    mnRefCount                  = 1;
-    mnOptions                   = 0;
-    mnScreenOptions             = 0;
-    mnPrintOptions              = 0;
-    mnScreenRasterFontDeviation = 0;
-}
-
-// -----------------------------------------------------------------------
-
-ImplMachineData::ImplMachineData( const ImplMachineData& rData )
-{
-    mnRefCount                  = 1;
-    mnOptions                   = rData.mnOptions;
-    mnScreenOptions             = rData.mnScreenOptions;
-    mnPrintOptions              = rData.mnPrintOptions;
-    mnScreenRasterFontDeviation = rData.mnScreenRasterFontDeviation;
-}
-
-// -----------------------------------------------------------------------
-
-MachineSettings::MachineSettings()
-{
-    mpData = new ImplMachineData();
-}
-
-// -----------------------------------------------------------------------
-
-MachineSettings::MachineSettings( const MachineSettings& rSet )
-{
-    DBG_ASSERT( rSet.mpData->mnRefCount < 0xFFFFFFFE, "MachineSettings: RefCount overflow" );
-
-    // shared Instance Daten uebernehmen und Referenzcounter erhoehen
-    mpData = rSet.mpData;
-    mpData->mnRefCount++;
-}
-
-// -----------------------------------------------------------------------
-
-MachineSettings::~MachineSettings()
-{
-    // Daten loeschen, wenn letzte Referenz
-    if ( mpData->mnRefCount == 1 )
-        delete mpData;
-    else
-        mpData->mnRefCount--;
-}
-
-// -----------------------------------------------------------------------
-
-const MachineSettings& MachineSettings::operator =( const MachineSettings& rSet )
-{
-    DBG_ASSERT( rSet.mpData->mnRefCount < 0xFFFFFFFE, "MachineSettings: 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 MachineSettings::CopyData()
-{
-    // Falls noch andere Referenzen bestehen, dann kopieren
-    if ( mpData->mnRefCount != 1 )
-    {
-        mpData->mnRefCount--;
-        mpData = new ImplMachineData( *mpData );
-    }
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool MachineSettings::operator ==( const MachineSettings& rSet ) const
-{
-    if ( mpData == rSet.mpData )
-        return sal_True;
-
-    if ( (mpData->mnOptions                     == rSet.mpData->mnOptions)                  &&
-         (mpData->mnScreenOptions               == rSet.mpData->mnScreenOptions)            &&
-         (mpData->mnPrintOptions                == rSet.mpData->mnPrintOptions)             &&
-         (mpData->mnScreenRasterFontDeviation   == rSet.mpData->mnScreenRasterFontDeviation) )
-        return sal_True;
-    else
-        return sal_False;
-}
-
-// =======================================================================
 
 ImplMouseData::ImplMouseData()
 {
 
     sal_uLong nChangeFlags = 0;
 
-    if ( nFlags & SETTINGS_MACHINE )
-    {
-        if ( mpData->maMachineSettings != rSet.mpData->maMachineSettings )
-        {
-            CopyData();
-            mpData->maMachineSettings = rSet.mpData->maMachineSettings;
-            nChangeFlags |= SETTINGS_MACHINE;
-        }
-    }
-
     if ( nFlags & SETTINGS_MOUSE )
     {
         if ( mpData->maMouseSettings != rSet.mpData->maMouseSettings )
 
     sal_uLong nChangeFlags = 0;
 
-    if ( mpData->maMachineSettings != rSet.mpData->maMachineSettings )
-        nChangeFlags |= SETTINGS_MACHINE;
-
     if ( mpData->maMouseSettings != rSet.mpData->maMouseSettings )
         nChangeFlags |= SETTINGS_MOUSE;
 
     if ( mpData == rSet.mpData )
         return sal_True;
 
-    if ( (mpData->maMachineSettings         == rSet.mpData->maMachineSettings)      &&
-         (mpData->maMouseSettings           == rSet.mpData->maMouseSettings)        &&
+    if ( (mpData->maMouseSettings           == rSet.mpData->maMouseSettings)        &&
          (mpData->maStyleSettings           == rSet.mpData->maStyleSettings)        &&
          (mpData->maMiscSettings            == rSet.mpData->maMiscSettings)         &&
          (mpData->maNotificationSettings    == rSet.mpData->maNotificationSettings) &&
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.