chart2/source/controller/inc/SelectionHelper.hxx     |    2 +-
 chart2/source/controller/inc/res_ErrorBar.hxx        |    2 +-
 chart2/source/view/inc/MinimumAndMaximumSupplier.hxx |    2 +-
 cppuhelper/source/weak.cxx                           |    2 +-
 forms/source/inc/property.hxx                        |    2 --
 include/comphelper/propertybag.hxx                   |    2 +-
 include/connectivity/sqlparse.hxx                    |    2 +-
 include/dbaccess/dbaundomanager.hxx                  |    2 +-
 include/oox/export/chartexport.hxx                   |    1 -
 include/sfx2/frame.hxx                               |    2 +-
 include/svtools/javacontext.hxx                      |    2 +-
 include/svtools/javainteractionhandler.hxx           |    2 +-
 include/svx/sdrmasterpagedescriptor.hxx              |    2 +-
 include/svx/svdmark.hxx                              |    2 +-
 include/vcl/filter/pdfdocument.hxx                   |    2 +-
 sc/inc/funcdesc.hxx                                  |    5 ++---
 sd/inc/shapelist.hxx                                 |    2 +-
 sd/source/ui/inc/TemplateScanner.hxx                 |    2 +-
 sfx2/source/inc/objshimp.hxx                         |    2 +-
 starmath/inc/visitors.hxx                            |    7 +------
 svx/inc/sdr/properties/cellproperties.hxx            |    2 +-
 svx/source/inc/fmtextcontrolshell.hxx                |    2 +-
 sw/inc/printdata.hxx                                 |    2 +-
 toolkit/inc/helper/unowrapper.hxx                    |    2 +-
 vcl/inc/textlayout.hxx                               |    2 +-
 25 files changed, 24 insertions(+), 33 deletions(-)

New commits:
commit 0ed8f000613b188d0d749aebcfda7d086dfc623f
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Mon May 12 16:04:52 2025 +0200
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Tue Jul 8 18:20:10 2025 +0200

    New Clang 21 trunk -Werror,-Wunnecessary-virtual-specifier
    
    ...warning about non-overriding virtual dtors in final classes.  Every 
single
    one of these might or might not be suspicious (e.g., in some cases it might 
be
    better to have a virtual dtor in a derived-from class).  Also, for some of 
the
    virtual dtors, making them non-virtual then caused
    
    > error: unnecessary user-declared destructor [loplugin:unnecessaryoverride]
    
    so those were removed completely.
    
    Change-Id: If0ee71645a347d6096b65988c56f627c42fe54b2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185223
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>
    (cherry picked from commit 887804deb541a9a4d14cdafd7eff8f2df35a8cdc)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187543
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Stephan Bergmann <stephan.bergm...@collabora.com>

diff --git a/chart2/source/controller/inc/SelectionHelper.hxx 
b/chart2/source/controller/inc/SelectionHelper.hxx
index 119640bd4300..f468f974d6db 100644
--- a/chart2/source/controller/inc/SelectionHelper.hxx
+++ b/chart2/source/controller/inc/SelectionHelper.hxx
@@ -97,7 +97,7 @@ public:
                     , const rtl::Reference<::chart::ChartModel>& xChartModel );
 
     explicit SelectionHelper( SdrObject* pSelectedObj );
-    virtual ~SelectionHelper();
+    ~SelectionHelper();
 
     //MarkHandleProvider:
     virtual bool getMarkHandles( SdrHdlList& rHdlList ) override;
diff --git a/chart2/source/controller/inc/res_ErrorBar.hxx 
b/chart2/source/controller/inc/res_ErrorBar.hxx
index 2a1f3645a775..111858acdf35 100644
--- a/chart2/source/controller/inc/res_ErrorBar.hxx
+++ b/chart2/source/controller/inc/res_ErrorBar.hxx
@@ -56,7 +56,7 @@ public:
 
     ErrorBarResources(
         weld::Builder* pParent, weld::DialogController* pControllerDialog, 
const SfxItemSet& rInAttrs, bool bNoneAvailable, 
chart::ErrorBarResources::tErrorBarType eType = ERROR_BAR_Y);
-    virtual ~ErrorBarResources();
+    ~ErrorBarResources();
 
     void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth );
     void SetErrorBarType( tErrorBarType eNewType );
diff --git a/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx 
b/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx
index cbb5e55ba74a..a716d44a93c3 100644
--- a/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx
+++ b/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx
@@ -59,7 +59,7 @@ class MergedMinimumAndMaximumSupplier final : public 
MinimumAndMaximumSupplier
 {
 public:
     MergedMinimumAndMaximumSupplier();
-    virtual ~MergedMinimumAndMaximumSupplier();
+    ~MergedMinimumAndMaximumSupplier();
 
     void addMinimumAndMaximumSupplier( MinimumAndMaximumSupplier* 
pMinimumAndMaximumSupplier );
     bool hasMinimumAndMaximumSupplier( MinimumAndMaximumSupplier* 
pMinimumAndMaximumSupplier );
diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index 446cdc0e43ba..d1a96951891f 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -332,7 +332,7 @@ class OWeakRefListener final : public XReference
 public:
     explicit OWeakRefListener(const Reference< XInterface >& xInt);
     explicit OWeakRefListener(const Reference< XWeak >& xInt);
-    virtual ~OWeakRefListener();
+    ~OWeakRefListener();
 
     // noncopyable
     OWeakRefListener(const OWeakRefListener&) = delete;
diff --git a/forms/source/inc/property.hxx b/forms/source/inc/property.hxx
index 00b2075ccebd..5ed41ada24be 100644
--- a/forms/source/inc/property.hxx
+++ b/forms/source/inc/property.hxx
@@ -329,8 +329,6 @@ private:
 class ConcreteInfoService final : public ::comphelper::IPropertyInfoService
 {
 public:
-    virtual ~ConcreteInfoService() {}
-
     virtual sal_Int32 getPreferredPropertyId(const OUString& _rName) override;
 };
 
diff --git a/include/comphelper/propertybag.hxx 
b/include/comphelper/propertybag.hxx
index 3cf9de9ff360..26b8368d769c 100644
--- a/include/comphelper/propertybag.hxx
+++ b/include/comphelper/propertybag.hxx
@@ -45,7 +45,7 @@ namespace comphelper
         bool m_bAllowEmptyPropertyName;
     public:
         PropertyBag();
-        virtual ~PropertyBag();
+        ~PropertyBag();
 
         /** allow adding property with empty string as name
             (by default, such names are rejected with IllegalActionException).
diff --git a/include/connectivity/sqlparse.hxx 
b/include/connectivity/sqlparse.hxx
index 790da073aad5..9be35c456d10 100644
--- a/include/connectivity/sqlparse.hxx
+++ b/include/connectivity/sqlparse.hxx
@@ -58,7 +58,7 @@ namespace connectivity
     public:
         OParseContext();
 
-        virtual ~OParseContext();
+        ~OParseContext();
         // retrieves language specific error messages
         virtual OUString getErrorMessage(ErrorCode _eCodes) const override;
 
diff --git a/include/dbaccess/dbaundomanager.hxx 
b/include/dbaccess/dbaundomanager.hxx
index 7c25c3655ad2..2cdc2805402c 100644
--- a/include/dbaccess/dbaundomanager.hxx
+++ b/include/dbaccess/dbaundomanager.hxx
@@ -59,7 +59,7 @@ namespace dbaui
     {
     public:
         DBACCESS_DLLPUBLIC UndoManager( ::cppu::OWeakObject& i_parent, 
::osl::Mutex& i_mutex );
-        virtual ~UndoManager();
+        ~UndoManager();
 
         DBACCESS_DLLPUBLIC SfxUndoManager& GetSfxUndoManager() const;
 
diff --git a/include/oox/export/chartexport.hxx 
b/include/oox/export/chartexport.hxx
index 74f924e72daa..2d745d295986 100644
--- a/include/oox/export/chartexport.hxx
+++ b/include/oox/export/chartexport.hxx
@@ -286,7 +286,6 @@ public:
 
     OOX_DLLPUBLIC ChartExport( sal_Int32 nXmlNamespace, 
::sax_fastparser::FSHelperPtr pFS, css::uno::Reference< css::frame::XModel > 
const & xModel,
                  ::oox::core::XmlFilterBase* pFB, DocumentType eDocumentType );
-    virtual ~ChartExport() {}
 
     OOX_DLLPUBLIC void SetURLTranslator(const std::shared_ptr<URLTransformer>& 
pTransformer);
 
diff --git a/include/sfx2/frame.hxx b/include/sfx2/frame.hxx
index f78f51509d4f..69b6dd36252c 100644
--- a/include/sfx2/frame.hxx
+++ b/include/sfx2/frame.hxx
@@ -72,7 +72,7 @@ private:
     std::unique_ptr< SfxFrame_Impl >     m_pImpl;
     VclPtr<vcl::Window> m_pWindow;
 
-    virtual             ~SfxFrame();
+    ~SfxFrame();
 
     SAL_DLLPRIVATE      SfxFrame( vcl::Window& i_rContainerWindow );
 
diff --git a/include/svtools/javacontext.hxx b/include/svtools/javacontext.hxx
index 124b191fd540..462aaddc13ef 100644
--- a/include/svtools/javacontext.hxx
+++ b/include/svtools/javacontext.hxx
@@ -43,7 +43,7 @@ namespace svt
             nothing happens.
          */
         JavaContext( const css::uno::Reference< css::uno::XCurrentContext> & 
ctx );
-        virtual ~JavaContext();
+        ~JavaContext();
 
         // XInterface
         virtual css::uno::Any SAL_CALL queryInterface(
diff --git a/include/svtools/javainteractionhandler.hxx 
b/include/svtools/javainteractionhandler.hxx
index 8cd220cc4a0f..8a608186a219 100644
--- a/include/svtools/javainteractionhandler.hxx
+++ b/include/svtools/javainteractionhandler.hxx
@@ -55,7 +55,7 @@ private:
     oslInterlockedCount m_aRefCount;
     JavaInteractionHandler(JavaInteractionHandler const&) = delete;
     JavaInteractionHandler& operator = (JavaInteractionHandler const &) = 
delete;
-    SVT_DLLPRIVATE virtual ~JavaInteractionHandler();
+    SVT_DLLPRIVATE ~JavaInteractionHandler();
 };
 }
 
diff --git a/include/svx/sdrmasterpagedescriptor.hxx 
b/include/svx/sdrmasterpagedescriptor.hxx
index 9be1e663bcff..aa2e08a1516a 100644
--- a/include/svx/sdrmasterpagedescriptor.hxx
+++ b/include/svx/sdrmasterpagedescriptor.hxx
@@ -45,7 +45,7 @@ namespace sdr
 
     public:
         MasterPageDescriptor(SdrPage& aOwnerPage, SdrPage& aUsedPage);
-        virtual ~MasterPageDescriptor();
+        ~MasterPageDescriptor();
 
         // ViewContact part
         sdr::contact::ViewContact& GetViewContact() const;
diff --git a/include/svx/svdmark.hxx b/include/svx/svdmark.hxx
index 3d09b0c4c224..4adcc9c21c5d 100644
--- a/include/svx/svdmark.hxx
+++ b/include/svx/svdmark.hxx
@@ -57,7 +57,7 @@ class SVXCORE_DLLPUBLIC SdrMark final : public sdr::ObjectUser
 public:
     explicit SdrMark(SdrObject* pNewObj = nullptr, SdrPageView* pNewPageView = 
nullptr);
     SAL_DLLPRIVATE SdrMark(const SdrMark& rMark);
-    virtual ~SdrMark();
+    ~SdrMark();
 
     // Derived from ObjectUser
     SAL_DLLPRIVATE virtual void ObjectInDestruction(const SdrObject& rObject) 
override;
diff --git a/include/vcl/filter/pdfdocument.hxx 
b/include/vcl/filter/pdfdocument.hxx
index d1eaf06b126e..e378b70eee67 100644
--- a/include/vcl/filter/pdfdocument.hxx
+++ b/include/vcl/filter/pdfdocument.hxx
@@ -550,7 +550,7 @@ class VCL_DLLPUBLIC PDFDocument final : public 
PDFObjectContainer
 
 public:
     PDFDocument();
-    virtual ~PDFDocument();
+    ~PDFDocument();
     PDFDocument& operator=(const PDFDocument&) = delete;
     PDFDocument(const PDFDocument&) = delete;
     /// @name Low-level functions, to be used by PDFElement subclasses.
diff --git a/sc/inc/funcdesc.hxx b/sc/inc/funcdesc.hxx
index 49b718dbd1ae..511ae46d23c5 100644
--- a/sc/inc/funcdesc.hxx
+++ b/sc/inc/funcdesc.hxx
@@ -41,7 +41,7 @@ class ScFuncDesc final : public formula::IFunctionDescription
 {
 public:
     ScFuncDesc();
-    virtual ~ScFuncDesc();
+    ~ScFuncDesc();
 
     /**
       Clears the object
@@ -272,7 +272,6 @@ class ScFunctionCategory final : public 
formula::IFunctionCategory
 public:
     ScFunctionCategory(const ::std::vector<const ScFuncDesc*>& 
_rCategory,sal_uInt32 _nCategory)
             : m_rCategory(_rCategory),m_nCategory(_nCategory){}
-    virtual ~ScFunctionCategory(){}
 
     /**
       @return count of functions in this category
@@ -314,7 +313,7 @@ public:
       The function lists of the categories are sorted by (case insensitive) 
function name
     */
             ScFunctionMgr();
-    virtual ~ScFunctionMgr();
+    ~ScFunctionMgr();
 
     /**
       Returns name of category.
diff --git a/sd/inc/shapelist.hxx b/sd/inc/shapelist.hxx
index c93344835016..4c4695b8fcfd 100644
--- a/sd/inc/shapelist.hxx
+++ b/sd/inc/shapelist.hxx
@@ -31,7 +31,7 @@ namespace sd
     {
     public:
         ShapeList();
-        virtual ~ShapeList();
+        ~ShapeList();
 
         /** adds the given shape to this list */
         void addShape( SdrObject& rObject );
diff --git a/sd/source/ui/inc/TemplateScanner.hxx 
b/sd/source/ui/inc/TemplateScanner.hxx
index 7924cc294cee..f1a2fbd74dc4 100644
--- a/sd/source/ui/inc/TemplateScanner.hxx
+++ b/sd/source/ui/inc/TemplateScanner.hxx
@@ -76,7 +76,7 @@ public:
     /** The destructor deletes any remaining entries of the local list of
         templates.
     */
-    virtual ~TemplateScanner();
+    ~TemplateScanner();
 
     /** Implementation of the AsynchronousTask interface method.
     */
diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
index e4c4e07c8f6a..3b6cf524df60 100644
--- a/sfx2/source/inc/objshimp.hxx
+++ b/sfx2/source/inc/objshimp.hxx
@@ -143,7 +143,7 @@ struct SfxObjectShell_Impl final : public 
::sfx2::IMacroDocumentAccess
     mutable bool m_bCloseModelScheduled = false;
 
     SfxObjectShell_Impl( SfxObjectShell& _rDocShell );
-    virtual ~SfxObjectShell_Impl();
+    ~SfxObjectShell_Impl();
 
     // IMacroDocumentAccess overridables
     virtual sal_Int16 getCurrentMacroExecMode() const override;
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index 338e93432ba1..10e1f1fefb6f 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -186,7 +186,6 @@ public:
 
         maPos.pSelectedNode->Accept( this );
     }
-    virtual ~SmCaretPos2LineVisitor() {}
     void Visit( SmTextNode* pNode ) override;
     using SmDefaultingVisitor::Visit;
     const SmCaretLine& GetResult( ) const {
@@ -223,7 +222,6 @@ public:
             mrDev.ReMirror(maPosition);
         pTree->Accept( this );
     }
-    virtual ~SmDrawingVisitor() {}
     void Visit( SmTableNode* pNode ) override;
     void Visit( SmBraceNode* pNode ) override;
     void Visit( SmBracebodyNode* pNode ) override;
@@ -281,7 +279,6 @@ class SmSetSelectionVisitor final : public 
SmDefaultingVisitor
 {
 public:
     SmSetSelectionVisitor( SmCaretPos startPos, SmCaretPos endPos, SmNode* 
pNode);
-    virtual ~SmSetSelectionVisitor() {}
     void Visit( SmBinHorNode* pNode ) override;
     void Visit( SmUnHorNode* pNode ) override;
     void Visit( SmFontNode* pNode ) override;
@@ -341,7 +338,7 @@ class SmCaretPosGraphBuildingVisitor final : public 
SmVisitor
 public:
     /** Builds a caret position graph for pRootNode */
     explicit SmCaretPosGraphBuildingVisitor( SmNode* pRootNode );
-    virtual ~SmCaretPosGraphBuildingVisitor();
+    ~SmCaretPosGraphBuildingVisitor();
     void Visit( SmTableNode* pNode ) override;
     void Visit( SmBraceNode* pNode ) override;
     void Visit( SmBracebodyNode* pNode ) override;
@@ -390,7 +387,6 @@ public:
     SmCloningVisitor()
         : mpResult(nullptr)
     {}
-    virtual ~SmCloningVisitor() {}
     void Visit( SmTableNode* pNode ) override;
     void Visit( SmBraceNode* pNode ) override;
     void Visit( SmBracebodyNode* pNode ) override;
@@ -470,7 +466,6 @@ class SmNodeToTextVisitor final : public SmVisitor
 {
 public:
     SmNodeToTextVisitor( SmNode* pNode, OUString &rText );
-    virtual ~SmNodeToTextVisitor() {}
 
     void Visit( SmTableNode* pNode ) override;
     void Visit( SmBraceNode* pNode ) override;
diff --git a/svx/inc/sdr/properties/cellproperties.hxx 
b/svx/inc/sdr/properties/cellproperties.hxx
index f2531061b024..ba023b9059be 100644
--- a/svx/inc/sdr/properties/cellproperties.hxx
+++ b/svx/inc/sdr/properties/cellproperties.hxx
@@ -34,7 +34,7 @@ class CellTextProvider final : public svx::ITextProvider
 {
 public:
     explicit CellTextProvider(sdr::table::CellRef xCell);
-    virtual ~CellTextProvider();
+    ~CellTextProvider();
 
 private:
     virtual sal_Int32 getTextCount() const override;
diff --git a/svx/source/inc/fmtextcontrolshell.hxx 
b/svx/source/inc/fmtextcontrolshell.hxx
index 77ea5c5d2f94..3b0a4896d2cd 100644
--- a/svx/source/inc/fmtextcontrolshell.hxx
+++ b/svx/source/inc/fmtextcontrolshell.hxx
@@ -111,7 +111,7 @@ namespace svx
 
     public:
         FmTextControlShell( SfxViewFrame* _pFrame );
-        virtual ~FmTextControlShell();
+        ~FmTextControlShell();
 
         // clean up any resources associated with this instance
         void    dispose();
diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx
index cd330d802796..e228479849a8 100644
--- a/sw/inc/printdata.hxx
+++ b/sw/inc/printdata.hxx
@@ -160,7 +160,7 @@ class SwPrintUIOptions final : public 
vcl::PrinterOptionsHelper
 
 public:
     SwPrintUIOptions( sal_uInt16 nCurrentPage, bool bWeb, bool bSwSrcView, 
bool bHasSelection, bool bHasPostIts, const SwPrintData &rDefaultPrintData );
-    virtual ~SwPrintUIOptions();
+    ~SwPrintUIOptions();
 
     bool processPropertiesAndCheckFormat( const css::uno::Sequence< 
css::beans::PropertyValue >& i_rNewProp );
 
diff --git a/toolkit/inc/helper/unowrapper.hxx 
b/toolkit/inc/helper/unowrapper.hxx
index 274e60beb2c3..0647016f9e0d 100644
--- a/toolkit/inc/helper/unowrapper.hxx
+++ b/toolkit/inc/helper/unowrapper.hxx
@@ -61,7 +61,7 @@ public:
     void                WindowDestroyed( vcl::Window* pWindow ) override;
 
 private:
-    virtual ~UnoWrapper();
+    ~UnoWrapper();
 };
 
 #endif // INCLUDED_TOOLKIT_INC_HELPER_UNOWRAPPER_HXX
diff --git a/vcl/inc/textlayout.hxx b/vcl/inc/textlayout.hxx
index 4b1d8fd5d3d6..290d91917c9c 100644
--- a/vcl/inc/textlayout.hxx
+++ b/vcl/inc/textlayout.hxx
@@ -78,7 +78,7 @@ namespace vcl
             : m_rTargetDevice( _rTargetDevice )
         {
         }
-        virtual ~DefaultTextLayout();
+        ~DefaultTextLayout();
 
         // TextLayoutCommon overridables
         SAL_DLLPRIVATE virtual tools::Long GetTextWidth( const OUString& 
_rText,

Reply via email to