[Libreoffice-commits] core.git: include/unotools include/vbahelper UnoControls/inc UnoControls/source unotools/source vbahelper/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Oct 25 11:16:24 UTC 2016


 UnoControls/inc/basecontrol.hxx                 |    2 -
 UnoControls/source/base/basecontrol.cxx         |   48 +++++++++---------------
 include/unotools/confignode.hxx                 |    7 ---
 include/unotools/configvaluecontainer.hxx       |   17 --------
 include/vbahelper/vbahelper.hxx                 |    2 -
 unotools/source/config/confignode.cxx           |    7 ---
 unotools/source/config/configvaluecontainer.cxx |   10 +----
 vbahelper/source/vbahelper/vbahelper.cxx        |   10 +----
 8 files changed, 25 insertions(+), 78 deletions(-)

New commits:
commit c5498c310f6765ec9857e34169fd4a8d48953eb7
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Oct 25 11:47:17 2016 +0200

    loplugin:expandablemethods in UnoControls..vbahelper
    
    Change-Id: I7e607df2a1f6d4eb207ee0d3eb30f41fac44a0c6
    Reviewed-on: https://gerrit.libreoffice.org/30262
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/UnoControls/inc/basecontrol.hxx b/UnoControls/inc/basecontrol.hxx
index f78686e..fbf1686 100644
--- a/UnoControls/inc/basecontrol.hxx
+++ b/UnoControls/inc/basecontrol.hxx
@@ -379,8 +379,6 @@ protected:
 
 private:
 
-    void impl_releasePeer();
-
     OMRCListenerMultiplexerHelper* impl_getMultiplexer();
 
     css::uno::Reference< css::uno::XComponentContext >        m_xComponentContext;
diff --git a/UnoControls/source/base/basecontrol.cxx b/UnoControls/source/base/basecontrol.cxx
index b9c7e4c..457dd5c 100644
--- a/UnoControls/source/base/basecontrol.cxx
+++ b/UnoControls/source/base/basecontrol.cxx
@@ -231,7 +231,25 @@ void SAL_CALL BaseControl::dispose() throw( RuntimeException, std::exception )
 
     // release context and peer
     m_xContext.clear();
-    impl_releasePeer();
+    if ( m_xPeer.is() )
+    {
+        if ( m_xGraphicsPeer.is() )
+        {
+            removePaintListener( this );
+            removeWindowListener( this );
+            m_xGraphicsPeer.clear();
+        }
+
+        m_xPeer->dispose();
+        m_xPeerWindow.clear();
+        m_xPeer.clear();
+
+        if ( m_pMultiplexer != nullptr )
+        {
+            // take changes on multiplexer
+            m_pMultiplexer->setPeer( Reference< XWindow >() );
+        }
+    }
 
     // release view
     if ( m_xGraphicsView.is() )
@@ -741,34 +759,6 @@ void BaseControl::impl_recalcLayout( const WindowEvent& /*aEvent*/ )
     // But we make it not pure virtual because it's not necessary for all derived classes!
 }
 
-//  protected method
-
-
-//  private method
-
-void BaseControl::impl_releasePeer()
-{
-    if ( m_xPeer.is() )
-    {
-        if ( m_xGraphicsPeer.is() )
-        {
-            removePaintListener( this );
-            removeWindowListener( this );
-            m_xGraphicsPeer.clear();
-        }
-
-        m_xPeer->dispose();
-        m_xPeerWindow.clear();
-        m_xPeer.clear();
-
-        if ( m_pMultiplexer != nullptr )
-        {
-            // take changes on multiplexer
-            m_pMultiplexer->setPeer( Reference< XWindow >() );
-        }
-    }
-}
-
 //  private method
 
 OMRCListenerMultiplexerHelper* BaseControl::impl_getMultiplexer()
diff --git a/include/unotools/confignode.hxx b/include/unotools/confignode.hxx
index 5ab77c1..cae0bd9 100644
--- a/include/unotools/confignode.hxx
+++ b/include/unotools/confignode.hxx
@@ -142,13 +142,6 @@ namespace utl
         css::uno::Sequence< OUString >
                             getNodeNames() const throw();
 
-        /** enables or disables name escaping when accessing direct children<p/>
-            Escaping is disabled by default, usually you enable it for set nodes (e.g. with calling setEscape(isSetNode)).
-            Once escaping is enabled, you should not access indirect children (e.g. openNode("child/grandchild"), 'cause
-            escaping for such names may not be supported by the underlying API objects.
-            @see getEscape
-        */
-        void        setEscape(bool _bEnable);
         /** get the flag specifying the current escape behaviour
             @see setEscape
         */
diff --git a/include/unotools/configvaluecontainer.hxx b/include/unotools/configvaluecontainer.hxx
index 1604813..d583871 100644
--- a/include/unotools/configvaluecontainer.hxx
+++ b/include/unotools/configvaluecontainer.hxx
@@ -120,23 +120,6 @@ namespace utl
         */
         void    read( );
 
-        /** updates the configuration data
-
-            <p>The current values in memory (your exchange locations registered using the registerXXX methods) is
-            forwarded to their respective configuration nodes.</p>
-
-            <p>Note that calling <method>write</method>(<sal_True/) is the same as calling <method>commit</method>(<TRUE/>).</p>
-
-            @precond
-                The access must have been created for update access
-
-            You must explicitly call <method>commit</method> to make your changes persistent.
-
-            @see read
-            @see commit
-        */
-        void    write();
-
         /** commits any changes done
 
             <p>Note that calling <method>write</method>(<sal_True/) is the same as calling <method>commit</method>(<TRUE/>).</p>
diff --git a/include/vbahelper/vbahelper.hxx b/include/vbahelper/vbahelper.hxx
index ab5a2e1..79f8506 100644
--- a/include/vbahelper/vbahelper.hxx
+++ b/include/vbahelper/vbahelper.hxx
@@ -254,8 +254,6 @@ public:
 
     static void basicexception( const css::uno::Exception& ex ) throw( css::script::BasicErrorException );
 
-    static void runtimeexception( const OUString&  DetailedMessage, const css::uno::Exception& ex,  int err, const OUString& /*additionalArgument*/ ) throw( css::uno::RuntimeException );
-
     static void runtimeexception( int err,  const OUString& additionalArgument ) throw( css::uno::RuntimeException );
 };
 
diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx
index 89c38fa..4d0eec9 100644
--- a/unotools/source/config/confignode.cxx
+++ b/unotools/source/config/confignode.cxx
@@ -74,7 +74,7 @@ namespace utl
             startComponentListening(xConfigNodeComp);
 
         if (isValid())
-            setEscape(isSetNode());
+            m_bEscapeNames = isSetNode() && Reference< XStringEscape >::query(m_xDirectAccess).is();
     }
 
     OConfigurationNode::OConfigurationNode(const OConfigurationNode& _rSource)
@@ -303,11 +303,6 @@ namespace utl
         return OConfigurationNode();
     }
 
-    void OConfigurationNode::setEscape(bool _bEnable)
-    {
-        m_bEscapeNames = _bEnable && Reference< XStringEscape >::query(m_xDirectAccess).is();
-    }
-
     bool OConfigurationNode::isSetNode() const
     {
         bool bIsSet = false;
diff --git a/unotools/source/config/configvaluecontainer.cxx b/unotools/source/config/configvaluecontainer.cxx
index 873dcfe..3127510 100644
--- a/unotools/source/config/configvaluecontainer.cxx
+++ b/unotools/source/config/configvaluecontainer.cxx
@@ -271,20 +271,14 @@ namespace utl
         );
     }
 
-    void OConfigurationValueContainer::write()
+    void OConfigurationValueContainer::commit()
     {
-        // collect the current values in the exchange locations
+        // write the current values in the exchange locations
         std::for_each(
             m_pImpl->aAccessors.begin(),
             m_pImpl->aAccessors.end(),
             UpdateToConfig( m_pImpl->aConfigRoot, m_pImpl->rMutex )
         );
-    }
-
-    void OConfigurationValueContainer::commit()
-    {
-        // write the current values in the exchange locations
-        write();
 
         // commit the changes done
         m_pImpl->aConfigRoot.commit( );
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index 406cc84..76b0e7e 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -1063,15 +1063,11 @@ void DebugHelper::basicexception( const css::uno::Exception& ex ) throw( css::sc
     basicexception( OUString(), ex, ERRCODE_BASIC_INTERNAL_ERROR, OUString() );
 }
 
-void DebugHelper::runtimeexception( const OUString&  DetailedMessage, const css::uno::Exception& ex,  int err, const OUString& /*additionalArgument*/ ) throw( css::uno::RuntimeException )
+void DebugHelper::runtimeexception( int err,  const OUString& /*additionalArgument*/ ) throw( css::uno::RuntimeException )
 {
     // #TODO #FIXME ( do we want to support additionalArg here )
-    throw css::uno::RuntimeException( DetailedMessage.concat( " " ).concat( ex.Message ).concat(" ").concat(OUString::number(err)), css::uno::Reference< css::uno::XInterface >() );
-}
-
-void DebugHelper::runtimeexception( int err,  const OUString& additionalArgument ) throw( css::uno::RuntimeException )
-{
-    runtimeexception( OUString(), css::uno::Exception(), err, additionalArgument );
+    throw css::uno::RuntimeException( css::uno::Exception().Message + " " + OUString::number(err),
+                                      css::uno::Reference< css::uno::XInterface >() );
 }
 
 Millimeter::Millimeter():m_nMillimeter(0) {}


More information about the Libreoffice-commits mailing list