[Libreoffice-commits] core.git: compilerplugins/clang include/linguistic include/svx include/vcl sc/inc vcl/inc
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Thu Dec 12 12:12:39 UTC 2019
compilerplugins/clang/finalclasses.py | 18 ++++++++++++++++++
include/linguistic/lngprophelp.hxx | 14 ++++++--------
include/svx/polygn3d.hxx | 3 +--
include/svx/rulritem.hxx | 4 ++--
include/svx/sdr/table/tablecontroller.hxx | 4 ++--
include/vcl/threadex.hxx | 2 +-
include/vcl/toolkit/fixedhyper.hxx | 3 +--
include/vcl/toolkit/spin.hxx | 2 +-
sc/inc/refhint.hxx | 2 +-
vcl/inc/iconview.hxx | 2 +-
vcl/inc/opengl/x11/cairotextrender.hxx | 2 +-
vcl/inc/skia/salbmp.hxx | 2 +-
vcl/inc/skia/x11/cairotextrender.hxx | 2 +-
vcl/inc/skia/x11/gdiimpl.hxx | 5 +++--
vcl/inc/svimpbox.hxx | 2 +-
15 files changed, 41 insertions(+), 26 deletions(-)
New commits:
commit 36b90e6c23fc846c9a8b4ddbd74688b2b5cc4705
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Dec 11 12:11:44 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Dec 12 13:11:16 2019 +0100
loplugin:finalclasses
Change-Id: Ia9865271cf0a75ebf4b885ff376f7d0a152b2555
Reviewed-on: https://gerrit.libreoffice.org/84925
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/compilerplugins/clang/finalclasses.py b/compilerplugins/clang/finalclasses.py
index f6c15ca2c87d..ea027f9a48b4 100755
--- a/compilerplugins/clang/finalclasses.py
+++ b/compilerplugins/clang/finalclasses.py
@@ -40,6 +40,24 @@ for clazz in sorted(definitionSet - inheritFromSet):
# ignore test and external code
if ("/qa/" in file): continue
if (file.startswith("workdir/")): continue
+ # We are only realling interested in classes that are shared between linkage units, where the compiler
+ # is not able to figure out for itself that classes are final.
+ if not(file.startswith("include/") or file.startswith("sw/inc/") or file.startswith("sc/inc/") or file.startswith("vcl/inc/")): continue
+ # Exclude URE
+ if file.startswith("include/com/"): continue
+ if file.startswith("include/cppu/"): continue
+ if file.startswith("include/cppuhelper/"): continue
+ if file.startswith("include/osl/"): continue
+ if file.startswith("include/rtl/"): continue
+ if file.startswith("include/sal/"): continue
+ if file.startswith("include/salhelper/"): continue
+ if file.startswith("include/systools/"): continue
+ if file.startswith("include/typelib/"): continue
+ if file.startswith("include/uno/"): continue
+ # some kind of template noise
+ if file.startswith("include/unotest/"): continue
+ # no point optimising test code
+ if file.startswith("include/test/"): continue
tmpset.add((clazz, file))
# sort the results using a "natural order" so sequences like [item1,item2,item10] sort nicely
diff --git a/include/linguistic/lngprophelp.hxx b/include/linguistic/lngprophelp.hxx
index f05481019704..19cbe1f969ac 100644
--- a/include/linguistic/lngprophelp.hxx
+++ b/include/linguistic/lngprophelp.hxx
@@ -57,7 +57,7 @@ typedef cppu::WeakImplHelper
css::linguistic2::XLinguServiceEventBroadcaster
> PropertyChgHelperBase;
-class PropertyChgHelper :
+class LNG_DLLPUBLIC PropertyChgHelper :
public PropertyChgHelperBase
{
css::uno::Sequence< OUString > aPropNames;
@@ -118,8 +118,8 @@ public:
const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >& rxListener ) override;
// non-UNO functions
- void LNG_DLLPUBLIC AddAsPropListener();
- void LNG_DLLPUBLIC RemoveAsPropListener();
+ void AddAsPropListener();
+ void RemoveAsPropListener();
void LaunchEvent( const css::linguistic2::LinguServiceEvent& rEvt );
const css::uno::Sequence< OUString > &
@@ -131,7 +131,7 @@ public:
};
-class PropertyHelper_Thes :
+class PropertyHelper_Thes final :
public PropertyChgHelper
{
PropertyHelper_Thes( const PropertyHelper_Thes & ) = delete;
@@ -167,7 +167,7 @@ public:
};
-class LNG_DLLPUBLIC PropertyHelper_Spell :
+class LNG_DLLPUBLIC PropertyHelper_Spell final :
public PropertyChgHelper
{
// default values
@@ -183,7 +183,6 @@ class LNG_DLLPUBLIC PropertyHelper_Spell :
PropertyHelper_Spell( const PropertyHelper_Spell & ) = delete;
PropertyHelper_Spell & operator = ( const PropertyHelper_Spell & ) = delete;
-protected:
// PropertyChgHelper
virtual void SetDefaultValues() override;
virtual void GetCurrentValues() override;
@@ -237,7 +236,7 @@ public:
};
-class PropertyHelper_Hyphen :
+class PropertyHelper_Hyphen final :
public PropertyChgHelper
{
// default values
@@ -255,7 +254,6 @@ class PropertyHelper_Hyphen :
PropertyHelper_Hyphen( const PropertyHelper_Hyphen & ) = delete;
PropertyHelper_Hyphen & operator = ( const PropertyHelper_Hyphen & ) = delete;
-protected:
// PropertyChgHelper
virtual void SetDefaultValues() override;
virtual void GetCurrentValues() override;
diff --git a/include/svx/polygn3d.hxx b/include/svx/polygn3d.hxx
index f01bd18a692e..8dc2a124afb4 100644
--- a/include/svx/polygn3d.hxx
+++ b/include/svx/polygn3d.hxx
@@ -23,7 +23,7 @@
#include <svx/obj3d.hxx>
#include <svx/svxdllapi.h>
-class SVX_DLLPUBLIC E3dPolygonObj : public E3dCompoundObject
+class SVX_DLLPUBLIC E3dPolygonObj final : public E3dCompoundObject
{
// parameters
basegfx::B3DPolyPolygon aPolyPoly3D;
@@ -34,7 +34,6 @@ class SVX_DLLPUBLIC E3dPolygonObj : public E3dCompoundObject
SVX_DLLPRIVATE void CreateDefaultNormals();
SVX_DLLPRIVATE void CreateDefaultTexture();
-protected:
virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
// protected destructor
diff --git a/include/svx/rulritem.hxx b/include/svx/rulritem.hxx
index 25e1ce88be92..7b7a33b8e8fc 100644
--- a/include/svx/rulritem.hxx
+++ b/include/svx/rulritem.hxx
@@ -82,12 +82,12 @@ public:
void SetLower(long lArgRight);
};
-class SVX_DLLPUBLIC SvxPagePosSizeItem : public SfxPoolItem
+class SVX_DLLPUBLIC SvxPagePosSizeItem final : public SfxPoolItem
{
Point aPos;
long lWidth;
long lHeight;
-protected:
+
virtual bool operator==( const SfxPoolItem& ) const override;
virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
diff --git a/include/svx/sdr/table/tablecontroller.hxx b/include/svx/sdr/table/tablecontroller.hxx
index 8359a15c4dbe..3570cff6f56d 100644
--- a/include/svx/sdr/table/tablecontroller.hxx
+++ b/include/svx/sdr/table/tablecontroller.hxx
@@ -39,7 +39,7 @@ namespace sdr { namespace table {
class TableModel;
-class SVX_DLLPUBLIC SvxTableController : public sdr::SelectionController
+class SVX_DLLPUBLIC SvxTableController final : public sdr::SelectionController
{
public:
SVX_DLLPRIVATE SvxTableController(
@@ -59,7 +59,7 @@ public:
SVX_DLLPRIVATE virtual void onSelectionHasChanged() override;
SVX_DLLPRIVATE virtual void GetState( SfxItemSet& rSet ) override;
- SVX_DLLPRIVATE virtual void Execute( SfxRequest& rReq ) override;
+ virtual void Execute( SfxRequest& rReq ) override;
SVX_DLLPRIVATE virtual bool GetStyleSheet( SfxStyleSheet* &rpStyleSheet ) const override;
SVX_DLLPRIVATE virtual bool SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr ) override;
diff --git a/include/vcl/threadex.hxx b/include/vcl/threadex.hxx
index ceb3354556a8..39c1633d2054 100644
--- a/include/vcl/threadex.hxx
+++ b/include/vcl/threadex.hxx
@@ -90,7 +90,7 @@ private:
};
template <typename FuncT>
-class GenericSolarThreadExecutor<FuncT, void> : public SolarThreadExecutor
+class GenericSolarThreadExecutor<FuncT, void> final : public SolarThreadExecutor
{
public:
static void exec( FuncT const& func )
diff --git a/include/vcl/toolkit/fixedhyper.hxx b/include/vcl/toolkit/fixedhyper.hxx
index 9eb1af116e5e..15434485b06a 100644
--- a/include/vcl/toolkit/fixedhyper.hxx
+++ b/include/vcl/toolkit/fixedhyper.hxx
@@ -27,7 +27,7 @@
#include <vcl/dllapi.h>
#include <vcl/fixed.hxx>
-class VCL_DLLPUBLIC FixedHyperlink : public FixedText
+class VCL_DLLPUBLIC FixedHyperlink final : public FixedText
{
private:
long m_nTextLen;
@@ -46,7 +46,6 @@ private:
DECL_LINK(HandleClick, FixedHyperlink&, void);
-protected:
/** overwrites Window::MouseMove().
Changes the pointer only over the text.
diff --git a/include/vcl/toolkit/spin.hxx b/include/vcl/toolkit/spin.hxx
index 0483aef2e980..60f548e3b2b5 100644
--- a/include/vcl/toolkit/spin.hxx
+++ b/include/vcl/toolkit/spin.hxx
@@ -28,7 +28,7 @@
#include <vcl/ctrl.hxx>
#include <vcl/timer.hxx>
-class VCL_DLLPUBLIC SpinButton : public Control
+class VCL_DLLPUBLIC SpinButton final : public Control
{
private:
AutoTimer maRepeatTimer;
diff --git a/sc/inc/refhint.hxx b/sc/inc/refhint.hxx
index 7dec98a9e4a0..a312ec5b2842 100644
--- a/sc/inc/refhint.hxx
+++ b/sc/inc/refhint.hxx
@@ -69,7 +69,7 @@ public:
SCROW getEndRow() const;
};
-class RefRowReorderHint : public RefHint
+class RefRowReorderHint final : public RefHint
{
const sc::ColRowReorderMapType& mrRowMap;
SCTAB const mnTab;
diff --git a/vcl/inc/iconview.hxx b/vcl/inc/iconview.hxx
index 750f7ec6ebf0..ebc60f08aa23 100644
--- a/vcl/inc/iconview.hxx
+++ b/vcl/inc/iconview.hxx
@@ -22,7 +22,7 @@
#include <vcl/treelistbox.hxx>
-class IconView : public SvTreeListBox
+class IconView final : public SvTreeListBox
{
public:
IconView( vcl::Window* pParent, WinBits nBits );
diff --git a/vcl/inc/opengl/x11/cairotextrender.hxx b/vcl/inc/opengl/x11/cairotextrender.hxx
index c515b90da732..137022fa847b 100644
--- a/vcl/inc/opengl/x11/cairotextrender.hxx
+++ b/vcl/inc/opengl/x11/cairotextrender.hxx
@@ -12,7 +12,7 @@
#include <unx/x11/x11cairotextrender.hxx>
-class OpenGLX11CairoTextRender : public X11CairoTextRender
+class OpenGLX11CairoTextRender final : public X11CairoTextRender
{
public:
explicit OpenGLX11CairoTextRender(X11SalGraphics& rParent);
diff --git a/vcl/inc/skia/salbmp.hxx b/vcl/inc/skia/salbmp.hxx
index 4e4aebf4f978..df3664f26f1c 100644
--- a/vcl/inc/skia/salbmp.hxx
+++ b/vcl/inc/skia/salbmp.hxx
@@ -24,7 +24,7 @@
#include <SkImage.h>
-class VCL_PLUGIN_PUBLIC SkiaSalBitmap : public SalBitmap
+class VCL_PLUGIN_PUBLIC SkiaSalBitmap final : public SalBitmap
{
public:
SkiaSalBitmap();
diff --git a/vcl/inc/skia/x11/cairotextrender.hxx b/vcl/inc/skia/x11/cairotextrender.hxx
index 766f94d484a1..947657a499cd 100644
--- a/vcl/inc/skia/x11/cairotextrender.hxx
+++ b/vcl/inc/skia/x11/cairotextrender.hxx
@@ -12,7 +12,7 @@
#include <unx/x11/x11cairotextrender.hxx>
-class SkiaX11CairoTextRender : public X11CairoTextRender
+class SkiaX11CairoTextRender final : public X11CairoTextRender
{
public:
explicit SkiaX11CairoTextRender(X11SalGraphics& rParent);
diff --git a/vcl/inc/skia/x11/gdiimpl.hxx b/vcl/inc/skia/x11/gdiimpl.hxx
index 4d88740b8ba9..ad131f64c973 100644
--- a/vcl/inc/skia/x11/gdiimpl.hxx
+++ b/vcl/inc/skia/x11/gdiimpl.hxx
@@ -16,7 +16,8 @@
#include <unx/x11/x11gdiimpl.h>
#include <skia/gdiimpl.hxx>
-class VCL_PLUGIN_PUBLIC X11SkiaSalGraphicsImpl : public SkiaSalGraphicsImpl, public X11GraphicsImpl
+class VCL_PLUGIN_PUBLIC X11SkiaSalGraphicsImpl final : public SkiaSalGraphicsImpl,
+ public X11GraphicsImpl
{
private:
X11SalGraphics& mX11Parent;
@@ -29,7 +30,7 @@ public:
virtual void DeInit() override;
virtual void freeResources() override;
-protected:
+private:
virtual void createWindowContext() override;
virtual void performFlush() override;
virtual bool avoidRecreateByResize() const override;
diff --git a/vcl/inc/svimpbox.hxx b/vcl/inc/svimpbox.hxx
index e40bf234cddd..5a3ddf140b9e 100644
--- a/vcl/inc/svimpbox.hxx
+++ b/vcl/inc/svimpbox.hxx
@@ -44,7 +44,7 @@ namespace comphelper
}
}
-class ImpLBSelEng : public FunctionSet
+class ImpLBSelEng final : public FunctionSet
{
SvImpLBox* pImp;
VclPtr<SvTreeListBox> pView;
More information about the Libreoffice-commits
mailing list