From 12c222a3ae3d65b0c088e42bec426ec0e5ca5b75 Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Fri, 29 Apr 2016 15:54:09 +0200 Subject: C++11: disable ctors with delete in include/ replace the old declare and don't implement pattern with C++11 delete keyword no need to hide this design choice behind access restrictions Change-Id: I7e8430a07189aa48514a4613c3a8c2950b230f49 Reviewed-on: https://gerrit.libreoffice.org/24495 Tested-by: Jenkins Reviewed-by: Michael Stahl --- include/comphelper/accessibleeventnotifier.hxx | 9 +++------ include/comphelper/accessiblewrapper.hxx | 6 +++--- include/connectivity/paramwrapper.hxx | 4 +--- include/dbaccess/dbsubcomponentcontroller.hxx | 4 +--- include/editeng/editobj.hxx | 6 ++---- include/editeng/fieldupdater.hxx | 2 +- include/sfx2/frame.hxx | 3 ++- include/svl/style.hxx | 3 +-- include/svx/EnhancedCustomShapeFunctionParser.hxx | 7 ++----- include/svx/gallery1.hxx | 3 +-- 10 files changed, 17 insertions(+), 30 deletions(-) diff --git a/include/comphelper/accessibleeventnotifier.hxx b/include/comphelper/accessibleeventnotifier.hxx index 15f03013d380..572ac77168f1 100644 --- a/include/comphelper/accessibleeventnotifier.hxx +++ b/include/comphelper/accessibleeventnotifier.hxx @@ -38,15 +38,12 @@ namespace comphelper public: typedef sal_uInt32 TClientId; - protected: - AccessibleEventNotifier( ); // never implemented - ~AccessibleEventNotifier( ); // never implemented - - private: + public: + AccessibleEventNotifier() = delete; + ~AccessibleEventNotifier() = delete; AccessibleEventNotifier( const AccessibleEventNotifier& ) = delete; AccessibleEventNotifier& operator=( const AccessibleEventNotifier& ) = delete; - public: /** registers a client of this class, means a broadcaster of AccessibleEvents

No precaution is taken to care for disposal of this component. When the component diff --git a/include/comphelper/accessiblewrapper.hxx b/include/comphelper/accessiblewrapper.hxx index 8c052a6a5e0e..f61948eefa75 100644 --- a/include/comphelper/accessiblewrapper.hxx +++ b/include/comphelper/accessiblewrapper.hxx @@ -225,9 +225,9 @@ namespace comphelper protected: virtual ~OAccessibleContextWrapperHelper( ); - OAccessibleContextWrapperHelper( ); // never implemented - OAccessibleContextWrapperHelper( const OAccessibleContextWrapperHelper& ); // never implemented - OAccessibleContextWrapperHelper& operator=( const OAccessibleContextWrapperHelper& ); // never implemented + OAccessibleContextWrapperHelper() = delete; + OAccessibleContextWrapperHelper(const OAccessibleContextWrapperHelper&) = delete; + OAccessibleContextWrapperHelper& operator=(const OAccessibleContextWrapperHelper&) = delete; }; diff --git a/include/connectivity/paramwrapper.hxx b/include/connectivity/paramwrapper.hxx index c32fa6754f59..fa8494bbe9af 100644 --- a/include/connectivity/paramwrapper.hxx +++ b/include/connectivity/paramwrapper.hxx @@ -79,6 +79,7 @@ namespace param ::connectivity::ORowSetValue& Value() { return m_aValue; } public: + ParameterWrapper() = delete; ParameterWrapper( const css::uno::Reference< css::beans::XPropertySet >& _rxColumn ); @@ -114,9 +115,6 @@ namespace param private: OUString impl_getPseudoAggregatePropertyName( sal_Int32 _nHandle ) const; - - private: - ParameterWrapper(); // not implemented }; diff --git a/include/dbaccess/dbsubcomponentcontroller.hxx b/include/dbaccess/dbsubcomponentcontroller.hxx index 798a655e81e0..e3562a749d33 100644 --- a/include/dbaccess/dbsubcomponentcontroller.hxx +++ b/include/dbaccess/dbsubcomponentcontroller.hxx @@ -76,6 +76,7 @@ namespace dbaui virtual void impl_onModifyChanged(); public: + DBSubComponentController() = delete; bool isReadOnly() const; bool isEditable() const; @@ -188,9 +189,6 @@ namespace dbaui protected: sal_Int32 getCurrentStartNumber() const; - - private: - DBSubComponentController(); // never implemented }; diff --git a/include/editeng/editobj.hxx b/include/editeng/editobj.hxx index 2206cc9ded85..4331b06736ce 100644 --- a/include/editeng/editobj.hxx +++ b/include/editeng/editobj.hxx @@ -65,18 +65,16 @@ class EDITENG_DLLPUBLIC EditTextObject : public SfxItemPoolUser std::unique_ptr mpImpl; - EditTextObject& operator=( const EditTextObject& ) = delete; - - EditTextObject(); // disabled - EditTextObject( SfxItemPool* pPool ); void StoreData( SvStream& rStrm ) const; void CreateData( SvStream& rStrm ); public: + EditTextObject() = delete; EditTextObject( const EditTextObject& r ); virtual ~EditTextObject(); + EditTextObject& operator=( const EditTextObject& ) = delete; /** * Set paragraph strings to the shared string pool. diff --git a/include/editeng/fieldupdater.hxx b/include/editeng/fieldupdater.hxx index 4f87ac338f0b..461e49d9a90b 100644 --- a/include/editeng/fieldupdater.hxx +++ b/include/editeng/fieldupdater.hxx @@ -27,10 +27,10 @@ class EDITENG_DLLPUBLIC FieldUpdater { std::unique_ptr mpImpl; - FieldUpdater(); // disabled public: FieldUpdater(EditTextObject& rObj); FieldUpdater(const FieldUpdater& r); + FieldUpdater() = delete; ~FieldUpdater(); /** diff --git a/include/sfx2/frame.hxx b/include/sfx2/frame.hxx index df47419733f4..c4e6dc66b3b0 100644 --- a/include/sfx2/frame.hxx +++ b/include/sfx2/frame.hxx @@ -107,10 +107,11 @@ protected: SAL_DLLPRIVATE void RemoveChildFrame_Impl( SfxFrame* ); - SfxFrame( ); // not implemented SAL_DLLPRIVATE SfxFrame( vcl::Window& i_rContainerWindow ); public: + SfxFrame() = delete; + static SfxFrame* Create( const css::uno::Reference< css::frame::XFrame >& xFrame ); static css::uno::Reference< css::frame::XFrame > CreateBlankFrame(); diff --git a/include/svl/style.hxx b/include/svl/style.hxx index dc9c99df55fe..a4715118b9f7 100644 --- a/include/svl/style.hxx +++ b/include/svl/style.hxx @@ -339,6 +339,7 @@ public: class SVL_DLLPUBLIC SfxUnoStyleSheet : public ::cppu::ImplInheritanceHelper2< SfxStyleSheet, css::style::XStyle, css::lang::XUnoTunnel > { public: + SfxUnoStyleSheet() = delete; SfxUnoStyleSheet( const OUString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, sal_uInt16 _nMaske ); static SfxUnoStyleSheet* getUnoStyleSheet( const css::uno::Reference< css::style::XStyle >& xStyle ); @@ -347,8 +348,6 @@ public: virtual ::sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< ::sal_Int8 >& aIdentifier ) throw (css::uno::RuntimeException, std::exception) override; private: - SfxUnoStyleSheet(); // not implemented - static const css::uno::Sequence< ::sal_Int8 >& getIdentifier(); }; diff --git a/include/svx/EnhancedCustomShapeFunctionParser.hxx b/include/svx/EnhancedCustomShapeFunctionParser.hxx index 2a24fc7d2642..bf1ade93b7b1 100644 --- a/include/svx/EnhancedCustomShapeFunctionParser.hxx +++ b/include/svx/EnhancedCustomShapeFunctionParser.hxx @@ -190,11 +190,8 @@ public: SVX_DLLPUBLIC static ExpressionNodeSharedPtr parseFunction( const OUString& rFunction, const EnhancedCustomShape2d& rCustoShape ); -private: - // disabled constructor/destructor, since this is - // supposed to be a singleton - FunctionParser(); - + // this is a singleton + FunctionParser() = delete; FunctionParser(const FunctionParser&) = delete; FunctionParser& operator=( const FunctionParser& ) = delete; }; diff --git a/include/svx/gallery1.hxx b/include/svx/gallery1.hxx index 562111aee892..060f02b012da 100644 --- a/include/svx/gallery1.hxx +++ b/include/svx/gallery1.hxx @@ -45,11 +45,10 @@ private: bool bModified; bool bThemeNameFromResource; - GalleryThemeEntry(); static INetURLObject ImplGetURLIgnoreCase( const INetURLObject& rURL ); public: - + GalleryThemeEntry() = delete; GalleryThemeEntry( bool bCreateUniqueURL, const INetURLObject& rBaseURL, const OUString& rName, -- cgit