summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-02-15 15:05:29 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-02-15 15:11:29 +0000
commit1893585d243c7daf5c8782ec6c90c26142d428e8 (patch)
treea9af13784735687a7c05729774515d8b9b28a442 /vcl
parent029b57344c8679ee201079241a3f90aad28b1970 (diff)
I can't see the point of these masses of vcl settings which go nowhere
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/vcl/settings.hxx191
-rw-r--r--vcl/source/app/settings.cxx308
2 files changed, 10 insertions, 489 deletions
diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx
index e0110e09171c..2f333ca97520 100644
--- a/vcl/inc/vcl/settings.hxx
+++ b/vcl/inc/vcl/settings.hxx
@@ -45,66 +45,6 @@ namespace vcl {
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 -
// -----------------
@@ -272,52 +212,6 @@ public:
{ 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
-{
-private:
- ImplKeyboardData* mpData;
-
-public:
- KeyboardSettings();
- KeyboardSettings( const KeyboardSettings& rSet );
- ~KeyboardSettings();
-
- const Accelerator& GetStandardAccel() const
- { return mpData->maStandardAccel; }
-
- 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 -
// -----------------
@@ -998,50 +892,6 @@ public:
{ return !(*this == rSet); }
};
-// ------------------------
-// - ImplNotificationData -
-// ------------------------
-
-class ImplNotificationData
-{
- friend class NotificationSettings;
-
- ImplNotificationData();
- ImplNotificationData( const ImplNotificationData& rData );
-
-private:
- sal_uLong mnRefCount;
- sal_uLong mnOptions;
-};
-
-// ------------------------
-// - NotificationSettings -
-// ------------------------
-
-class VCL_DLLPUBLIC NotificationSettings
-{
- void CopyData();
-
-private:
- ImplNotificationData* mpData;
-
-public:
- NotificationSettings();
- NotificationSettings( const NotificationSettings& rSet );
- ~NotificationSettings();
-
- void SetOptions( sal_uLong nOptions )
- { CopyData(); mpData->mnOptions = nOptions; }
- sal_uLong GetOptions() const
- { return mpData->mnOptions; }
-
- const NotificationSettings& operator =( const NotificationSettings& rSet );
-
- sal_Bool operator ==( const NotificationSettings& rSet ) const;
- sal_Bool operator !=( const NotificationSettings& rSet ) const
- { return !(*this == rSet); }
-};
-
// ----------------
// - ImplHelpData -
// ----------------
@@ -1118,12 +968,9 @@ class ImplAllSettingsData
private:
sal_uLong mnRefCount;
- MachineSettings maMachineSettings;
MouseSettings maMouseSettings;
- KeyboardSettings maKeyboardSettings;
StyleSettings maStyleSettings;
MiscSettings maMiscSettings;
- NotificationSettings maNotificationSettings;
HelpSettings maHelpSettings;
::com::sun::star::lang::Locale maLocale;
sal_uLong mnSystemUpdate;
@@ -1143,21 +990,16 @@ private:
// - AllSettings -
// ---------------
-#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_MISC ((sal_uLong)0x00000010)
-#define SETTINGS_SOUND ((sal_uLong)0x00000020)
-#define SETTINGS_NOTIFICATION ((sal_uLong)0x00000040)
-#define SETTINGS_HELP ((sal_uLong)0x00000080)
-#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 | SETTINGS_KEYBOARD |\
+#define SETTINGS_MOUSE ((sal_uLong)0x00000001)
+#define SETTINGS_STYLE ((sal_uLong)0x00000002)
+#define SETTINGS_MISC ((sal_uLong)0x00000004)
+#define SETTINGS_SOUND ((sal_uLong)0x00000008)
+#define SETTINGS_HELP ((sal_uLong)0x00000010)
+#define SETTINGS_LOCALE ((sal_uLong)0x00000020)
+#define SETTINGS_UILOCALE ((sal_uLong)0x00000040)
+#define SETTINGS_ALLSETTINGS (SETTINGS_MOUSE |\
SETTINGS_STYLE | SETTINGS_MISC |\
- SETTINGS_SOUND | SETTINGS_NOTIFICATION |\
+ SETTINGS_SOUND |\
SETTINGS_HELP |\
SETTINGS_LOCALE | SETTINGS_UILOCALE )
#define SETTINGS_IN_UPDATE_SETTINGS ((sal_uLong)0x00000800) // this flag indicates that the data changed event was created
@@ -1176,21 +1018,11 @@ public:
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
{ 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
@@ -1201,11 +1033,6 @@ public:
const MiscSettings& GetMiscSettings() const
{ return mpData->maMiscSettings; }
- void SetNotificationSettings( const NotificationSettings& rSet )
- { CopyData(); mpData->maNotificationSettings = rSet; }
- const NotificationSettings& GetNotificationSettings() const
- { return mpData->maNotificationSettings; }
-
void SetHelpSettings( const HelpSettings& rSet )
{ CopyData(); mpData->maHelpSettings = rSet; }
const HelpSettings& GetHelpSettings() const
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 2f0742497f14..a3a72982b258 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -62,104 +62,6 @@ DBG_NAME( AllSettings )
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()
{
@@ -311,79 +213,6 @@ sal_Bool MouseSettings::operator ==( const MouseSettings& rSet ) const
// =======================================================================
-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;
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool KeyboardSettings::operator ==( const KeyboardSettings& rSet ) const
-{
- return mpData == rSet.mpData
- || mpData->mnOptions == rSet.mpData->mnOptions;
-}
-
-// =======================================================================
-
ImplStyleData::ImplStyleData()
{
mnRefCount = 1;
@@ -1271,91 +1100,6 @@ sal_Bool MiscSettings::GetEnableLocalizedDecimalSep() const
// =======================================================================
-ImplNotificationData::ImplNotificationData()
-{
- mnRefCount = 1;
- mnOptions = 0;
-}
-
-// -----------------------------------------------------------------------
-
-ImplNotificationData::ImplNotificationData( const ImplNotificationData& rData )
-{
- mnRefCount = 1;
- mnOptions = rData.mnOptions;
-}
-
-// -----------------------------------------------------------------------
-
-NotificationSettings::NotificationSettings()
-{
- mpData = new ImplNotificationData();
-}
-
-// -----------------------------------------------------------------------
-
-NotificationSettings::NotificationSettings( const NotificationSettings& rSet )
-{
- DBG_ASSERT( rSet.mpData->mnRefCount < 0xFFFFFFFE, "NotificationSettings: RefCount overflow" );
-
- // shared Instance Daten uebernehmen und Referenzcounter erhoehen
- mpData = rSet.mpData;
- mpData->mnRefCount++;
-}
-
-// -----------------------------------------------------------------------
-
-NotificationSettings::~NotificationSettings()
-{
- // Daten loeschen, wenn letzte Referenz
- if ( mpData->mnRefCount == 1 )
- delete mpData;
- else
- mpData->mnRefCount--;
-}
-
-// -----------------------------------------------------------------------
-
-const NotificationSettings& NotificationSettings::operator =( const NotificationSettings& rSet )
-{
- DBG_ASSERT( rSet.mpData->mnRefCount < 0xFFFFFFFE, "NotificationSettings: 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 NotificationSettings::CopyData()
-{
- // Falls noch andere Referenzen bestehen, dann kopieren
- if ( mpData->mnRefCount != 1 )
- {
- mpData->mnRefCount--;
- mpData = new ImplNotificationData( *mpData );
- }
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool NotificationSettings::operator ==( const NotificationSettings& rSet ) const
-{
- return mpData == rSet.mpData
- || mpData->mnOptions == rSet.mpData->mnOptions;
-}
-
-// =======================================================================
-
ImplHelpData::ImplHelpData()
{
mnRefCount = 1;
@@ -1473,10 +1217,8 @@ ImplAllSettingsData::ImplAllSettingsData()
ImplAllSettingsData::ImplAllSettingsData( const ImplAllSettingsData& rData ) :
maMouseSettings( rData.maMouseSettings ),
- maKeyboardSettings( rData.maKeyboardSettings ),
maStyleSettings( rData.maStyleSettings ),
maMiscSettings( rData.maMiscSettings ),
- maNotificationSettings( rData.maNotificationSettings ),
maHelpSettings( rData.maHelpSettings ),
maLocale( rData.maLocale )
{
@@ -1584,16 +1326,6 @@ sal_uLong AllSettings::Update( sal_uLong nFlags, const AllSettings& rSet )
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 )
@@ -1604,16 +1336,6 @@ sal_uLong AllSettings::Update( sal_uLong nFlags, const AllSettings& rSet )
}
}
- 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 )
@@ -1634,16 +1356,6 @@ sal_uLong AllSettings::Update( sal_uLong nFlags, const AllSettings& rSet )
}
}
- if ( nFlags & SETTINGS_NOTIFICATION )
- {
- if ( mpData->maNotificationSettings != rSet.mpData->maNotificationSettings )
- {
- CopyData();
- mpData->maNotificationSettings = rSet.mpData->maNotificationSettings;
- nChangeFlags |= SETTINGS_NOTIFICATION;
- }
- }
-
if ( nFlags & SETTINGS_HELP )
{
if ( mpData->maHelpSettings != rSet.mpData->maHelpSettings )
@@ -1654,12 +1366,6 @@ sal_uLong AllSettings::Update( sal_uLong nFlags, const AllSettings& rSet )
}
}
- if ( nFlags & SETTINGS_INTERNATIONAL )
- {
- // Nothing, class International is gone.
- SAL_WARN( "vcl.app","AllSettings::Update: who calls with SETTINGS_INTERNATIONAL and why? You're flogging a dead horse.");
- }
-
if ( nFlags & SETTINGS_LOCALE )
{
if ( mpData->meLanguage || rSet.mpData->meLanguage )
@@ -1686,24 +1392,15 @@ sal_uLong AllSettings::GetChangeFlags( const AllSettings& rSet ) const
sal_uLong nChangeFlags = 0;
- if ( mpData->maMachineSettings != rSet.mpData->maMachineSettings )
- nChangeFlags |= SETTINGS_MACHINE;
-
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->maMiscSettings != rSet.mpData->maMiscSettings )
nChangeFlags |= SETTINGS_MISC;
- if ( mpData->maNotificationSettings != rSet.mpData->maNotificationSettings )
- nChangeFlags |= SETTINGS_NOTIFICATION;
-
if ( mpData->maHelpSettings != rSet.mpData->maHelpSettings )
nChangeFlags |= SETTINGS_HELP;
@@ -1723,12 +1420,9 @@ sal_Bool AllSettings::operator ==( const AllSettings& rSet ) const
if ( mpData == rSet.mpData )
return sal_True;
- if ( (mpData->maMachineSettings == rSet.mpData->maMachineSettings) &&
- (mpData->maMouseSettings == rSet.mpData->maMouseSettings) &&
- (mpData->maKeyboardSettings == rSet.mpData->maKeyboardSettings) &&
+ if ( (mpData->maMouseSettings == rSet.mpData->maMouseSettings) &&
(mpData->maStyleSettings == rSet.mpData->maStyleSettings) &&
(mpData->maMiscSettings == rSet.mpData->maMiscSettings) &&
- (mpData->maNotificationSettings == rSet.mpData->maNotificationSettings) &&
(mpData->maHelpSettings == rSet.mpData->maHelpSettings) &&
(mpData->mnSystemUpdate == rSet.mpData->mnSystemUpdate) &&
(mpData->maLocale == rSet.mpData->maLocale) &&