diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-03-11 16:39:24 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-03-11 16:50:03 +0100 |
commit | 465359c35fcd8c30a2bedd3d0beb07c0c1c36cba (patch) | |
tree | 3959801825b12a5def0a4e6402917a455aa9c6a2 /unotools/source | |
parent | a7b9167235d38130aab1af4bed66b6c48d375fc9 (diff) |
do not call virtual Commit() from dtors of utl::ConfigItem subclasses
~SvtAppFilterOptions_Impl() demonstrates that this is a bad idea, by not
invoking its subclasses' ImplCommit() but its own.
Change-Id: Ic675e9cd3be1494c740a4f289be3bdbf0d1a122b
Diffstat (limited to 'unotools/source')
-rw-r--r-- | unotools/source/config/cmdoptions.cxx | 6 | ||||
-rw-r--r-- | unotools/source/config/compatibility.cxx | 6 | ||||
-rw-r--r-- | unotools/source/config/dynamicmenuoptions.cxx | 6 | ||||
-rw-r--r-- | unotools/source/config/eventcfg.cxx | 6 | ||||
-rw-r--r-- | unotools/source/config/extendedsecurityoptions.cxx | 6 | ||||
-rw-r--r-- | unotools/source/config/fltrcfg.cxx | 3 | ||||
-rw-r--r-- | unotools/source/config/fontoptions.cxx | 6 | ||||
-rw-r--r-- | unotools/source/config/localisationoptions.cxx | 6 | ||||
-rw-r--r-- | unotools/source/config/moduleoptions.cxx | 15 | ||||
-rw-r--r-- | unotools/source/config/printwarningoptions.cxx | 3 | ||||
-rw-r--r-- | unotools/source/config/searchopt.cxx | 2 | ||||
-rw-r--r-- | unotools/source/config/securityoptions.cxx | 3 | ||||
-rw-r--r-- | unotools/source/config/syslocaleoptions.cxx | 3 |
13 files changed, 13 insertions, 58 deletions
diff --git a/unotools/source/config/cmdoptions.cxx b/unotools/source/config/cmdoptions.cxx index b6d96899fce6..b55d8a84f31c 100644 --- a/unotools/source/config/cmdoptions.cxx +++ b/unotools/source/config/cmdoptions.cxx @@ -175,11 +175,7 @@ SvtCommandOptions_Impl::SvtCommandOptions_Impl() SvtCommandOptions_Impl::~SvtCommandOptions_Impl() { - // We must save our current values .. if user forget it! - if( IsModified() ) - { - Commit(); - } + assert(!IsModified()); // should have been committed } // public method diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx index f91981d1a262..71ed62143971 100644 --- a/unotools/source/config/compatibility.cxx +++ b/unotools/source/config/compatibility.cxx @@ -365,11 +365,7 @@ SvtCompatibilityOptions_Impl::SvtCompatibilityOptions_Impl() SvtCompatibilityOptions_Impl::~SvtCompatibilityOptions_Impl() { - // We must save our current values .. if user forget it! - if( IsModified() ) - { - Commit(); - } + assert(!IsModified()); // should have been committed } void SvtCompatibilityOptions_Impl::SetDefault( const OUString & sName, bool bValue ) diff --git a/unotools/source/config/dynamicmenuoptions.cxx b/unotools/source/config/dynamicmenuoptions.cxx index f406c8d225f2..1fac5954c420 100644 --- a/unotools/source/config/dynamicmenuoptions.cxx +++ b/unotools/source/config/dynamicmenuoptions.cxx @@ -353,11 +353,7 @@ SvtDynamicMenuOptions_Impl::SvtDynamicMenuOptions_Impl() SvtDynamicMenuOptions_Impl::~SvtDynamicMenuOptions_Impl() { - // We must save our current values .. if user forget it! - if( IsModified() ) - { - Commit(); - } + assert(!IsModified()); // should have been committed } // public method diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx index bd3f79ca46e7..cb46c6dc3a09 100644 --- a/unotools/source/config/eventcfg.cxx +++ b/unotools/source/config/eventcfg.cxx @@ -122,11 +122,7 @@ GlobalEventConfig_Impl::GlobalEventConfig_Impl() GlobalEventConfig_Impl::~GlobalEventConfig_Impl() { - // We must save our current values .. if user forget it! - if( IsModified() ) - { - Commit(); - } + assert(!IsModified()); // should have been committed } OUString GlobalEventConfig_Impl::GetEventName( sal_Int32 nIndex ) diff --git a/unotools/source/config/extendedsecurityoptions.cxx b/unotools/source/config/extendedsecurityoptions.cxx index d7db4b8db683..1443c7307a88 100644 --- a/unotools/source/config/extendedsecurityoptions.cxx +++ b/unotools/source/config/extendedsecurityoptions.cxx @@ -152,11 +152,7 @@ SvtExtendedSecurityOptions_Impl::SvtExtendedSecurityOptions_Impl() SvtExtendedSecurityOptions_Impl::~SvtExtendedSecurityOptions_Impl() { - // We must save our current values .. if user forget it! - if( IsModified() ) - { - Commit(); - } + assert(!IsModified()); // should have been committed } // public method diff --git a/unotools/source/config/fltrcfg.cxx b/unotools/source/config/fltrcfg.cxx index d929b312cc7e..3139ce52d3d8 100644 --- a/unotools/source/config/fltrcfg.cxx +++ b/unotools/source/config/fltrcfg.cxx @@ -88,8 +88,7 @@ public: SvtAppFilterOptions_Impl::~SvtAppFilterOptions_Impl() { - if(IsModified()) - Commit(); + assert(!IsModified()); // should have been committed } void SvtAppFilterOptions_Impl::ImplCommit() diff --git a/unotools/source/config/fontoptions.cxx b/unotools/source/config/fontoptions.cxx index 5766b9a9603c..fa2b52aceecd 100644 --- a/unotools/source/config/fontoptions.cxx +++ b/unotools/source/config/fontoptions.cxx @@ -150,11 +150,7 @@ SvtFontOptions_Impl::SvtFontOptions_Impl() SvtFontOptions_Impl::~SvtFontOptions_Impl() { - // We must save our current values .. if user forget it! - if( IsModified() ) - { - Commit(); - } + assert(!IsModified()); // should have been committed } // public method diff --git a/unotools/source/config/localisationoptions.cxx b/unotools/source/config/localisationoptions.cxx index f2f2ab1a315c..9707104f63f8 100644 --- a/unotools/source/config/localisationoptions.cxx +++ b/unotools/source/config/localisationoptions.cxx @@ -139,11 +139,7 @@ SvtLocalisationOptions_Impl::SvtLocalisationOptions_Impl() SvtLocalisationOptions_Impl::~SvtLocalisationOptions_Impl() { - // We must save our current values .. if user forget it! - if( IsModified() ) - { - Commit(); - } + assert(!IsModified()); // should have been committed } // public method diff --git a/unotools/source/config/moduleoptions.cxx b/unotools/source/config/moduleoptions.cxx index 7f1b55fe4863..f5ad76ce0ba5 100644 --- a/unotools/source/config/moduleoptions.cxx +++ b/unotools/source/config/moduleoptions.cxx @@ -355,22 +355,9 @@ SvtModuleOptions_Impl::SvtModuleOptions_Impl() EnableNotification( lFactories ); } -/*-************************************************************************************************************ - @short default dtor - @descr If any values of our cache was modified we should write it back to configuration. - - @attention Don't forget to call "SetModified()" method of base class ConfigItem if any interface method - of this class modify internal member list m_lFactories! Otherwise Commit() will never be called!!! - - @seealso baseclass ConfigItem - @threadsafe no -*//*-*************************************************************************************************************/ SvtModuleOptions_Impl::~SvtModuleOptions_Impl() { - if( IsModified() ) - { - Commit(); - } + assert(!IsModified()); // should have been committed } /*-************************************************************************************************************ diff --git a/unotools/source/config/printwarningoptions.cxx b/unotools/source/config/printwarningoptions.cxx index 33d61f2c4252..166e845f1711 100644 --- a/unotools/source/config/printwarningoptions.cxx +++ b/unotools/source/config/printwarningoptions.cxx @@ -159,8 +159,7 @@ SvtPrintWarningOptions_Impl::SvtPrintWarningOptions_Impl() : SvtPrintWarningOptions_Impl::~SvtPrintWarningOptions_Impl() { - if( IsModified() ) - Commit(); + assert(!IsModified()); // should have been committed } // Commit diff --git a/unotools/source/config/searchopt.cxx b/unotools/source/config/searchopt.cxx index 59eae30135bf..76154d8723ee 100644 --- a/unotools/source/config/searchopt.cxx +++ b/unotools/source/config/searchopt.cxx @@ -75,7 +75,7 @@ SvtSearchOptions_Impl::SvtSearchOptions_Impl() : SvtSearchOptions_Impl::~SvtSearchOptions_Impl() { - Commit(); + assert(!IsModified()); // should have been committed } void SvtSearchOptions_Impl::ImplCommit() diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx index c235a73bc168..3c00b0eb46ce 100644 --- a/unotools/source/config/securityoptions.cxx +++ b/unotools/source/config/securityoptions.cxx @@ -274,8 +274,7 @@ SvtSecurityOptions_Impl::SvtSecurityOptions_Impl() SvtSecurityOptions_Impl::~SvtSecurityOptions_Impl() { - if( IsModified() ) - Commit(); + assert(!IsModified()); // should have been committed } void SvtSecurityOptions_Impl::SetProperty( sal_Int32 nProperty, const Any& rValue, bool bRO ) diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx index 5a8d10788056..3ce1851b193c 100644 --- a/unotools/source/config/syslocaleoptions.cxx +++ b/unotools/source/config/syslocaleoptions.cxx @@ -249,8 +249,7 @@ SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl() SvtSysLocaleOptions_Impl::~SvtSysLocaleOptions_Impl() { - if ( IsModified() ) - Commit(); + assert(!IsModified()); // should have been committed } void SvtSysLocaleOptions_Impl::MakeRealLocale() |