[Libreoffice-commits] core.git: cui/source i18nlangtag/source include/i18nlangtag include/svtools l10ntools/inc l10ntools/source svtools/source UnoControls/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Apr 24 13:45:50 UTC 2017


 UnoControls/source/controls/progressmonitor.cxx |   17 ++++++-----------
 UnoControls/source/inc/progressmonitor.hxx      |    4 ++--
 cui/source/options/optgdlg.cxx                  |    5 ++---
 i18nlangtag/source/isolang/mslangid.cxx         |    2 +-
 include/i18nlangtag/mslangid.hxx                |    8 +-------
 include/svtools/langtab.hxx                     |    9 ---------
 l10ntools/inc/xmlparse.hxx                      |    2 +-
 l10ntools/source/xmlparse.cxx                   |   14 +++++++-------
 svtools/source/misc/langtab.cxx                 |   14 ++++----------
 9 files changed, 24 insertions(+), 51 deletions(-)

New commits:
commit e0097fea5a761747c1c1ce19a0873d7a760c4c37
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Apr 24 11:50:04 2017 +0200

    loplugin:checkunusedparams in i18nlangtag and l10ntools
    
    Change-Id: If7c7404b1cc1cf9445a2af8106f7326b76524388
    Reviewed-on: https://gerrit.libreoffice.org/36883
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/UnoControls/source/controls/progressmonitor.cxx b/UnoControls/source/controls/progressmonitor.cxx
index 1eda7f784fbf..3354e60131c1 100644
--- a/UnoControls/source/controls/progressmonitor.cxx
+++ b/UnoControls/source/controls/progressmonitor.cxx
@@ -205,8 +205,8 @@ void SAL_CALL ProgressMonitor::addText(
 {
     // Safe impossible cases
     // Check valid call of this method.
-    DBG_ASSERT ( impl_debug_checkParameter ( rTopic, rText, bbeforeProgress )   , "ProgressMonitor::addText()\nCall without valid parameters!\n");
-    DBG_ASSERT ( !(impl_searchTopic ( rTopic, bbeforeProgress ) != nullptr )       , "ProgressMonitor::addText()\nThe text already exist.\n"        );
+    DBG_ASSERT ( impl_debug_checkParameter ( rTopic, rText ),                 "ProgressMonitor::addText()\nCall without valid parameters!\n");
+    DBG_ASSERT ( !(impl_searchTopic ( rTopic, bbeforeProgress ) != nullptr ), "ProgressMonitor::addText()\nThe text already exist.\n"        );
 
     // Do nothing (in Release), if topic already exist.
     if ( impl_searchTopic ( rTopic, bbeforeProgress ) != nullptr )
@@ -244,7 +244,7 @@ void SAL_CALL ProgressMonitor::removeText ( const OUString& rTopic, sal_Bool bbe
 {
     // Safe impossible cases
     // Check valid call of this method.
-    DBG_ASSERT ( impl_debug_checkParameter ( rTopic, bbeforeProgress ), "ProgressMonitor::removeText()\nCall without valid parameters!\n" );
+    DBG_ASSERT ( impl_debug_checkParameter ( rTopic ), "ProgressMonitor::removeText()\nCall without valid parameters!\n" );
 
     // Search the topic ...
     IMPL_TextlistItem* pSearchItem = impl_searchTopic ( rTopic, bbeforeProgress );
@@ -287,7 +287,7 @@ void SAL_CALL ProgressMonitor::updateText (
 {
     // Safe impossible cases
     // Check valid call of this method.
-    DBG_ASSERT ( impl_debug_checkParameter ( rTopic, rText, bbeforeProgress ), "ProgressMonitor::updateText()\nCall without valid parameters!\n" );
+    DBG_ASSERT ( impl_debug_checkParameter ( rTopic, rText ), "ProgressMonitor::updateText()\nCall without valid parameters!\n" );
 
     // Search topic ...
     IMPL_TextlistItem* pSearchItem = impl_searchTopic ( rTopic, bbeforeProgress );
@@ -863,26 +863,21 @@ IMPL_TextlistItem* ProgressMonitor::impl_searchTopic ( const OUString& rTopic, b
 // addText, updateText
 bool ProgressMonitor::impl_debug_checkParameter (
     const OUString& rTopic,
-    const OUString& rText,
-    bool /*bbeforeProgress*/
+    const OUString& rText
 ) {
     if ( rTopic.isEmpty()       ) return false;    // ""
 
     if ( rText.isEmpty()       ) return false;    // ""
 
-    // "bbeforeProgress" is valid in everyway!
-
     // Parameter OK ... return true.
     return true;
 }
 
 // removeText
-bool ProgressMonitor::impl_debug_checkParameter ( const OUString& rTopic, bool /*bbeforeProgress*/ )
+bool ProgressMonitor::impl_debug_checkParameter ( const OUString& rTopic )
 {
     if ( rTopic.isEmpty()      ) return false;    // ""
 
-    // "bbeforeProgress" is valid in everyway!
-
     // Parameter OK ... return true.
     return true;
 }
diff --git a/UnoControls/source/inc/progressmonitor.hxx b/UnoControls/source/inc/progressmonitor.hxx
index 027a8d3fdc9e..a5a364534dbf 100644
--- a/UnoControls/source/inc/progressmonitor.hxx
+++ b/UnoControls/source/inc/progressmonitor.hxx
@@ -278,8 +278,8 @@ private:
 
 private:
 
-    static bool impl_debug_checkParameter( const OUString& sTopic, const OUString& sText, bool bbeforeProgress );    // addText, updateText
-    static bool impl_debug_checkParameter( const OUString& rTopic, bool bbeforeProgress );                              // removeText
+    static bool impl_debug_checkParameter( const OUString& sTopic, const OUString& sText );    // addText, updateText
+    static bool impl_debug_checkParameter( const OUString& rTopic );                           // removeText
 
 // private variables
 
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 88ff6ec40669..07496d9e6c26 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1156,7 +1156,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* pParent, const SfxItemSet&
 
     OUString aUILang = m_sSystemDefaultString +
                        " - " +
-                       SvtLanguageTable::GetLanguageString(GetInstalledLocaleForSystemUILanguage().getLanguageType(), true);
+                       SvtLanguageTable::GetLanguageString(GetInstalledLocaleForSystemUILanguage().getLanguageType());
 
     m_pUserInterfaceLB->InsertEntry(aUILang);
     m_pUserInterfaceLB->SetEntryData(0, nullptr);
@@ -1180,8 +1180,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* pParent, const SfxItemSet&
             aLang = LanguageTag::convertToLanguageTypeWithFallback(seqInstalledLanguages[i]);
             if (aLang != LANGUAGE_DONTKNOW)
             {
-                //sal_uInt16 p = m_pUserInterfaceLB->InsertLanguage(aLang);
-                OUString aLangStr( SvtLanguageTable::GetLanguageString( aLang, true ) );
+                OUString aLangStr( SvtLanguageTable::GetLanguageString( aLang ) );
                 const sal_Int32 p = m_pUserInterfaceLB->InsertEntry(aLangStr);
                 m_pUserInterfaceLB->SetEntryData(p, reinterpret_cast<void*>(i+1));
             }
diff --git a/i18nlangtag/source/isolang/mslangid.cxx b/i18nlangtag/source/isolang/mslangid.cxx
index d13d7bb3f76d..541bb4b94831 100644
--- a/i18nlangtag/source/isolang/mslangid.cxx
+++ b/i18nlangtag/source/isolang/mslangid.cxx
@@ -518,7 +518,7 @@ bool MsLangId::isLegacy( LanguageType nLang )
 
 
 // static
-LanguageType MsLangId::getReplacementForObsoleteLanguage( LanguageType nLang, bool /*bUserInterfaceSelection*/ )
+LanguageType MsLangId::getReplacementForObsoleteLanguage( LanguageType nLang )
 {
     switch (nLang)
     {
diff --git a/include/i18nlangtag/mslangid.hxx b/include/i18nlangtag/mslangid.hxx
index 1b0d6594ec97..668be8c28d30 100644
--- a/include/i18nlangtag/mslangid.hxx
+++ b/include/i18nlangtag/mslangid.hxx
@@ -163,14 +163,8 @@ public:
         Also used to map UI localizations using reserved ISO codes to something
         "official" but not identical in order to not pollute documents with
         invalid ISO codes.
-
-        @param bUserInterfaceSelection
-            If TRUE, don't replace such UI-only locale. Only use for
-                     Tools->Options->LanguageSettings->UserInterface listbox.
-            If FALSE, do replace.
      */
-    static LanguageType getReplacementForObsoleteLanguage( LanguageType nLang,
-            bool bUserInterfaceSelection = false );
+    static LanguageType getReplacementForObsoleteLanguage( LanguageType nLang );
 
     /** Whether locale is legacy, i.e. country ot confederation doesn't exist anymore. */
     static bool isLegacy( LanguageType nLang );
diff --git a/include/svtools/langtab.hxx b/include/svtools/langtab.hxx
index 5cfe392a10ab..8c78002fe9bd 100644
--- a/include/svtools/langtab.hxx
+++ b/include/svtools/langtab.hxx
@@ -35,15 +35,6 @@ public:
     static sal_uInt32   GetLanguageEntryCount();
     static LanguageType GetLanguageTypeAtIndex( sal_uInt32 nIndex );
 
-    /**
-        @param bUserInterfaceSelection
-            If TRUE, don't replace an UI-only locale. Only use for
-                     Tools->Options->LanguageSettings->UserInterface listbox.
-            If FALSE, do replace; same as GetLanguageString() without bool
-                      parameter.
-     */
-    static OUString     GetLanguageString( const LanguageType eType, bool bUserInterfaceSelection );
-
     /** Add a language tag to the table.
 
         @param  rString
diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index 6483dd19e972..c9446aea7dcd 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -345,7 +345,7 @@ private:
 
 
     void StartElement( const XML_Char *name, const XML_Char **atts );
-    void EndElement( const XML_Char *name );
+    void EndElement();
     void CharacterData( const XML_Char *s, int len );
     void Comment( const XML_Char *data );
     void Default( const XML_Char *s, int len );
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index 5e410df3aabc..fd6e1f7f2837 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -788,10 +788,10 @@ SimpleXMLParser::SimpleXMLParser()
 {
     m_aParser = XML_ParserCreate( nullptr );
     XML_SetUserData( m_aParser, this );
-    XML_SetElementHandler( m_aParser, reinterpret_cast<XML_StartElementHandler>(StartElementHandler), reinterpret_cast<XML_EndElementHandler>(EndElementHandler) );
-    XML_SetCharacterDataHandler( m_aParser, reinterpret_cast<XML_CharacterDataHandler>(CharacterDataHandler) );
-    XML_SetCommentHandler( m_aParser, reinterpret_cast<XML_CommentHandler>(CommentHandler) );
-    XML_SetDefaultHandler( m_aParser, reinterpret_cast<XML_DefaultHandler>(DefaultHandler) );
+    XML_SetElementHandler( m_aParser, StartElementHandler, EndElementHandler );
+    XML_SetCharacterDataHandler( m_aParser, CharacterDataHandler );
+    XML_SetCommentHandler( m_aParser, CommentHandler );
+    XML_SetDefaultHandler( m_aParser, DefaultHandler );
 }
 
 SimpleXMLParser::~SimpleXMLParser()
@@ -806,9 +806,9 @@ void SimpleXMLParser::StartElementHandler(
 }
 
 void SimpleXMLParser::EndElementHandler(
-    void *userData, const XML_Char *name )
+    void *userData, const XML_Char * /*name*/ )
 {
-    static_cast<SimpleXMLParser *>(userData)->EndElement( name );
+    static_cast<SimpleXMLParser *>(userData)->EndElement();
 }
 
 void SimpleXMLParser::CharacterDataHandler(
@@ -844,7 +844,7 @@ void SimpleXMLParser::StartElement(
     }
 }
 
-void SimpleXMLParser::EndElement( const XML_Char * /*name*/ )
+void SimpleXMLParser::EndElement()
 {
     m_pCurNode = m_pCurNode->GetParent();
     m_pCurData = nullptr;
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 2e4abe64c766..74497609e08d 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -44,7 +44,7 @@ public:
     virtual ~SvtLanguageTableImpl();
 
     bool            HasType( const LanguageType eType ) const;
-    const OUString  GetString( const LanguageType eType, bool bUserInterfaceSelection ) const;
+    const OUString  GetString( const LanguageType eType ) const;
     LanguageType    GetType( const OUString& rStr ) const;
     sal_uInt32      GetEntryCount() const;
     LanguageType    GetTypeAtIndex( sal_uInt32 nIndex ) const;
@@ -187,9 +187,9 @@ OUString lcl_getDescription( const OUString& rBcp47 )
     return "{" + rBcp47 + "}";
 }
 
-const OUString SvtLanguageTableImpl::GetString( const LanguageType eType, bool bUserInterfaceSelection ) const
+const OUString SvtLanguageTableImpl::GetString( const LanguageType eType ) const
 {
-    LanguageType eLang = MsLangId::getReplacementForObsoleteLanguage( eType, bUserInterfaceSelection);
+    LanguageType eLang = MsLangId::getReplacementForObsoleteLanguage( eType );
     sal_uInt32 nPos = FindIndex( eLang );
 
     if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count() )
@@ -212,15 +212,9 @@ const OUString SvtLanguageTableImpl::GetString( const LanguageType eType, bool b
 
 OUString SvtLanguageTable::GetLanguageString( const LanguageType eType )
 {
-    return theLanguageTable::get().GetString( eType, false );
+    return theLanguageTable::get().GetString( eType );
 }
 
-OUString SvtLanguageTable::GetLanguageString( const LanguageType eType, bool bUserInterfaceSelection )
-{
-    return theLanguageTable::get().GetString( eType, bUserInterfaceSelection );
-}
-
-
 LanguageType SvtLanguageTableImpl::GetType( const OUString& rStr ) const
 {
     LanguageType eType = LANGUAGE_DONTKNOW;


More information about the Libreoffice-commits mailing list