Kaydet (Commit) 4162339a authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:unnecessaryvirtual improve result output

and merge some of the template function results

Change-Id: I9a7855ce6720d022ea5b988d68f0d59ff81ee5b9
Reviewed-on: https://gerrit.libreoffice.org/51985Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 0d06d1d1
......@@ -38,8 +38,8 @@ protected:
virtual bool IsEnabled() override;
virtual bool IsVisible() override;
virtual void Select();
virtual void DeSelect();
void Select();
void DeSelect();
virtual void Click() override;
void SetItemPos( sal_uInt16 nItemPos );
......
......@@ -130,7 +130,7 @@ public:
/**
* Determine the screen positions of all ticks based on their numeric values.
*/
virtual void updateScreenValues( TickInfoArraysType& rAllTickInfos ) const;
void updateScreenValues( TickInfoArraysType& rAllTickInfos ) const;
bool isHorizontalAxis() const;
bool isVerticalAxis() const;
......
......@@ -79,18 +79,20 @@ private:
std::string toString(SourceLocation loc);
};
std::string niceName(const CXXMethodDecl* functionDecl)
std::string niceName(const CXXMethodDecl* cxxMethodDecl)
{
std::string s =
functionDecl->getParent()->getQualifiedNameAsString() + "::"
+ functionDecl->getReturnType().getAsString() + "-"
+ functionDecl->getNameAsString() + "(";
for (const ParmVarDecl *pParmVarDecl : compat::parameters(*functionDecl)) {
s += pParmVarDecl->getType().getAsString();
while (cxxMethodDecl->getTemplateInstantiationPattern())
cxxMethodDecl = dyn_cast<CXXMethodDecl>(cxxMethodDecl->getTemplateInstantiationPattern());
while (cxxMethodDecl->getInstantiatedFromMemberFunction())
cxxMethodDecl = dyn_cast<CXXMethodDecl>(cxxMethodDecl->getInstantiatedFromMemberFunction());
std::string s = cxxMethodDecl->getReturnType().getCanonicalType().getAsString()
+ " " + cxxMethodDecl->getQualifiedNameAsString() + "(";
for (const ParmVarDecl *pParmVarDecl : compat::parameters(*cxxMethodDecl)) {
s += pParmVarDecl->getType().getCanonicalType().getAsString();
s += ",";
}
s += ")";
if (functionDecl->isConst()) {
if (cxxMethodDecl->isConst()) {
s += "const";
}
return s;
......
......@@ -43,10 +43,17 @@ for clazz in (definitionSet - overridingSet):
if clazz == "GtkSalDisplay::int-CaptureMouse(class SalFrame *,)": continue
# some test magic
if clazz.startswith("apitest::"): continue
loc = definitionToSourceLocationMap[clazz]
# ignore external code
if definitionToSourceLocationMap[clazz].startswith("external/"): continue
if loc.startswith("external/"): continue
# there is a bunch of Windows specific code that we don't see
if loc.startswith("include/canvas/"): continue
# not sure what the problem is here
if loc.startswith("include/test/"): continue
unnecessaryVirtualSet.add((clazz,definitionToSourceLocationMap[clazz] ))
unnecessaryVirtualSet.add( (clazz,loc) )
# sort the results using a "natural order" so sequences like [item1,item2,item10] sort nicely
......
......@@ -188,18 +188,17 @@ bool VirtualDown::TraverseCXXDeductionGuideDecl(CXXDeductionGuideDecl* f)
}
#endif
std::string VirtualDown::niceName(const CXXMethodDecl* functionDecl)
std::string VirtualDown::niceName(const CXXMethodDecl* cxxMethodDecl)
{
// return type not necessary, since we cannot have two otherwise identical functions
// with different return types
std::string s = functionDecl->getQualifiedNameAsString() + "(";
for (const ParmVarDecl* pParmVarDecl : compat::parameters(*functionDecl))
std::string s = cxxMethodDecl->getReturnType().getCanonicalType().getAsString() + " "
+ cxxMethodDecl->getQualifiedNameAsString() + "(";
for (const ParmVarDecl* pParmVarDecl : compat::parameters(*cxxMethodDecl))
{
s += pParmVarDecl->getType().getCanonicalType().getAsString();
s += ",";
}
s += ")";
if (functionDecl->isConst())
if (cxxMethodDecl->isConst())
{
s += "const";
}
......
......@@ -70,7 +70,7 @@ namespace dbaccess
virtual void SAL_CALL getFastPropertyValue( css::uno::Any& rValue, sal_Int32 nHandle ) const override;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const css::uno::Any& rValue ) override;
virtual void fireValueChange(const ::connectivity::ORowSetValue& _rOldValue);
void fireValueChange(const ::connectivity::ORowSetValue& _rOldValue);
protected:
using ODataColumn::getFastPropertyValue;
};
......
......@@ -185,10 +185,11 @@ namespace dbaccess
virtual bool rowUpdated( ) override;
virtual bool rowInserted( ) override;
virtual bool rowDeleted( ) override;
bool isBeforeFirst( );
bool isAfterLast( );
// css::sdbc::XResultSet
virtual bool next() override;
virtual bool isBeforeFirst( );
virtual bool isAfterLast( );
virtual void beforeFirst( ) override;
virtual void afterLast( ) override;
virtual bool first() override;
......
......@@ -235,7 +235,7 @@ namespace dbaccess
virtual bool notifyAllListenersCursorBeforeMove(::osl::ResettableMutexGuard& _rGuard) override;
virtual void notifyAllListenersCursorMoved(::osl::ResettableMutexGuard& _rGuard) override;
// notify all that rowset changed
virtual void notifyAllListeners(::osl::ResettableMutexGuard& _rGuard);
void notifyAllListeners(::osl::ResettableMutexGuard& _rGuard);
virtual void doCancelModification( ) override;
virtual bool isModification( ) override;
......
......@@ -51,10 +51,11 @@ namespace dbaccess
virtual bool hasOrderedBookmarks( ) override;
virtual sal_Int32 hashBookmark( const css::uno::Any& bookmark ) override;
bool isBeforeFirst( );
bool isAfterLast( );
// css::sdbc::XResultSet
virtual bool next() override;
virtual bool isBeforeFirst( );
virtual bool isAfterLast( );
virtual void beforeFirst( ) override;
virtual void afterLast( ) override;
virtual bool first() override;
......
......@@ -43,7 +43,7 @@ namespace dbaccess
);
virtual ~StorageXMLOutputStream() override;
virtual void close();
void close();
void addAttribute( const OUString& i_rName, const OUString& i_rValue ) const;
......
......@@ -46,7 +46,7 @@ namespace dbaui
bool IsSourcePrimKey() const { return checkPrimaryKey(getReferencingTable()->getTable(),JTCS_FROM); }
bool IsDestPrimKey() const { return checkPrimaryKey(getReferencedTable()->getTable(),JTCS_TO); }
virtual OConnectionLineDataRef CreateLineDataObj();
OConnectionLineDataRef CreateLineDataObj();
ORelationTableConnectionData& operator=( const ORelationTableConnectionData& rConnData );
public:
......
......@@ -203,9 +203,10 @@ namespace dbaui
virtual void SAL_CALL changedDatabaseLocation( const css::sdb::DatabaseRegistrationEvent& Event ) override;
private:
// SbaXDataBrowserController overridables
// SbaXDataBrowserController overridable
virtual bool InitializeForm( const css::uno::Reference< css::beans::XPropertySet >& i_formProperties ) override;
virtual void InitializeGridModel(const css::uno::Reference< css::form::XFormComponent > & xGrid);
void InitializeGridModel(const css::uno::Reference< css::form::XFormComponent > & xGrid);
virtual bool preReloadForm() override;
virtual void postReloadForm() override;
......
......@@ -33,7 +33,7 @@ namespace dbaui
bool m_bNatural;
// for creation and duplication of lines of own type
virtual OConnectionLineDataRef CreateLineDataObj();
OConnectionLineDataRef CreateLineDataObj();
OQueryTableConnectionData& operator=( const OQueryTableConnectionData& rConnData );
public:
......
......@@ -156,7 +156,7 @@ struct DateCode: public HBox
DateCode();
virtual bool Read(HWPFile &hwpf) override;
virtual hchar_string GetString();
hchar_string GetString();
};
/**
......@@ -831,7 +831,7 @@ struct MailMerge: public HBox
MailMerge();
virtual bool Read(HWPFile &hwpf) override;
virtual hchar_string GetString();
hchar_string GetString();
};
// char composition(23)
......
......@@ -926,7 +926,7 @@ public:
bIsEndFixed = mpDVR->IsEndFixed();
}
virtual std::string GenSlidingWindowDeclRef( bool nested = false ) const
std::string GenSlidingWindowDeclRef( bool nested = false ) const
{
size_t nArrayLength = mpDVR->GetArrayLength();
std::stringstream ss;
......@@ -949,7 +949,7 @@ public:
return ss.str();
}
/// Controls how the elements in the DoubleVectorRef are traversed
virtual size_t GenReductionLoopHeader(
size_t GenReductionLoopHeader(
std::stringstream& ss, bool& needBody )
{
assert(mpDVR);
......@@ -1187,7 +1187,7 @@ public:
bIsEndFixed = mpDVR->IsEndFixed();
}
/// Controls how the elements in the DoubleVectorRef are traversed
virtual size_t GenReductionLoopHeader(
size_t GenReductionLoopHeader(
std::stringstream& ss, int nResultSize, bool& needBody )
{
assert(mpDVR);
......
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