summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-08-08 09:57:25 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-08-08 13:06:58 +0000
commit602647c2417e0e19e44f9c35a49fbb88ff8ac261 (patch)
treefb56a519ec12c3884a70862272c554c89d3b4b75
parent8f25e553b91f5ed3544c580a450658cc76ffed56 (diff)
loplugin:unnecessaryvirtual
Change-Id: If25d9307efda5f57b0f80a0cf5c2c5cab6a752d6 Reviewed-on: https://gerrit.libreoffice.org/27981 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rwxr-xr-xcompilerplugins/clang/store/unnecessaryvirtual.py28
-rw-r--r--compilerplugins/clang/unnecessaryvirtual.cxx (renamed from compilerplugins/clang/store/unnecessaryvirtual.cxx)4
-rwxr-xr-xcompilerplugins/clang/unnecessaryvirtual.py37
-rw-r--r--dbaccess/source/core/inc/ContentHelper.hxx2
-rw-r--r--editeng/source/accessibility/AccessibleComponentBase.cxx17
-rw-r--r--idlc/inc/astscope.hxx2
-rw-r--r--include/editeng/AccessibleComponentBase.hxx13
-rw-r--r--include/sfx2/objsh.hxx2
-rw-r--r--include/sfx2/templatelocalview.hxx6
-rw-r--r--include/sfx2/thumbnailviewitem.hxx2
-rw-r--r--include/svl/style.hxx2
-rw-r--r--include/svtools/brwbox.hxx1
-rw-r--r--include/svtools/parrtf.hxx4
-rw-r--r--include/tools/stream.hxx2
-rw-r--r--include/vcl/outdev.hxx2
-rw-r--r--io/source/stm/streamhelper.hxx2
-rw-r--r--sfx2/source/notebookbar/DropdownBox.hxx4
-rw-r--r--svtools/source/brwbox/brwbox2.cxx5
-rw-r--r--svtools/source/brwbox/datwin.cxx2
-rw-r--r--svtools/source/inc/svimpbox.hxx2
20 files changed, 55 insertions, 84 deletions
diff --git a/compilerplugins/clang/store/unnecessaryvirtual.py b/compilerplugins/clang/store/unnecessaryvirtual.py
deleted file mode 100755
index e05f16c4d84a..000000000000
--- a/compilerplugins/clang/store/unnecessaryvirtual.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import io
-
-definitionSet = set()
-overridingSet = set()
-
-
-with io.open(sys.argv[1], "rb", buffering=1024*1024) as txt:
- for line in txt:
-
- if line.startswith("definition:\t"):
- idx1 = line.find("\t")
- clazzName = line[idx1+1 : len(line)-1]
- definitionSet.add(clazzName)
-
- elif line.startswith("overriding:\t"):
- idx1 = line.find("\t")
- clazzName = line[idx1+1 : len(line)-1]
- overridingSet.add(clazzName)
-
-for clazz in sorted(definitionSet - overridingSet):
- print clazz
-
-# add an empty line at the end to make it easier for the removevirtuals plugin to mmap() the output file
-print
-
diff --git a/compilerplugins/clang/store/unnecessaryvirtual.cxx b/compilerplugins/clang/unnecessaryvirtual.cxx
index 463fc233e84e..2964748a771c 100644
--- a/compilerplugins/clang/store/unnecessaryvirtual.cxx
+++ b/compilerplugins/clang/unnecessaryvirtual.cxx
@@ -22,7 +22,7 @@ Then we will post-process the 2 lists and find the set of virtual methods which
The process goes something like this:
$ make check
$ make FORCE_COMPILE_ALL=1 COMPILER_PLUGIN_TOOL='unnecessaryvirtual' check
- $ ./compilerplugins/clang/unnecessaryvirtual.py unnecessaryvirtual.log > result.txt
+ $ ./compilerplugins/clang/unnecessaryvirtual.py
$ for dir in *; do make FORCE_COMPILE_ALL=1 UPDATE_FILES=$dir COMPILER_PLUGIN_TOOL='removevirtuals' $dir; done
Note that the actual process may involve a fair amount of undoing, hand editing, and general messing around
@@ -56,7 +56,7 @@ public:
for (const std::string & s : overridingSet)
output += "overriding:\t" + s + "\n";
ofstream myfile;
- myfile.open( SRCDIR "/unnecessaryvirtual.log", ios::app | ios::out);
+ myfile.open( SRCDIR "/loplugin.unnecessaryvirtual.log", ios::app | ios::out);
myfile << output;
myfile.close();
}
diff --git a/compilerplugins/clang/unnecessaryvirtual.py b/compilerplugins/clang/unnecessaryvirtual.py
new file mode 100755
index 000000000000..cd5613771244
--- /dev/null
+++ b/compilerplugins/clang/unnecessaryvirtual.py
@@ -0,0 +1,37 @@
+#!/usr/bin/python
+
+import sys
+import io
+
+definitionSet = set()
+overridingSet = set()
+
+
+with io.open("loplugin.unnecessaryvirtual.log", "rb", buffering=1024*1024) as txt:
+ for line in txt:
+
+ if line.startswith("definition:\t"):
+ idx1 = line.find("\t")
+ clazzName = line[idx1+1 : len(line)-1]
+ definitionSet.add(clazzName)
+
+ elif line.startswith("overriding:\t"):
+ idx1 = line.find("\t")
+ clazzName = line[idx1+1 : len(line)-1]
+ overridingSet.add(clazzName)
+
+with open("loplugin.unnecessaryvirtual.report", "wt") as f:
+ for clazz in sorted(definitionSet - overridingSet):
+ # external code
+ if clazz.startswith("std::"): continue
+ if clazz.startswith("icu_"): continue
+ if clazz.startswith("__cxx"): continue
+ # windows-specific stuff
+ if clazz.startswith("canvas::"): continue
+ if clazz.startswith("psp::PrinterInfoManager"): continue
+ # some test magic
+ if clazz.startswith("apitest::"): continue
+ f.write(clazz + "\n")
+ # add an empty line at the end to make it easier for the removevirtuals plugin to mmap() the output file
+ f.write("\n")
+
diff --git a/dbaccess/source/core/inc/ContentHelper.hxx b/dbaccess/source/core/inc/ContentHelper.hxx
index c83001fe05e3..287e13bc332f 100644
--- a/dbaccess/source/core/inc/ContentHelper.hxx
+++ b/dbaccess/source/core/inc/ContentHelper.hxx
@@ -115,7 +115,7 @@ namespace dbaccess
// helper
virtual void SAL_CALL disposing() override;
- virtual void notifyDataSourceModified();
+ void notifyDataSourceModified();
/**
* This method can be used to propagate changes of property values.
diff --git a/editeng/source/accessibility/AccessibleComponentBase.cxx b/editeng/source/accessibility/AccessibleComponentBase.cxx
index 5feb3d0a1286..495f84f84eef 100644
--- a/editeng/source/accessibility/AccessibleComponentBase.cxx
+++ b/editeng/source/accessibility/AccessibleComponentBase.cxx
@@ -98,23 +98,6 @@ css::awt::Size SAL_CALL AccessibleComponentBase::getSize()
}
-void SAL_CALL AccessibleComponentBase::addFocusListener (
- const css::uno::Reference<
- css::awt::XFocusListener >& /*xListener*/)
- throw (css::uno::RuntimeException)
-{
- // Ignored
-}
-
-
-void SAL_CALL AccessibleComponentBase::removeFocusListener (const css::uno::Reference<
- css::awt::XFocusListener >& /*xListener*/ )
- throw (css::uno::RuntimeException)
-{
- // Ignored
-}
-
-
void SAL_CALL AccessibleComponentBase::grabFocus()
throw (css::uno::RuntimeException, std::exception)
{
diff --git a/idlc/inc/astscope.hxx b/idlc/inc/astscope.hxx
index 9db54d61aa13..7a4e475b34d3 100644
--- a/idlc/inc/astscope.hxx
+++ b/idlc/inc/astscope.hxx
@@ -34,7 +34,7 @@ public:
NodeType getScopeNodeType() const
{ return m_nodeType; }
- virtual AstDeclaration* addDeclaration(AstDeclaration* pDecl);
+ AstDeclaration* addDeclaration(AstDeclaration* pDecl);
sal_uInt32 nMembers() const
{ return (sal_uInt32)(m_declarations.size()); }
diff --git a/include/editeng/AccessibleComponentBase.hxx b/include/editeng/AccessibleComponentBase.hxx
index 929de9591626..c5ae524a858c 100644
--- a/include/editeng/AccessibleComponentBase.hxx
+++ b/include/editeng/AccessibleComponentBase.hxx
@@ -87,19 +87,6 @@ public:
virtual css::awt::Size SAL_CALL getSize()
throw (css::uno::RuntimeException, std::exception) override;
- /** The default implementation ignores this call.
- */
- virtual void SAL_CALL addFocusListener (
- const css::uno::Reference<
- css::awt::XFocusListener >& xListener)
- throw (css::uno::RuntimeException);
-
- /** The default implementation ignores this call.
- */
- virtual void SAL_CALL removeFocusListener (const css::uno::Reference<
- css::awt::XFocusListener >& xListener )
- throw (css::uno::RuntimeException);
-
/** The default implementation does nothing.
*/
virtual void SAL_CALL grabFocus()
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index cc4b74ca0b3e..3c7f9e841000 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -435,7 +435,7 @@ public:
static sal_uInt32 HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDoc );
virtual bool PrepareClose(bool bUI = true);
- virtual bool IsInformationLost();
+ bool IsInformationLost();
virtual HiddenInformation GetHiddenInformationState( HiddenInformation nStates );
sal_Int16 QueryHiddenInformation( HiddenWarningFact eFact, vcl::Window* pParent );
bool IsSecurityOptOpenReadOnly() const;
diff --git a/include/sfx2/templatelocalview.hxx b/include/sfx2/templatelocalview.hxx
index 3db83979706a..f139b2608ac4 100644
--- a/include/sfx2/templatelocalview.hxx
+++ b/include/sfx2/templatelocalview.hxx
@@ -87,13 +87,13 @@ public:
void insertItems (const std::vector<TemplateItemProperties> &rTemplates, bool isRegionSelected = true, bool bShowCategoryInTooltip = false);
// Fill view with template folders thumbnails
- virtual void Populate ();
+ void Populate ();
virtual void reload ();
virtual void showAllTemplates ();
- virtual void showRegion (TemplateContainerItem *pItem);
+ void showRegion (TemplateContainerItem *pItem);
void showRegion (const OUString &rName);
@@ -116,7 +116,7 @@ public:
std::vector<TemplateItemProperties>
getFilteredItems (const std::function<bool (const TemplateItemProperties&) > &rFunc) const;
- virtual sal_uInt16 createRegion (const OUString &rName);
+ sal_uInt16 createRegion (const OUString &rName);
bool renameRegion(const OUString &rTitle, const OUString &rNewTitle);
diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx
index ed3c4231f5e5..b39c1d2d5844 100644
--- a/include/sfx2/thumbnailviewitem.hxx
+++ b/include/sfx2/thumbnailviewitem.hxx
@@ -105,7 +105,7 @@ public:
void setHelpText (const OUString &sText) { maHelpText = sText; }
virtual OUString getHelpText() const { return maHelpText; };
- virtual OUString getTitle() const { return maTitle; };
+ OUString getTitle() const { return maTitle; };
void setTitle (const OUString& rTitle);
diff --git a/include/svl/style.hxx b/include/svl/style.hxx
index b0acd32534ea..c82ff8c9b7b0 100644
--- a/include/svl/style.hxx
+++ b/include/svl/style.hxx
@@ -95,7 +95,7 @@ protected:
SfxStyleSheetBase( const SfxStyleSheetBase& );
virtual ~SfxStyleSheetBase();
virtual void Load( SvStream&, sal_uInt16 );
- virtual void Store( SvStream& );
+ void Store( SvStream& );
public:
diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index 132a55074251..b7d72e9223e4 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -388,7 +388,6 @@ private:
protected:
// callbacks for the data window
virtual void ImplStartTracking();
- virtual void ImplTracking();
virtual void ImplEndTracking();
public:
diff --git a/include/svtools/parrtf.hxx b/include/svtools/parrtf.hxx
index 871dac555ab7..b913a993e684 100644
--- a/include/svtools/parrtf.hxx
+++ b/include/svtools/parrtf.hxx
@@ -53,8 +53,8 @@ protected:
virtual int GetNextToken_() override;
void ReadUnknownData();
- virtual void ReadBitmapData();
- virtual void ReadOLEData();
+ void ReadBitmapData();
+ void ReadOLEData();
virtual ~SvRTFParser();
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index 447543367f96..7d5726a7e986 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -121,7 +121,7 @@ public:
const SvStream * GetStream() const { return m_pStream; }
- virtual void SetSynchronMode(bool bTheSync = true) { m_bSync = bTheSync; }
+ void SetSynchronMode(bool bTheSync = true) { m_bSync = bTheSync; }
bool IsSynchronMode() const { return m_bSync; }
virtual ErrCode ReadAt(sal_uInt64 nPos, void * pBuffer, sal_Size nCount,
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index ff331a5a6913..9bfc0d6b4fc1 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -972,7 +972,7 @@ public:
virtual void Erase( const Rectangle& rRect ) { DrawWallpaper( rRect, GetBackground() ); }
protected:
- virtual void DrawGradientWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
+ void DrawGradientWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
private:
SAL_DLLPRIVATE void DrawWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
diff --git a/io/source/stm/streamhelper.hxx b/io/source/stm/streamhelper.hxx
index a9edbb177a52..519d0e71a7c6 100644
--- a/io/source/stm/streamhelper.hxx
+++ b/io/source/stm/streamhelper.hxx
@@ -47,7 +47,7 @@ public:
sal_Int32 getSize() const throw();
void forgetFromStart(sal_Int32 nBytesToForget) throw(css::io::BufferSizeExceededException);
- virtual void shrink() throw();
+ void shrink() throw();
private:
diff --git a/sfx2/source/notebookbar/DropdownBox.hxx b/sfx2/source/notebookbar/DropdownBox.hxx
index cf6011bae4fb..d0794b327872 100644
--- a/sfx2/source/notebookbar/DropdownBox.hxx
+++ b/sfx2/source/notebookbar/DropdownBox.hxx
@@ -42,8 +42,8 @@ public:
virtual ~DropdownBox() override;
virtual void dispose() override;
- virtual void HideContent();
- virtual void ShowContent();
+ void HideContent();
+ void ShowContent();
private:
DECL_LINK_TYPED(PBClickHdl, Button*, void);
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index 45fa1c448e79..5245edcb1cd1 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -191,11 +191,6 @@ void BrowseBox::ImplStartTracking()
}
-void BrowseBox::ImplTracking()
-{
-}
-
-
void BrowseBox::ImplEndTracking()
{
}
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index 392140b2833f..ceb5c3acf2f4 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -559,8 +559,6 @@ void BrowserDataWin::Tracking( const TrackingEvent& rTEvt )
}
else
{
- GetParent()->ImplTracking();
-
long nDragRowDividerCurrentPos = aMousePos.Y() + m_nDragRowDividerOffset;
// care for minimum row height
diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx
index 5c1814276572..7ba18dadf17f 100644
--- a/svtools/source/inc/svimpbox.hxx
+++ b/svtools/source/inc/svimpbox.hxx
@@ -276,7 +276,7 @@ public:
virtual void UpdateAll( bool bInvalidateCompleteView );
void SetEntryHeight( short nHeight );
void InvalidateEntry( SvTreeListEntry* );
- virtual void RecalcFocusRect();
+ void RecalcFocusRect();
void SelectEntry( SvTreeListEntry* pEntry, bool bSelect );
void SetDragDropMode( DragDropMode eDDMode );