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 <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
This commit is contained in:
Jochen Nitschke
2016-04-29 15:54:09 +02:00
committed by Michael Stahl
parent acdc855f0b
commit 12c222a3ae
10 changed files with 17 additions and 30 deletions

View File

@@ -38,15 +38,12 @@ namespace comphelper
public: public:
typedef sal_uInt32 TClientId; typedef sal_uInt32 TClientId;
protected: public:
AccessibleEventNotifier( ); // never implemented AccessibleEventNotifier() = delete;
~AccessibleEventNotifier( ); // never implemented ~AccessibleEventNotifier() = delete;
private:
AccessibleEventNotifier( const AccessibleEventNotifier& ) = delete; AccessibleEventNotifier( const AccessibleEventNotifier& ) = delete;
AccessibleEventNotifier& operator=( const AccessibleEventNotifier& ) = delete; AccessibleEventNotifier& operator=( const AccessibleEventNotifier& ) = delete;
public:
/** registers a client of this class, means a broadcaster of AccessibleEvents /** registers a client of this class, means a broadcaster of AccessibleEvents
<p>No precaution is taken to care for disposal of this component. When the component <p>No precaution is taken to care for disposal of this component. When the component

View File

@@ -225,9 +225,9 @@ namespace comphelper
protected: protected:
virtual ~OAccessibleContextWrapperHelper( ); virtual ~OAccessibleContextWrapperHelper( );
OAccessibleContextWrapperHelper( ); // never implemented OAccessibleContextWrapperHelper() = delete;
OAccessibleContextWrapperHelper( const OAccessibleContextWrapperHelper& ); // never implemented OAccessibleContextWrapperHelper(const OAccessibleContextWrapperHelper&) = delete;
OAccessibleContextWrapperHelper& operator=( const OAccessibleContextWrapperHelper& ); // never implemented OAccessibleContextWrapperHelper& operator=(const OAccessibleContextWrapperHelper&) = delete;
}; };

View File

@@ -79,6 +79,7 @@ namespace param
::connectivity::ORowSetValue& Value() { return m_aValue; } ::connectivity::ORowSetValue& Value() { return m_aValue; }
public: public:
ParameterWrapper() = delete;
ParameterWrapper( ParameterWrapper(
const css::uno::Reference< css::beans::XPropertySet >& _rxColumn const css::uno::Reference< css::beans::XPropertySet >& _rxColumn
); );
@@ -114,9 +115,6 @@ namespace param
private: private:
OUString impl_getPseudoAggregatePropertyName( sal_Int32 _nHandle ) const; OUString impl_getPseudoAggregatePropertyName( sal_Int32 _nHandle ) const;
private:
ParameterWrapper(); // not implemented
}; };

View File

@@ -76,6 +76,7 @@ namespace dbaui
virtual void impl_onModifyChanged(); virtual void impl_onModifyChanged();
public: public:
DBSubComponentController() = delete;
bool isReadOnly() const; bool isReadOnly() const;
bool isEditable() const; bool isEditable() const;
@@ -188,9 +189,6 @@ namespace dbaui
protected: protected:
sal_Int32 getCurrentStartNumber() const; sal_Int32 getCurrentStartNumber() const;
private:
DBSubComponentController(); // never implemented
}; };

View File

@@ -65,18 +65,16 @@ class EDITENG_DLLPUBLIC EditTextObject : public SfxItemPoolUser
std::unique_ptr<EditTextObjectImpl> mpImpl; std::unique_ptr<EditTextObjectImpl> mpImpl;
EditTextObject& operator=( const EditTextObject& ) = delete;
EditTextObject(); // disabled
EditTextObject( SfxItemPool* pPool ); EditTextObject( SfxItemPool* pPool );
void StoreData( SvStream& rStrm ) const; void StoreData( SvStream& rStrm ) const;
void CreateData( SvStream& rStrm ); void CreateData( SvStream& rStrm );
public: public:
EditTextObject() = delete;
EditTextObject( const EditTextObject& r ); EditTextObject( const EditTextObject& r );
virtual ~EditTextObject(); virtual ~EditTextObject();
EditTextObject& operator=( const EditTextObject& ) = delete;
/** /**
* Set paragraph strings to the shared string pool. * Set paragraph strings to the shared string pool.

View File

@@ -27,10 +27,10 @@ class EDITENG_DLLPUBLIC FieldUpdater
{ {
std::unique_ptr<FieldUpdaterImpl> mpImpl; std::unique_ptr<FieldUpdaterImpl> mpImpl;
FieldUpdater(); // disabled
public: public:
FieldUpdater(EditTextObject& rObj); FieldUpdater(EditTextObject& rObj);
FieldUpdater(const FieldUpdater& r); FieldUpdater(const FieldUpdater& r);
FieldUpdater() = delete;
~FieldUpdater(); ~FieldUpdater();
/** /**

View File

@@ -107,10 +107,11 @@ protected:
SAL_DLLPRIVATE void RemoveChildFrame_Impl( SfxFrame* ); SAL_DLLPRIVATE void RemoveChildFrame_Impl( SfxFrame* );
SfxFrame( ); // not implemented
SAL_DLLPRIVATE SfxFrame( vcl::Window& i_rContainerWindow ); SAL_DLLPRIVATE SfxFrame( vcl::Window& i_rContainerWindow );
public: public:
SfxFrame() = delete;
static SfxFrame* Create( const css::uno::Reference< css::frame::XFrame >& xFrame ); static SfxFrame* Create( const css::uno::Reference< css::frame::XFrame >& xFrame );
static css::uno::Reference< css::frame::XFrame > static css::uno::Reference< css::frame::XFrame >
CreateBlankFrame(); CreateBlankFrame();

View File

@@ -339,6 +339,7 @@ public:
class SVL_DLLPUBLIC SfxUnoStyleSheet : public ::cppu::ImplInheritanceHelper2< SfxStyleSheet, css::style::XStyle, css::lang::XUnoTunnel > class SVL_DLLPUBLIC SfxUnoStyleSheet : public ::cppu::ImplInheritanceHelper2< SfxStyleSheet, css::style::XStyle, css::lang::XUnoTunnel >
{ {
public: public:
SfxUnoStyleSheet() = delete;
SfxUnoStyleSheet( const OUString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, sal_uInt16 _nMaske ); SfxUnoStyleSheet( const OUString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, sal_uInt16 _nMaske );
static SfxUnoStyleSheet* getUnoStyleSheet( const css::uno::Reference< css::style::XStyle >& xStyle ); 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; virtual ::sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< ::sal_Int8 >& aIdentifier ) throw (css::uno::RuntimeException, std::exception) override;
private: private:
SfxUnoStyleSheet(); // not implemented
static const css::uno::Sequence< ::sal_Int8 >& getIdentifier(); static const css::uno::Sequence< ::sal_Int8 >& getIdentifier();
}; };

View File

@@ -190,11 +190,8 @@ public:
SVX_DLLPUBLIC static ExpressionNodeSharedPtr parseFunction( const OUString& rFunction, const EnhancedCustomShape2d& rCustoShape ); SVX_DLLPUBLIC static ExpressionNodeSharedPtr parseFunction( const OUString& rFunction, const EnhancedCustomShape2d& rCustoShape );
private: // this is a singleton
// disabled constructor/destructor, since this is FunctionParser() = delete;
// supposed to be a singleton
FunctionParser();
FunctionParser(const FunctionParser&) = delete; FunctionParser(const FunctionParser&) = delete;
FunctionParser& operator=( const FunctionParser& ) = delete; FunctionParser& operator=( const FunctionParser& ) = delete;
}; };

View File

@@ -45,11 +45,10 @@ private:
bool bModified; bool bModified;
bool bThemeNameFromResource; bool bThemeNameFromResource;
GalleryThemeEntry();
static INetURLObject ImplGetURLIgnoreCase( const INetURLObject& rURL ); static INetURLObject ImplGetURLIgnoreCase( const INetURLObject& rURL );
public: public:
GalleryThemeEntry() = delete;
GalleryThemeEntry( bool bCreateUniqueURL, GalleryThemeEntry( bool bCreateUniqueURL,
const INetURLObject& rBaseURL, const INetURLObject& rBaseURL,
const OUString& rName, const OUString& rName,