diff options
author | Noel Grandin <noel@peralex.com> | 2016-09-22 13:12:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-22 13:13:05 +0000 |
commit | 1c15a20df81fef594ef8fa887247aef9f2248c28 (patch) | |
tree | c2308bf3962efdc44d0391b26eaddb3b1155ae1f | |
parent | 875c5905c71635c8e75d0756cc86d953523726e2 (diff) |
loplugin:unusedmethods unused returns
Change-Id: I4da3374e31d3c7407b401d66275da7f56ae83d30
Reviewed-on: https://gerrit.libreoffice.org/29178
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | canvas/source/opengl/ogl_bitmapcanvashelper.hxx | 2 | ||||
-rw-r--r-- | canvas/source/vcl/canvasbitmaphelper.hxx | 2 | ||||
-rw-r--r-- | canvas/source/vcl/canvashelper.hxx | 2 | ||||
-rw-r--r-- | compilerplugins/clang/unusedmethods.cxx | 4 | ||||
-rwxr-xr-x | compilerplugins/clang/unusedmethods.py | 19 | ||||
-rw-r--r-- | connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/iconcdlg.cxx | 9 | ||||
-rw-r--r-- | cui/source/inc/iconcdlg.hxx | 2 | ||||
-rw-r--r-- | include/svl/numuno.hxx | 7 | ||||
-rw-r--r-- | sw/inc/doc.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/doctxm.cxx | 4 |
12 files changed, 26 insertions, 32 deletions
diff --git a/canvas/source/opengl/ogl_bitmapcanvashelper.hxx b/canvas/source/opengl/ogl_bitmapcanvashelper.hxx index 7b3722c84dd2..b55eb4576ee9 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 1b7cf7fde2c8..a83e26b9e906 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 11c06c5afcdf..268f3be30de2 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 a8a94a7c4b48..c16b446e5648 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 6f679449172e..fb9412b20e13 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 7fb917f23208..9f4ca1c9c1c2 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 7472fc226573..d2eed6c7c67a 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 3e38e4da4bf1..d104557001f4 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 6f9eda810afd..eb8a7432f576 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 6fc990791d6b..3a3aecc17065 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 3329c07c617d..45d9e2927a82 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 480695333331..ffffb4fc16bf 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. |