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