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

Noel Grandin noel at peralex.com
Fri Jan 15 03:51:42 PST 2016


 include/unotools/collatorwrapper.hxx       |    2 +-
 include/unotools/securityoptions.hxx       |    2 +-
 include/unotools/viewoptions.hxx           |    6 +-----
 unotools/source/config/securityoptions.cxx |    4 ++--
 unotools/source/config/viewoptions.cxx     |   28 +++++++++-------------------
 unotools/source/i18n/collatorwrapper.cxx   |    7 ++-----
 6 files changed, 16 insertions(+), 33 deletions(-)

New commits:
commit 24ada6566044881c95e33fada9d305904db46ad7
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Jan 15 10:08:02 2016 +0200

    loplugin:unusedmethods unused return value in include/unotools
    
    Change-Id: I3b2281dc713bff92eb3d80fddef04a8a39838aa8
    Reviewed-on: https://gerrit.libreoffice.org/21484
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/unotools/collatorwrapper.hxx b/include/unotools/collatorwrapper.hxx
index a3ef7b5..b67d9ee 100644
--- a/include/unotools/collatorwrapper.hxx
+++ b/include/unotools/collatorwrapper.hxx
@@ -51,7 +51,7 @@ class UNOTOOLS_DLLPUBLIC CollatorWrapper
         loadDefaultCollator (
                 const css::lang::Locale& rLocale, sal_Int32 nOption);
 
-        sal_Int32
+        void
         loadCollatorAlgorithm (
                 const OUString& rAlgorithm,
                 const css::lang::Locale& rLocale, sal_Int32 nOption);
diff --git a/include/unotools/securityoptions.hxx b/include/unotools/securityoptions.hxx
index 471ac3a..3f118d2 100644
--- a/include/unotools/securityoptions.hxx
+++ b/include/unotools/securityoptions.hxx
@@ -193,7 +193,7 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtSecurityOptions : public utl::detail
 
         // for bool options only!
         bool        IsOptionSet     ( EOption eOption                   ) const;
-        bool        SetOption       ( EOption eOption, bool bValue      );
+        void        SetOption       ( EOption eOption, bool bValue      );
         bool        IsOptionEnabled ( EOption eOption                   ) const;
 
         // xmlsec05 deprecated methods
diff --git a/include/unotools/viewoptions.hxx b/include/unotools/viewoptions.hxx
index 71192fc..6cd10e8 100644
--- a/include/unotools/viewoptions.hxx
+++ b/include/unotools/viewoptions.hxx
@@ -150,13 +150,9 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions : public utl::detail::Op
                         your view will die relay in configuration...
 
             @seealso    method Exist()
-
-            @return     True if delete OK, False otherwise.
-
-            @onerror    We return sal_False.
         *//*-*****************************************************************************************************/
 
-        bool Delete();
+        void Delete();
 
         /*-****************************************************************************************************
             @short      use it to set/get the window state of your view
diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx
index 795d768..8de1a0c 100644
--- a/unotools/source/config/securityoptions.cxx
+++ b/unotools/source/config/securityoptions.cxx
@@ -1079,10 +1079,10 @@ bool SvtSecurityOptions::IsOptionSet( EOption eOption ) const
     return m_pDataContainer->IsOptionSet( eOption );
 }
 
-bool SvtSecurityOptions::SetOption( EOption eOption, bool bValue )
+void SvtSecurityOptions::SetOption( EOption eOption, bool bValue )
 {
     MutexGuard aGuard( GetInitMutex() );
-    return m_pDataContainer->SetOption( eOption, bValue );
+    m_pDataContainer->SetOption( eOption, bValue );
 }
 
 bool SvtSecurityOptions::IsOptionEnabled( EOption eOption ) const
diff --git a/unotools/source/config/viewoptions.cxx b/unotools/source/config/viewoptions.cxx
index 1ad1ad0..6278706 100644
--- a/unotools/source/config/viewoptions.cxx
+++ b/unotools/source/config/viewoptions.cxx
@@ -726,32 +726,22 @@ bool SvtViewOptions::Exists() const
 
 //  public method
 
-bool SvtViewOptions::Delete()
+void SvtViewOptions::Delete()
 {
     // Ready for multithreading
     ::osl::MutexGuard aGuard( GetOwnStaticMutex() );
 
-    bool bState = false;
     switch( m_eViewType )
     {
-        case E_DIALOG       :   {
-                                    bState = m_pDataContainer_Dialogs->Delete( m_sViewName );
-                                }
-                                break;
-        case E_TABDIALOG    :   {
-                                    bState = m_pDataContainer_TabDialogs->Delete( m_sViewName );
-                                }
-                                break;
-        case E_TABPAGE      :   {
-                                    bState = m_pDataContainer_TabPages->Delete( m_sViewName );
-                                }
-                                break;
-        case E_WINDOW       :   {
-                                    bState = m_pDataContainer_Windows->Delete( m_sViewName );
-                                }
-                                break;
+        case E_DIALOG    :  m_pDataContainer_Dialogs->Delete( m_sViewName );
+                            break;
+        case E_TABDIALOG :  m_pDataContainer_TabDialogs->Delete( m_sViewName );
+                            break;
+        case E_TABPAGE   :  m_pDataContainer_TabPages->Delete( m_sViewName );
+                            break;
+        case E_WINDOW    :  m_pDataContainer_Windows->Delete( m_sViewName );
+                            break;
     }
-    return bState;
 }
 
 //  public method
diff --git a/unotools/source/i18n/collatorwrapper.cxx b/unotools/source/i18n/collatorwrapper.cxx
index ac3033e..0b96226 100644
--- a/unotools/source/i18n/collatorwrapper.cxx
+++ b/unotools/source/i18n/collatorwrapper.cxx
@@ -82,23 +82,20 @@ CollatorWrapper::loadDefaultCollator (const lang::Locale& rLocale, sal_Int32 nOp
     return 0;
 }
 
-sal_Int32
+void
 CollatorWrapper::loadCollatorAlgorithm (const OUString& rAlgorithm,
         const lang::Locale& rLocale, sal_Int32 nOptions)
 {
     try
     {
         if (mxInternationalCollator.is())
-            return mxInternationalCollator->loadCollatorAlgorithm (
+            mxInternationalCollator->loadCollatorAlgorithm (
                                                         rAlgorithm, rLocale, nOptions);
     }
     catch (const uno::RuntimeException&)
     {
         SAL_WARN( "unotools.i18n","CollatorWrapper: loadCollatorAlgorithm failed");
     }
-
-    return 0;
-
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list