Kaydet (Commit) d2a28ebd authored tarafından Stephan Bergmann's avatar Stephan Bergmann

vcl: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)

...by explicitly defaulting the copy/move functions (and, where needed in turn,
also a default ctor) for classes that have a user-declared dtor that does
nothing other than an implicitly-defined one would do, but needs to be user-
declared because it is virtual and potentially serves as a key function to
emit the vtable, or is non-public, etc.; and by removing explicitly user-
provided functions that do the same as their implicitly-defined counterparts,
but may prevent implicitly declared copy functions from being defined as non-
deleted in the future.  (Even if such a user-provided function was declared
non-inline in an include file, the apparently-used implicitly-defined copy
functions are already include, so why bother with non-inline functions.)

Change-Id: Ife5d8eb699b8b6c84b9229ae275dc386fa189bce
Reviewed-on: https://gerrit.libreoffice.org/58105
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 739f7462
...@@ -34,8 +34,6 @@ namespace vcl { ...@@ -34,8 +34,6 @@ namespace vcl {
class VCL_DLLPUBLIC IconThemeScanner class VCL_DLLPUBLIC IconThemeScanner
{ {
public: public:
~IconThemeScanner();
/** Factory method to create the object. /** Factory method to create the object.
* Provide a path to search for IconThemes. * Provide a path to search for IconThemes.
*/ */
......
...@@ -73,6 +73,11 @@ public: ...@@ -73,6 +73,11 @@ public:
{ {
} }
virtual ~CustomWidgetController(); virtual ~CustomWidgetController();
CustomWidgetController(CustomWidgetController const&) = default;
CustomWidgetController(CustomWidgetController&&) = default;
CustomWidgetController& operator=(CustomWidgetController const&) = default;
CustomWidgetController& operator=(CustomWidgetController&&) = default;
}; };
class VCL_DLLPUBLIC CustomWeld class VCL_DLLPUBLIC CustomWeld
......
...@@ -62,8 +62,6 @@ public: ...@@ -62,8 +62,6 @@ public:
sal_uInt16 GetRepeat() const { return mnRepeat; } sal_uInt16 GetRepeat() const { return mnRepeat; }
KeyEvent LogicalTextDirectionality (TextDirectionality eMode) const; KeyEvent LogicalTextDirectionality (TextDirectionality eMode) const;
KeyEvent (const KeyEvent& rKeyEvent);
}; };
inline KeyEvent::KeyEvent() inline KeyEvent::KeyEvent()
......
...@@ -73,7 +73,6 @@ public: ...@@ -73,7 +73,6 @@ public:
KeyFuncType GetFunction() const; KeyFuncType GetFunction() const;
KeyCode& operator = ( const KeyCode& rKeyCode );
bool operator ==( const KeyCode& rKeyCode ) const; bool operator ==( const KeyCode& rKeyCode ) const;
bool operator !=( const KeyCode& rKeyCode ) const; bool operator !=( const KeyCode& rKeyCode ) const;
}; };
...@@ -116,14 +115,6 @@ inline bool vcl::KeyCode::operator !=( const vcl::KeyCode& rKeyCode ) const ...@@ -116,14 +115,6 @@ inline bool vcl::KeyCode::operator !=( const vcl::KeyCode& rKeyCode ) const
return (GetFunction() != rKeyCode.GetFunction()); return (GetFunction() != rKeyCode.GetFunction());
} }
inline vcl::KeyCode& vcl::KeyCode::operator = ( const vcl::KeyCode& rKeyCode )
{
nKeyCodeAndModifiers = rKeyCode.nKeyCodeAndModifiers;
eFunc = rKeyCode.eFunc;
return *this;
}
#endif // INCLUDED_VCL_KEYCOD_HXX #endif // INCLUDED_VCL_KEYCOD_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
...@@ -76,8 +76,6 @@ private: ...@@ -76,8 +76,6 @@ private:
public: public:
QueueInfo(); QueueInfo();
QueueInfo( const QueueInfo& rInfo );
~QueueInfo();
const OUString& GetPrinterName() const { return maPrinterName; } const OUString& GetPrinterName() const { return maPrinterName; }
const OUString& GetDriver() const { return maDriver; } const OUString& GetDriver() const { return maDriver; }
...@@ -128,7 +126,6 @@ private: ...@@ -128,7 +126,6 @@ private:
public: public:
PrinterOptions(); PrinterOptions();
~PrinterOptions();
bool IsReduceTransparency() const { return mbReduceTransparency; } bool IsReduceTransparency() const { return mbReduceTransparency; }
void SetReduceTransparency( bool bSet ) { mbReduceTransparency = bSet; } void SetReduceTransparency( bool bSet ) { mbReduceTransparency = bSet; }
......
...@@ -269,6 +269,11 @@ class VCL_DLLPUBLIC ImplControlValue ...@@ -269,6 +269,11 @@ class VCL_DLLPUBLIC ImplControlValue
virtual ~ImplControlValue(); virtual ~ImplControlValue();
ImplControlValue(ImplControlValue const &) = default;
ImplControlValue(ImplControlValue &&) = default;
ImplControlValue & operator =(ImplControlValue const &) = default;
ImplControlValue & operator =(ImplControlValue &&) = default;
virtual ImplControlValue* clone() const; virtual ImplControlValue* clone() const;
ControlType getType() const { return mType; } ControlType getType() const { return mType; }
...@@ -309,6 +314,11 @@ class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue ...@@ -309,6 +314,11 @@ class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue
}; };
virtual ~ScrollbarValue() override; virtual ~ScrollbarValue() override;
virtual ScrollbarValue* clone() const override; virtual ScrollbarValue* clone() const override;
ScrollbarValue(ScrollbarValue const &) = default;
ScrollbarValue(ScrollbarValue &&) = default;
ScrollbarValue & operator =(ScrollbarValue const &) = default;
ScrollbarValue & operator =(ScrollbarValue &&) = default;
}; };
class VCL_DLLPUBLIC SliderValue : public ImplControlValue class VCL_DLLPUBLIC SliderValue : public ImplControlValue
...@@ -326,6 +336,11 @@ class VCL_DLLPUBLIC SliderValue : public ImplControlValue ...@@ -326,6 +336,11 @@ class VCL_DLLPUBLIC SliderValue : public ImplControlValue
{} {}
virtual ~SliderValue() override; virtual ~SliderValue() override;
virtual SliderValue* clone() const override; virtual SliderValue* clone() const override;
SliderValue(SliderValue const &) = default;
SliderValue(SliderValue &&) = default;
SliderValue & operator =(SliderValue const &) = default;
SliderValue & operator =(SliderValue &&) = default;
}; };
/* TabitemValue: /* TabitemValue:
...@@ -362,6 +377,11 @@ class VCL_DLLPUBLIC TabitemValue : public ImplControlValue ...@@ -362,6 +377,11 @@ class VCL_DLLPUBLIC TabitemValue : public ImplControlValue
virtual ~TabitemValue() override; virtual ~TabitemValue() override;
virtual TabitemValue* clone() const override; virtual TabitemValue* clone() const override;
TabitemValue(TabitemValue const &) = default;
TabitemValue(TabitemValue &&) = default;
TabitemValue & operator =(TabitemValue const &) = default;
TabitemValue & operator =(TabitemValue &&) = default;
bool isLeftAligned() const { return bool(mnAlignment & TabitemFlags::LeftAligned); } bool isLeftAligned() const { return bool(mnAlignment & TabitemFlags::LeftAligned); }
bool isRightAligned() const { return bool(mnAlignment & TabitemFlags::RightAligned); } bool isRightAligned() const { return bool(mnAlignment & TabitemFlags::RightAligned); }
bool isBothAligned() const { return isLeftAligned() && isRightAligned(); } bool isBothAligned() const { return isLeftAligned() && isRightAligned(); }
...@@ -398,6 +418,11 @@ class VCL_DLLPUBLIC SpinbuttonValue : public ImplControlValue ...@@ -398,6 +418,11 @@ class VCL_DLLPUBLIC SpinbuttonValue : public ImplControlValue
virtual ~SpinbuttonValue() override; virtual ~SpinbuttonValue() override;
virtual SpinbuttonValue* clone() const override; virtual SpinbuttonValue* clone() const override;
SpinbuttonValue(SpinbuttonValue const &) = default;
SpinbuttonValue(SpinbuttonValue &&) = default;
SpinbuttonValue & operator =(SpinbuttonValue const &) = default;
SpinbuttonValue & operator =(SpinbuttonValue &&) = default;
}; };
/* Toolbarvalue: /* Toolbarvalue:
...@@ -411,6 +436,12 @@ public: ...@@ -411,6 +436,12 @@ public:
{ mbIsTopDockingArea = false; } { mbIsTopDockingArea = false; }
virtual ~ToolbarValue() override; virtual ~ToolbarValue() override;
virtual ToolbarValue* clone() const override; virtual ToolbarValue* clone() const override;
ToolbarValue(ToolbarValue const &) = default;
ToolbarValue(ToolbarValue &&) = default;
ToolbarValue & operator =(ToolbarValue const &) = default;
ToolbarValue & operator =(ToolbarValue &&) = default;
tools::Rectangle maGripRect; tools::Rectangle maGripRect;
bool mbIsTopDockingArea; // indicates that this is the top aligned dockingarea bool mbIsTopDockingArea; // indicates that this is the top aligned dockingarea
// adjacent to the menubar, only used on Windows // adjacent to the menubar, only used on Windows
...@@ -427,6 +458,10 @@ public: ...@@ -427,6 +458,10 @@ public:
{ maTopDockingAreaHeight=0; } { maTopDockingAreaHeight=0; }
virtual ~MenubarValue() override; virtual ~MenubarValue() override;
virtual MenubarValue* clone() const override; virtual MenubarValue* clone() const override;
MenubarValue(MenubarValue const &) = default;
MenubarValue(MenubarValue &&) = default;
MenubarValue & operator =(MenubarValue const &) = default;
MenubarValue & operator =(MenubarValue &&) = default;
int maTopDockingAreaHeight; int maTopDockingAreaHeight;
}; };
...@@ -444,6 +479,10 @@ public: ...@@ -444,6 +479,10 @@ public:
{} {}
virtual ~MenupopupValue() override; virtual ~MenupopupValue() override;
virtual MenupopupValue* clone() const override; virtual MenupopupValue* clone() const override;
MenupopupValue(MenupopupValue const &) = default;
MenupopupValue(MenupopupValue &&) = default;
MenupopupValue & operator =(MenupopupValue const &) = default;
MenupopupValue & operator =(MenupopupValue &&) = default;
tools::Rectangle maItemRect; tools::Rectangle maItemRect;
}; };
...@@ -460,6 +499,11 @@ public: ...@@ -460,6 +499,11 @@ public:
virtual ~PushButtonValue() override; virtual ~PushButtonValue() override;
virtual PushButtonValue* clone() const override; virtual PushButtonValue* clone() const override;
PushButtonValue(PushButtonValue const &) = default;
PushButtonValue(PushButtonValue &&) = default;
PushButtonValue & operator =(PushButtonValue const &) = default;
PushButtonValue & operator =(PushButtonValue &&) = default;
bool mbBevelButton:1; // only used on OSX bool mbBevelButton:1; // only used on OSX
bool mbSingleLine:1; // only used on OSX bool mbSingleLine:1; // only used on OSX
}; };
......
...@@ -96,8 +96,6 @@ private: ...@@ -96,8 +96,6 @@ private:
public: public:
MouseSettings(); MouseSettings();
~MouseSettings();
void SetOptions( MouseSettingsOptions nOptions ); void SetOptions( MouseSettingsOptions nOptions );
MouseSettingsOptions GetOptions() const; MouseSettingsOptions GetOptions() const;
...@@ -243,7 +241,6 @@ private: ...@@ -243,7 +241,6 @@ private:
public: public:
StyleSettings(); StyleSettings();
~StyleSettings();
void Set3DColors( const Color& rColor ); void Set3DColors( const Color& rColor );
...@@ -623,7 +620,6 @@ class VCL_DLLPUBLIC MiscSettings ...@@ -623,7 +620,6 @@ class VCL_DLLPUBLIC MiscSettings
public: public:
MiscSettings(); MiscSettings();
~MiscSettings();
#ifdef _WIN32 #ifdef _WIN32
void SetEnableATToolSupport( bool bEnable ); void SetEnableATToolSupport( bool bEnable );
...@@ -645,7 +641,6 @@ class VCL_DLLPUBLIC HelpSettings ...@@ -645,7 +641,6 @@ class VCL_DLLPUBLIC HelpSettings
public: public:
HelpSettings(); HelpSettings();
~HelpSettings();
sal_uLong GetTipDelay() const; sal_uLong GetTipDelay() const;
void SetTipTimeout( sal_uLong nTipTimeout ); void SetTipTimeout( sal_uLong nTipTimeout );
...@@ -678,8 +673,6 @@ private: ...@@ -678,8 +673,6 @@ private:
public: public:
AllSettings(); AllSettings();
AllSettings( const AllSettings& rSet );
~AllSettings();
void SetMouseSettings( const MouseSettings& rSet ); void SetMouseSettings( const MouseSettings& rSet );
const MouseSettings& GetMouseSettings() const; const MouseSettings& GetMouseSettings() const;
......
...@@ -115,6 +115,10 @@ public: ...@@ -115,6 +115,10 @@ public:
assert((!m_rInnerRef.get() || m_rInnerRef->isDisposed() || m_rInnerRef->getRefCount() > 1) assert((!m_rInnerRef.get() || m_rInnerRef->isDisposed() || m_rInnerRef->getRefCount() > 1)
&& "someone forgot to call dispose()"); && "someone forgot to call dispose()");
} }
VclPtr(VclPtr const &) = default;
VclPtr(VclPtr &&) = default;
VclPtr & operator =(VclPtr const &) = default;
VclPtr & operator =(VclPtr &&) = default;
#endif #endif
/** /**
......
...@@ -31,7 +31,6 @@ class VCL_DLLPUBLIC FontAttributes ...@@ -31,7 +31,6 @@ class VCL_DLLPUBLIC FontAttributes
{ {
public: public:
explicit FontAttributes(); explicit FontAttributes();
FontAttributes( const FontAttributes& );
// device independent font functions // device independent font functions
const OUString& GetFamilyName() const { return maFamilyName; } const OUString& GetFamilyName() const { return maFamilyName; }
......
...@@ -184,9 +184,6 @@ IconThemeScanner::GetStandardIconThemePath() ...@@ -184,9 +184,6 @@ IconThemeScanner::GetStandardIconThemePath()
return aPathOptions.GetIconsetPath(); return aPathOptions.GetIconsetPath();
} }
IconThemeScanner::~IconThemeScanner()
{}
namespace namespace
{ {
class SameTheme class SameTheme
......
...@@ -433,10 +433,6 @@ MouseSettings::MouseSettings() ...@@ -433,10 +433,6 @@ MouseSettings::MouseSettings()
{ {
} }
MouseSettings::~MouseSettings()
{
}
void MouseSettings::CopyData() void MouseSettings::CopyData()
{ {
// copy if other references exist // copy if other references exist
...@@ -715,10 +711,6 @@ StyleSettings::StyleSettings() ...@@ -715,10 +711,6 @@ StyleSettings::StyleSettings()
{ {
} }
StyleSettings::~StyleSettings()
{
}
void void
StyleSettings::SetFaceColor( const Color& rColor ) StyleSettings::SetFaceColor( const Color& rColor )
{ {
...@@ -2346,10 +2338,6 @@ MiscSettings::MiscSettings() ...@@ -2346,10 +2338,6 @@ MiscSettings::MiscSettings()
{ {
} }
MiscSettings::~MiscSettings()
{
}
bool MiscSettings::operator ==( const MiscSettings& rSet ) const bool MiscSettings::operator ==( const MiscSettings& rSet ) const
{ {
if ( mxData == rSet.mxData ) if ( mxData == rSet.mxData )
...@@ -2529,10 +2517,6 @@ HelpSettings::HelpSettings() ...@@ -2529,10 +2517,6 @@ HelpSettings::HelpSettings()
{ {
} }
HelpSettings::~HelpSettings()
{
}
bool HelpSettings::operator ==( const HelpSettings& rSet ) const bool HelpSettings::operator ==( const HelpSettings& rSet ) const
{ {
if ( mxData == rSet.mxData ) if ( mxData == rSet.mxData )
...@@ -2614,15 +2598,6 @@ AllSettings::AllSettings() ...@@ -2614,15 +2598,6 @@ AllSettings::AllSettings()
{ {
} }
AllSettings::AllSettings( const AllSettings& rSet )
{
mxData = rSet.mxData;
}
AllSettings::~AllSettings()
{
}
void AllSettings::CopyData() void AllSettings::CopyData()
{ {
// copy if other references exist // copy if other references exist
......
...@@ -33,20 +33,6 @@ FontAttributes::FontAttributes() ...@@ -33,20 +33,6 @@ FontAttributes::FontAttributes()
mnQuality( 0 ) mnQuality( 0 )
{} {}
FontAttributes::FontAttributes( const FontAttributes& rFontAttributes ) :
maFamilyName( rFontAttributes.maFamilyName ),
maStyleName( rFontAttributes.maStyleName ),
meWeight( rFontAttributes.meWeight ),
meFamily( rFontAttributes.meFamily ),
mePitch( rFontAttributes.mePitch ),
meWidthType( rFontAttributes.meWidthType ),
meItalic( rFontAttributes.meItalic ),
meCharSet( rFontAttributes.meCharSet ),
mbSymbolFlag( rFontAttributes.mbSymbolFlag ),
maMapNames( rFontAttributes.maMapNames ),
mnQuality( rFontAttributes.mnQuality )
{}
bool FontAttributes::CompareDeviceIndependentFontAttributes(const FontAttributes& rOther) const bool FontAttributes::CompareDeviceIndependentFontAttributes(const FontAttributes& rOther) const
{ {
if (maFamilyName != rOther.maFamilyName) if (maFamilyName != rOther.maFamilyName)
......
...@@ -102,10 +102,6 @@ PrinterOptions::PrinterOptions() : ...@@ -102,10 +102,6 @@ PrinterOptions::PrinterOptions() :
{ {
} }
PrinterOptions::~PrinterOptions()
{
}
void PrinterOptions::ReadFromConfig( bool i_bFile ) void PrinterOptions::ReadFromConfig( bool i_bFile )
{ {
bool bSuccess = false; bool bSuccess = false;
...@@ -336,10 +332,6 @@ QueueInfo::QueueInfo() ...@@ -336,10 +332,6 @@ QueueInfo::QueueInfo()
mnJobs = 0; mnJobs = 0;
} }
QueueInfo::QueueInfo( const QueueInfo& ) = default;
QueueInfo::~QueueInfo() = default;
SalPrinterQueueInfo::SalPrinterQueueInfo() SalPrinterQueueInfo::SalPrinterQueueInfo()
{ {
mnStatus = PrintQueueFlags::NONE; mnStatus = PrintQueueFlags::NONE;
......
...@@ -21,12 +21,6 @@ ...@@ -21,12 +21,6 @@
#include <com/sun/star/awt/KeyModifier.hpp> #include <com/sun/star/awt/KeyModifier.hpp>
#include <vcl/event.hxx> #include <vcl/event.hxx>
KeyEvent::KeyEvent (const KeyEvent& rKeyEvent) :
maKeyCode (rKeyEvent.maKeyCode),
mnRepeat (rKeyEvent.mnRepeat),
mnCharCode(rKeyEvent.mnCharCode)
{}
KeyEvent KeyEvent::LogicalTextDirectionality (TextDirectionality eMode) const KeyEvent KeyEvent::LogicalTextDirectionality (TextDirectionality eMode) const
{ {
KeyEvent aClone(*this); KeyEvent aClone(*this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment