[Libreoffice-commits] core.git: vbahelper/source

Noel Grandin noel at peralex.com
Fri Feb 26 09:00:11 UTC 2016


 vbahelper/source/vbahelper/vbacommandbar.cxx         |    2 +-
 vbahelper/source/vbahelper/vbacommandbarcontrol.cxx  |    4 ++--
 vbahelper/source/vbahelper/vbacommandbarcontrols.cxx |    2 +-
 vbahelper/source/vbahelper/vbacommandbarhelper.cxx   |    6 +-----
 vbahelper/source/vbahelper/vbacommandbarhelper.hxx   |    2 +-
 5 files changed, 6 insertions(+), 10 deletions(-)

New commits:
commit 692f14208001e646f46c9cd7f85fc93aba4b3982
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Feb 26 10:58:41 2016 +0200

    loplugin:unuseddefaultparam, ApplyChange->ApplyTempChange
    
    to make it clear what it's doing, now that I have dropped the param
    
    Change-Id: I9fb8bb0f218aa1b01d9ba357e75af35f067625ed

diff --git a/vbahelper/source/vbahelper/vbacommandbar.cxx b/vbahelper/source/vbahelper/vbacommandbar.cxx
index 8f4a32b4..6739f36 100644
--- a/vbahelper/source/vbahelper/vbacommandbar.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbar.cxx
@@ -76,7 +76,7 @@ ScVbaCommandBar::setName( const OUString& _name ) throw (uno::RuntimeException,
     uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW );
     xPropertySet->setPropertyValue( "UIName" , uno::makeAny( _name ) );
 
-    pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings );
+    pCBarHelper->ApplyTempChange( m_sResourceUrl, m_xBarSettings );
 }
 sal_Bool SAL_CALL
 ScVbaCommandBar::getVisible() throw (uno::RuntimeException, std::exception)
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
index 78fd8e7..eb798ac 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
@@ -32,7 +32,7 @@ void ScVbaCommandBarControl::ApplyChange() throw ( uno::RuntimeException )
 {
     uno::Reference< container::XIndexContainer > xIndexContainer( m_xCurrentSettings, uno::UNO_QUERY_THROW );
     xIndexContainer->replaceByIndex( m_nPosition, uno::makeAny( m_aPropertyValues ) );
-    pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings );
+    pCBarHelper->ApplyTempChange( m_sResourceUrl, m_xBarSettings );
 }
 
 OUString SAL_CALL
@@ -154,7 +154,7 @@ ScVbaCommandBarControl::Delete(  ) throw (script::BasicErrorException, uno::Runt
         uno::Reference< container::XIndexContainer > xIndexContainer( m_xCurrentSettings, uno::UNO_QUERY_THROW );
         xIndexContainer->removeByIndex( m_nPosition );
 
-        pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings );
+        pCBarHelper->ApplyTempChange( m_sResourceUrl, m_xBarSettings );
     }
 }
 
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
index 63b9cb0..e9986ef 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
@@ -222,7 +222,7 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un
     uno::Reference< container::XIndexContainer > xIndexContainer( m_xIndexAccess, uno::UNO_QUERY_THROW );
     xIndexContainer->insertByIndex( nPosition, uno::makeAny( aProps ) );
 
-    pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings );
+    pCBarHelper->ApplyTempChange( m_sResourceUrl, m_xBarSettings );
 
     ScVbaCommandBarControl* pNewCommandBarControl = nullptr;
     if( nType == office::MsoControlType::msoControlPopup )
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
index ecfd335..671cb34 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -144,7 +144,7 @@ void VbaCommandBarHelper::removeSettings( const OUString& sResourceUrl ) throw (
     // persistChanges();
 }
 
-void VbaCommandBarHelper::ApplyChange( const OUString& sResourceUrl, const css::uno::Reference< css::container::XIndexAccess >& xSettings, bool bTemporary ) throw (css::uno::RuntimeException)
+void VbaCommandBarHelper::ApplyTempChange( const OUString& sResourceUrl, const css::uno::Reference< css::container::XIndexAccess >& xSettings ) throw (css::uno::RuntimeException)
 {
     if( m_xDocCfgMgr->hasSettings( sResourceUrl ) )
     {
@@ -154,10 +154,6 @@ void VbaCommandBarHelper::ApplyChange( const OUString& sResourceUrl, const css::
     {
         m_xDocCfgMgr->insertSettings( sResourceUrl, xSettings );
     }
-    if( !bTemporary )
-    {
-        persistChanges();
-    }
 }
 
 void VbaCommandBarHelper::persistChanges() throw (css::uno::RuntimeException)
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
index b54f001..e6aca6b 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
@@ -72,7 +72,7 @@ public:
     void persistChanges() throw (css::uno::RuntimeException);
     css::uno::Reference< css::container::XIndexAccess > getSettings( const OUString& sResourceUrl ) throw (css::uno::RuntimeException);
     void removeSettings( const OUString& sResourceUrl ) throw (css::uno::RuntimeException);
-    void ApplyChange( const OUString& sResourceUrl, const css::uno::Reference< css::container::XIndexAccess >& xSettings, bool bTemporary = true ) throw (css::uno::RuntimeException);
+    void ApplyTempChange( const OUString& sResourceUrl, const css::uno::Reference< css::container::XIndexAccess >& xSettings) throw (css::uno::RuntimeException);
 
     css::uno::Reference< css::frame::XLayoutManager > getLayoutManager() throw (css::uno::RuntimeException);
 


More information about the Libreoffice-commits mailing list