canvas/source/opengl/ogl_bitmapcanvashelper.hxx                    |    2 -
 canvas/source/vcl/canvasbitmaphelper.hxx                           |    2 -
 canvas/source/vcl/canvashelper.hxx                                 |    2 -
 compilerplugins/clang/unusedmethods.cxx                            |    4 +-
 compilerplugins/clang/unusedmethods.py                             |   19 
++++++++--
 connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx |    3 -
 connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx |    2 -
 cui/source/dialogs/iconcdlg.cxx                                    |    9 ----
 cui/source/inc/iconcdlg.hxx                                        |    2 -
 include/svl/numuno.hxx                                             |    7 ---
 sw/inc/doc.hxx                                                     |    2 -
 sw/source/core/doc/doctxm.cxx                                      |    4 --
 12 files changed, 26 insertions(+), 32 deletions(-)

New commits:
commit 1c15a20df81fef594ef8fa887247aef9f2248c28
Author: Noel Grandin <n...@peralex.com>
Date:   Thu Sep 22 13:12:47 2016 +0200

    loplugin:unusedmethods unused returns
    
    Change-Id: I4da3374e31d3c7407b401d66275da7f56ae83d30
    Reviewed-on: https://gerrit.libreoffice.org/29178
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/canvas/source/opengl/ogl_bitmapcanvashelper.hxx 
b/canvas/source/opengl/ogl_bitmapcanvashelper.hxx
index 7b3722c..b55eb45 100644
--- a/canvas/source/opengl/ogl_bitmapcanvashelper.hxx
+++ b/canvas/source/opengl/ogl_bitmapcanvashelper.hxx
@@ -51,8 +51,6 @@ namespace oglcanvas
 
         const css::geometry::IntegerSize2D& getSize() { return maSize; }
 
-        css::uno::Reference< css::rendering::XBitmapCanvas > 
queryBitmapCanvas();
-
         css::uno::Reference< css::rendering::XBitmap >
             getScaledBitmap( const css::geometry::RealSize2D&  newSize,
                              bool                                              
 beFast );
diff --git a/canvas/source/vcl/canvasbitmaphelper.hxx 
b/canvas/source/vcl/canvasbitmaphelper.hxx
index 1b7cf7f..a83e26b 100644
--- a/canvas/source/vcl/canvasbitmaphelper.hxx
+++ b/canvas/source/vcl/canvasbitmaphelper.hxx
@@ -82,8 +82,6 @@ namespace vclcanvas
 
         css::geometry::IntegerSize2D getSize();
 
-        void queryBitmapCanvas();
-
         css::uno::Reference< css::rendering::XBitmap >
             getScaledBitmap( const css::geometry::RealSize2D&  newSize,
                              bool                                           
beFast );
diff --git a/canvas/source/vcl/canvashelper.hxx 
b/canvas/source/vcl/canvashelper.hxx
index 11c06c5..268f3be 100644
--- a/canvas/source/vcl/canvashelper.hxx
+++ b/canvas/source/vcl/canvashelper.hxx
@@ -235,8 +235,6 @@ namespace vclcanvas
 
         css::geometry::IntegerSize2D getSize();
 
-        void queryBitmapCanvas();
-
         css::uno::Reference< css::rendering::XBitmap >
             getScaledBitmap( const css::geometry::RealSize2D&  newSize,
                              bool                              beFast );
diff --git a/compilerplugins/clang/unusedmethods.cxx 
b/compilerplugins/clang/unusedmethods.cxx
index a8a94a7..c16b446 100644
--- a/compilerplugins/clang/unusedmethods.cxx
+++ b/compilerplugins/clang/unusedmethods.cxx
@@ -263,7 +263,9 @@ gotfunc:
     {
         const FunctionDecl* parentFunction = parentFunctionDecl(expr);
         if (parentFunction && parentFunction != calleeFunctionDecl) {
-            calledFromOutsideSet.insert(niceName(parentFunction));
+            if (!ignoreLocation(parentFunction)) {
+                calledFromOutsideSet.insert(niceName(parentFunction));
+            }
         }
     }
 
diff --git a/compilerplugins/clang/unusedmethods.py 
b/compilerplugins/clang/unusedmethods.py
index 6f67944..fb9412b 100755
--- a/compilerplugins/clang/unusedmethods.py
+++ b/compilerplugins/clang/unusedmethods.py
@@ -154,7 +154,7 @@ with io.open("loplugin.unusedmethods.log", "rb", 
buffering=1024*1024) as txt:
             returnType = tokens[1]
             nameAndParams = tokens[2]
             usedReturnSet.add((normalizeTypeParams(returnType), 
normalizeTypeParams(nameAndParams)))
-        elif tokens[0] == "calledFromOutsideSet:":
+        elif tokens[0] == "outside:":
             returnType = tokens[1]
             nameAndParams = tokens[2]
             calledFromOutsideSet.add((normalizeTypeParams(returnType), 
normalizeTypeParams(nameAndParams)))
@@ -315,7 +315,22 @@ for d in definitionSet:
     # ignore the SfxPoolItem CreateDefault methods for now
     if d[1].endswith("::CreateDefault()"):
         continue
-    tmp2set.add((method, definitionToSourceLocationMap[d]))
+    # ignore UNO constructor functions
+    if (d[0] == "class com::sun::star::uno::Reference<class 
com::sun::star::uno::XInterface>" and
+        d[1].endswith("_createInstance(const class 
com::sun::star::uno::Reference<class 
com::sun::star::lang::XMultiServiceFactory> &)")):
+        continue
+    if (d[0] == "class com::sun::star::uno::Reference<class 
com::sun::star::uno::XInterface>" and
+        d[1].endswith("_CreateInstance(const class 
com::sun::star::uno::Reference<class 
com::sun::star::lang::XMultiServiceFactory> &)")):
+        continue
+    # debug code
+    if d[1] == "writerfilter::ooxml::OOXMLPropertySet::toString()":
+        continue
+    location = definitionToSourceLocationMap[d];
+    # windows only
+    if location.startswith("include/svl/svdde.hxx"): continue
+    # fluent API (return ref to self)
+    if location.startswith("include/tools/stream.hxx"): continue
+    tmp2set.add((method, location))
 
 # print output, sorted by name and line number
 with open("loplugin.unusedmethods.report-returns", "wt") as f:
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx 
b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
index 7fb917f..9f4ca1c 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
@@ -61,7 +61,7 @@ namespace connectivity
             LoadXPToolkitProfiles(MozillaProductType_Firefox);
         }
         //Thunderbird and firefox profiles are saved in profiles.ini
-        sal_Int32 ProfileAccess::LoadXPToolkitProfiles(MozillaProductType 
product)
+        void ProfileAccess::LoadXPToolkitProfiles(MozillaProductType product)
         {
             sal_Int32 index=product;
             ProductStruct &rProduct = m_ProductProfileList[index];
@@ -137,7 +137,6 @@ namespace connectivity
                 }
 
             }
-            return static_cast< ::sal_Int32 >(rProduct.mProfileList.size());
         }
 
         OUString ProfileAccess::getProfilePath( 
css::mozilla::MozillaProductType product, const OUString& profileName ) throw 
(css::uno::RuntimeException)
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx 
b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx
index 7472fc2..d2eed6c 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx
@@ -80,7 +80,7 @@ namespace connectivity
         protected:
             ProductStruct m_ProductProfileList[4];
             void      LoadProductsInfo();
-            sal_Int32 LoadXPToolkitProfiles(MozillaProductType product);
+            void      LoadXPToolkitProfiles(MozillaProductType product);
         };
 
     }
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index 3e38e4d..d104557 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -682,7 +682,7 @@ bool IconChoiceDialog::OK_Impl()
 }
 
 
-short IconChoiceDialog::Ok()
+void IconChoiceDialog::Ok()
 {
     bInOK = true;
 
@@ -693,7 +693,6 @@ short IconChoiceDialog::Ok()
         else if ( pExampleSet )
             pOutSet = new SfxItemSet( *pExampleSet );
     }
-    bool _bModified = false;
 
     for ( size_t i = 0, nCount = maPageList.size(); i < nCount; ++i )
     {
@@ -709,18 +708,12 @@ short IconChoiceDialog::Ok()
 
                 if ( pPage->FillItemSet( &aTmp ) )
                 {
-                    _bModified = true;
                     pExampleSet->Put( aTmp );
                     pOutSet->Put( aTmp );
                 }
             }
         }
     }
-
-    if ( _bModified || ( pOutSet && pOutSet->Count() > 0 ) )
-        _bModified = true;
-
-    return _bModified ? RET_OK : RET_CANCEL;
 }
 
 void IconChoiceDialog::FocusOnIcon( sal_uInt16 nId )
diff --git a/cui/source/inc/iconcdlg.hxx b/cui/source/inc/iconcdlg.hxx
index 6f9eda8..eb8a743 100644
--- a/cui/source/inc/iconcdlg.hxx
+++ b/cui/source/inc/iconcdlg.hxx
@@ -146,7 +146,7 @@ protected:
     void                    DeActivatePageImpl ();
     void                    ResetPageImpl ();
 
-    short                   Ok();
+    void                    Ok();
 
 public:
 
diff --git a/include/svl/numuno.hxx b/include/svl/numuno.hxx
index 6fc9907..3a3aecc 100644
--- a/include/svl/numuno.hxx
+++ b/include/svl/numuno.hxx
@@ -35,13 +35,6 @@ namespace comphelper
 }
 
 
-//  SvNumberFormatterServiceObj must be registered as service somewhere
-
-css::uno::Reference<css::uno::XInterface> SAL_CALL
-    SvNumberFormatterServiceObj_NewInstance(
-        const css::uno::Reference< css::lang::XMultiServiceFactory>& rSMgr );
-
-
 //  SvNumberFormatsSupplierObj: aggregate to document,
 //  construct with SvNumberFormatter
 
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 3329c07..45d9e29 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -995,7 +995,7 @@ public:
     void                SetDefaultTOXBase(const SwTOXBase& rBase);
 
     // Key for management of index.
-    sal_uInt16 GetTOIKeys( SwTOIKeyType eTyp, std::vector<OUString>& rArr ) 
const;
+    void GetTOIKeys( SwTOIKeyType eTyp, std::vector<OUString>& rArr ) const;
 
     // Sort table text.
     bool SortTable(const SwSelBoxes& rBoxes, const SwSortOptions&);
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 4806953..ffffb4f 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -79,7 +79,7 @@
 using namespace ::com::sun::star;
 
 
-sal_uInt16 SwDoc::GetTOIKeys( SwTOIKeyType eTyp, std::vector<OUString>& rArr ) 
const
+void SwDoc::GetTOIKeys( SwTOIKeyType eTyp, std::vector<OUString>& rArr ) const
 {
     rArr.clear();
 
@@ -105,8 +105,6 @@ sal_uInt16 SwDoc::GetTOIKeys( SwTOIKeyType eTyp, 
std::vector<OUString>& rArr ) c
                 rArr.push_back( sStr );
         }
     }
-
-    return rArr.size();
 }
 
 /// Get current table of contents Mark.
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to