Kaydet (Commit) 1c15a20d authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

loplugin:unusedmethods unused returns

Change-Id: I4da3374e31d3c7407b401d66275da7f56ae83d30
Reviewed-on: https://gerrit.libreoffice.org/29178Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 875c5905
...@@ -51,8 +51,6 @@ namespace oglcanvas ...@@ -51,8 +51,6 @@ namespace oglcanvas
const css::geometry::IntegerSize2D& getSize() { return maSize; } const css::geometry::IntegerSize2D& getSize() { return maSize; }
css::uno::Reference< css::rendering::XBitmapCanvas > queryBitmapCanvas();
css::uno::Reference< css::rendering::XBitmap > css::uno::Reference< css::rendering::XBitmap >
getScaledBitmap( const css::geometry::RealSize2D& newSize, getScaledBitmap( const css::geometry::RealSize2D& newSize,
bool beFast ); bool beFast );
......
...@@ -82,8 +82,6 @@ namespace vclcanvas ...@@ -82,8 +82,6 @@ namespace vclcanvas
css::geometry::IntegerSize2D getSize(); css::geometry::IntegerSize2D getSize();
void queryBitmapCanvas();
css::uno::Reference< css::rendering::XBitmap > css::uno::Reference< css::rendering::XBitmap >
getScaledBitmap( const css::geometry::RealSize2D& newSize, getScaledBitmap( const css::geometry::RealSize2D& newSize,
bool beFast ); bool beFast );
......
...@@ -235,8 +235,6 @@ namespace vclcanvas ...@@ -235,8 +235,6 @@ namespace vclcanvas
css::geometry::IntegerSize2D getSize(); css::geometry::IntegerSize2D getSize();
void queryBitmapCanvas();
css::uno::Reference< css::rendering::XBitmap > css::uno::Reference< css::rendering::XBitmap >
getScaledBitmap( const css::geometry::RealSize2D& newSize, getScaledBitmap( const css::geometry::RealSize2D& newSize,
bool beFast ); bool beFast );
......
...@@ -263,7 +263,9 @@ gotfunc: ...@@ -263,7 +263,9 @@ gotfunc:
{ {
const FunctionDecl* parentFunction = parentFunctionDecl(expr); const FunctionDecl* parentFunction = parentFunctionDecl(expr);
if (parentFunction && parentFunction != calleeFunctionDecl) { if (parentFunction && parentFunction != calleeFunctionDecl) {
calledFromOutsideSet.insert(niceName(parentFunction)); if (!ignoreLocation(parentFunction)) {
calledFromOutsideSet.insert(niceName(parentFunction));
}
} }
} }
......
...@@ -154,7 +154,7 @@ with io.open("loplugin.unusedmethods.log", "rb", buffering=1024*1024) as txt: ...@@ -154,7 +154,7 @@ with io.open("loplugin.unusedmethods.log", "rb", buffering=1024*1024) as txt:
returnType = tokens[1] returnType = tokens[1]
nameAndParams = tokens[2] nameAndParams = tokens[2]
usedReturnSet.add((normalizeTypeParams(returnType), normalizeTypeParams(nameAndParams))) usedReturnSet.add((normalizeTypeParams(returnType), normalizeTypeParams(nameAndParams)))
elif tokens[0] == "calledFromOutsideSet:": elif tokens[0] == "outside:":
returnType = tokens[1] returnType = tokens[1]
nameAndParams = tokens[2] nameAndParams = tokens[2]
calledFromOutsideSet.add((normalizeTypeParams(returnType), normalizeTypeParams(nameAndParams))) calledFromOutsideSet.add((normalizeTypeParams(returnType), normalizeTypeParams(nameAndParams)))
...@@ -315,7 +315,22 @@ for d in definitionSet: ...@@ -315,7 +315,22 @@ for d in definitionSet:
# ignore the SfxPoolItem CreateDefault methods for now # ignore the SfxPoolItem CreateDefault methods for now
if d[1].endswith("::CreateDefault()"): if d[1].endswith("::CreateDefault()"):
continue 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 # print output, sorted by name and line number
with open("loplugin.unusedmethods.report-returns", "wt") as f: with open("loplugin.unusedmethods.report-returns", "wt") as f:
......
...@@ -61,7 +61,7 @@ namespace connectivity ...@@ -61,7 +61,7 @@ namespace connectivity
LoadXPToolkitProfiles(MozillaProductType_Firefox); LoadXPToolkitProfiles(MozillaProductType_Firefox);
} }
//Thunderbird and firefox profiles are saved in profiles.ini //Thunderbird and firefox profiles are saved in profiles.ini
sal_Int32 ProfileAccess::LoadXPToolkitProfiles(MozillaProductType product) void ProfileAccess::LoadXPToolkitProfiles(MozillaProductType product)
{ {
sal_Int32 index=product; sal_Int32 index=product;
ProductStruct &rProduct = m_ProductProfileList[index]; ProductStruct &rProduct = m_ProductProfileList[index];
...@@ -137,7 +137,6 @@ namespace connectivity ...@@ -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) OUString ProfileAccess::getProfilePath( css::mozilla::MozillaProductType product, const OUString& profileName ) throw (css::uno::RuntimeException)
......
...@@ -80,7 +80,7 @@ namespace connectivity ...@@ -80,7 +80,7 @@ namespace connectivity
protected: protected:
ProductStruct m_ProductProfileList[4]; ProductStruct m_ProductProfileList[4];
void LoadProductsInfo(); void LoadProductsInfo();
sal_Int32 LoadXPToolkitProfiles(MozillaProductType product); void LoadXPToolkitProfiles(MozillaProductType product);
}; };
} }
......
...@@ -682,7 +682,7 @@ bool IconChoiceDialog::OK_Impl() ...@@ -682,7 +682,7 @@ bool IconChoiceDialog::OK_Impl()
} }
short IconChoiceDialog::Ok() void IconChoiceDialog::Ok()
{ {
bInOK = true; bInOK = true;
...@@ -693,7 +693,6 @@ short IconChoiceDialog::Ok() ...@@ -693,7 +693,6 @@ short IconChoiceDialog::Ok()
else if ( pExampleSet ) else if ( pExampleSet )
pOutSet = new SfxItemSet( *pExampleSet ); pOutSet = new SfxItemSet( *pExampleSet );
} }
bool _bModified = false;
for ( size_t i = 0, nCount = maPageList.size(); i < nCount; ++i ) for ( size_t i = 0, nCount = maPageList.size(); i < nCount; ++i )
{ {
...@@ -709,18 +708,12 @@ short IconChoiceDialog::Ok() ...@@ -709,18 +708,12 @@ short IconChoiceDialog::Ok()
if ( pPage->FillItemSet( &aTmp ) ) if ( pPage->FillItemSet( &aTmp ) )
{ {
_bModified = true;
pExampleSet->Put( aTmp ); pExampleSet->Put( aTmp );
pOutSet->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 ) void IconChoiceDialog::FocusOnIcon( sal_uInt16 nId )
......
...@@ -146,7 +146,7 @@ protected: ...@@ -146,7 +146,7 @@ protected:
void DeActivatePageImpl (); void DeActivatePageImpl ();
void ResetPageImpl (); void ResetPageImpl ();
short Ok(); void Ok();
public: public:
......
...@@ -35,13 +35,6 @@ namespace comphelper ...@@ -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, // SvNumberFormatsSupplierObj: aggregate to document,
// construct with SvNumberFormatter // construct with SvNumberFormatter
......
...@@ -995,7 +995,7 @@ public: ...@@ -995,7 +995,7 @@ public:
void SetDefaultTOXBase(const SwTOXBase& rBase); void SetDefaultTOXBase(const SwTOXBase& rBase);
// Key for management of index. // 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. // Sort table text.
bool SortTable(const SwSelBoxes& rBoxes, const SwSortOptions&); bool SortTable(const SwSelBoxes& rBoxes, const SwSortOptions&);
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
using namespace ::com::sun::star; 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(); rArr.clear();
...@@ -105,8 +105,6 @@ sal_uInt16 SwDoc::GetTOIKeys( SwTOIKeyType eTyp, std::vector<OUString>& rArr ) c ...@@ -105,8 +105,6 @@ sal_uInt16 SwDoc::GetTOIKeys( SwTOIKeyType eTyp, std::vector<OUString>& rArr ) c
rArr.push_back( sStr ); rArr.push_back( sStr );
} }
} }
return rArr.size();
} }
/// Get current table of contents Mark. /// Get current table of contents Mark.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment