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

sw: 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: Ib4a48431398d40858d9e2ee1fd685b1f223a5423
Reviewed-on: https://gerrit.libreoffice.org/58168
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst d77d6983
...@@ -39,7 +39,6 @@ class SW_DLLPUBLIC SwRewriter ...@@ -39,7 +39,6 @@ class SW_DLLPUBLIC SwRewriter
public: public:
SwRewriter(); SwRewriter();
~SwRewriter();
void AddRule(SwUndoArg eWhat, const OUString & rWith); void AddRule(SwUndoArg eWhat, const OUString & rWith);
......
...@@ -46,6 +46,10 @@ public: ...@@ -46,6 +46,10 @@ public:
SwCondCollItem(); SwCondCollItem();
virtual ~SwCondCollItem() override; virtual ~SwCondCollItem() override;
SwCondCollItem(SwCondCollItem const &) = default;
SwCondCollItem(SwCondCollItem &&) = default;
SwCondCollItem & operator =(SwCondCollItem const &) = default;
SwCondCollItem & operator =(SwCondCollItem &&) = default;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
virtual bool operator==( const SfxPoolItem& ) const override; virtual bool operator==( const SfxPoolItem& ) const override;
......
...@@ -110,6 +110,11 @@ public: ...@@ -110,6 +110,11 @@ public:
virtual ~SwTableFormula(); virtual ~SwTableFormula();
SwTableFormula(SwTableFormula const &) = default;
SwTableFormula(SwTableFormula &&) = default;
SwTableFormula & operator =(SwTableFormula const &) = default;
SwTableFormula & operator =(SwTableFormula &&) = default;
/// create from the internal formula (for CORE) the external formula (for UI) /// create from the internal formula (for CORE) the external formula (for UI)
void PtrToBoxNm( const SwTable* pTable ); void PtrToBoxNm( const SwTable* pTable );
/// create from the external formula the internal /// create from the external formula the internal
......
...@@ -53,6 +53,12 @@ public: ...@@ -53,6 +53,12 @@ public:
virtual size_t GetFormatCount() const = 0; virtual size_t GetFormatCount() const = 0;
virtual SwFormat* GetFormat(size_t idx) const = 0; virtual SwFormat* GetFormat(size_t idx) const = 0;
virtual ~SwFormatsBase() {}; virtual ~SwFormatsBase() {};
SwFormatsBase() = default;
SwFormatsBase(SwFormatsBase const &) = default;
SwFormatsBase(SwFormatsBase &&) = default;
SwFormatsBase & operator =(SwFormatsBase const &) = default;
SwFormatsBase & operator =(SwFormatsBase &&) = default;
}; };
template<typename Value> template<typename Value>
......
...@@ -298,6 +298,11 @@ protected: ...@@ -298,6 +298,11 @@ protected:
public: public:
virtual ~SwField(); virtual ~SwField();
SwField(SwField const &) = default;
SwField(SwField &&) = default;
SwField & operator =(SwField const &) = default;
SwField & operator =(SwField &&) = default;
inline SwFieldType* GetTyp() const; inline SwFieldType* GetTyp() const;
/// Set new type (used for copying among documents). /// Set new type (used for copying among documents).
......
...@@ -35,6 +35,11 @@ public: ...@@ -35,6 +35,11 @@ public:
SwFormatLineNumber(); SwFormatLineNumber();
virtual ~SwFormatLineNumber() override; virtual ~SwFormatLineNumber() override;
SwFormatLineNumber(SwFormatLineNumber const &) = default;
SwFormatLineNumber(SwFormatLineNumber &&) = default;
SwFormatLineNumber & operator =(SwFormatLineNumber const &) = default;
SwFormatLineNumber & operator =(SwFormatLineNumber &&) = default;
static SfxPoolItem* CreateDefault(); static SfxPoolItem* CreateDefault();
/// "Pure virtual methods" of SfxPoolItem. /// "Pure virtual methods" of SfxPoolItem.
......
...@@ -104,6 +104,11 @@ protected: ...@@ -104,6 +104,11 @@ protected:
public: public:
virtual ~SwFrameFormat() override; virtual ~SwFrameFormat() override;
SwFrameFormat(SwFrameFormat const &) = default;
SwFrameFormat(SwFrameFormat &&) = default;
SwFrameFormat & operator =(SwFrameFormat const &) = default;
SwFrameFormat & operator =(SwFrameFormat &&) = default;
/// Destroys all Frames in aDepend (Frames are identified via dynamic_cast). /// Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
virtual void DelFrames(); virtual void DelFrames();
......
...@@ -108,6 +108,11 @@ public: ...@@ -108,6 +108,11 @@ public:
{ {
} }
SwSidebarItem(SwSidebarItem const &) = default;
SwSidebarItem(SwSidebarItem &&) = default;
SwSidebarItem & operator =(SwSidebarItem const &) = default;
SwSidebarItem & operator =(SwSidebarItem &&) = default;
virtual SwPosition GetAnchorPosition() const = 0; virtual SwPosition GetAnchorPosition() const = 0;
virtual bool UseElement() = 0; virtual bool UseElement() = 0;
virtual const SwFormatField& GetFormatField() const = 0; virtual const SwFormatField& GetFormatField() const = 0;
......
...@@ -99,6 +99,11 @@ public: ...@@ -99,6 +99,11 @@ public:
virtual ~SwPrintData() {} virtual ~SwPrintData() {}
SwPrintData(SwPrintData const &) = default;
SwPrintData(SwPrintData &&) = default;
SwPrintData & operator =(SwPrintData const &) = default;
SwPrintData & operator =(SwPrintData &&) = default;
bool operator==(const SwPrintData& rData)const bool operator==(const SwPrintData& rData)const
{ {
return return
......
...@@ -42,6 +42,11 @@ class SwAccessibleChild ...@@ -42,6 +42,11 @@ class SwAccessibleChild
const SdrObject* pDrawObj, const SdrObject* pDrawObj,
vcl::Window* pWindow ); vcl::Window* pWindow );
SwAccessibleChild(SwAccessibleChild const &) = default;
SwAccessibleChild(SwAccessibleChild &&) = default;
SwAccessibleChild & operator =(SwAccessibleChild const &) = default;
SwAccessibleChild & operator =(SwAccessibleChild &&) = default;
SwAccessibleChild& operator=( const SdrObject* pDrawObj ); SwAccessibleChild& operator=( const SdrObject* pDrawObj );
SwAccessibleChild& operator=( const SwFrame* pFrame ); SwAccessibleChild& operator=( const SwFrame* pFrame );
SwAccessibleChild& operator=( vcl::Window* pWindow ); SwAccessibleChild& operator=( vcl::Window* pWindow );
......
...@@ -79,6 +79,12 @@ struct SwSortElement ...@@ -79,6 +79,12 @@ struct SwSortElement
static void Init( SwDoc*, const SwSortOptions& rOpt, FlatFndBox const * = nullptr ); static void Init( SwDoc*, const SwSortOptions& rOpt, FlatFndBox const * = nullptr );
static void Finit(); static void Finit();
SwSortElement() = default;
SwSortElement(SwSortElement const &) = default;
SwSortElement(SwSortElement &&) = default;
SwSortElement & operator =(SwSortElement const &) = default;
SwSortElement & operator =(SwSortElement &&) = default;
virtual ~SwSortElement(); virtual ~SwSortElement();
virtual OUString GetKey(sal_uInt16 nKey ) const = 0; virtual OUString GetKey(sal_uInt16 nKey ) const = 0;
......
...@@ -68,8 +68,6 @@ class SwRepaint : public SwRect ...@@ -68,8 +68,6 @@ class SwRepaint : public SwRect
SwTwips nRightOfst; SwTwips nRightOfst;
public: public:
SwRepaint() : SwRect(), nOfst( 0 ), nRightOfst( 0 ) {} SwRepaint() : SwRect(), nOfst( 0 ), nRightOfst( 0 ) {}
SwRepaint( const SwRepaint& rRep ) : SwRect( rRep ), nOfst( rRep.nOfst ),
nRightOfst( rRep.nRightOfst ) {}
SwTwips GetOfst() const { return nOfst; } SwTwips GetOfst() const { return nOfst; }
void SetOfst( const SwTwips nNew ) { nOfst = nNew; } void SetOfst( const SwTwips nNew ) { nOfst = nNew; }
......
...@@ -31,10 +31,6 @@ SwRewriter::SwRewriter() ...@@ -31,10 +31,6 @@ SwRewriter::SwRewriter()
{ {
} }
SwRewriter::~SwRewriter()
{
}
void SwRewriter::AddRule(SwUndoArg eWhat, const OUString & rWith) void SwRewriter::AddRule(SwUndoArg eWhat, const OUString & rWith)
{ {
SwRewriteRule aRule(eWhat, rWith); SwRewriteRule aRule(eWhat, rWith);
......
...@@ -505,6 +505,11 @@ public: ...@@ -505,6 +505,11 @@ public:
SwMacroInfo(); SwMacroInfo();
virtual ~SwMacroInfo() override; virtual ~SwMacroInfo() override;
SwMacroInfo(SwMacroInfo const &) = default;
SwMacroInfo(SwMacroInfo &&) = default;
SwMacroInfo & operator =(SwMacroInfo const &) = default;
SwMacroInfo & operator =(SwMacroInfo &&) = default;
virtual std::unique_ptr<SdrObjUserData> Clone( SdrObject* pObj ) const override; virtual std::unique_ptr<SdrObjUserData> Clone( SdrObject* pObj ) const override;
void SetHlink( const OUString& rHlink ) { maHlink = rHlink; } void SetHlink( const OUString& rHlink ) { maHlink = rHlink; }
......
...@@ -36,6 +36,4 @@ InsCaptionOpt::InsCaptionOpt(const SwCapObjType eType, const SvGlobalName* pOleI ...@@ -36,6 +36,4 @@ InsCaptionOpt::InsCaptionOpt(const SwCapObjType eType, const SvGlobalName* pOleI
m_aOleId = *pOleId; m_aOleId = *pOleId;
} }
InsCaptionOpt::~InsCaptionOpt() = default;
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -44,7 +44,6 @@ private: ...@@ -44,7 +44,6 @@ private:
public: public:
InsCaptionOpt(const SwCapObjType eType = FRAME_CAP, const SvGlobalName* pOleId = nullptr); InsCaptionOpt(const SwCapObjType eType = FRAME_CAP, const SvGlobalName* pOleId = nullptr);
~InsCaptionOpt();
bool& UseCaption() { return m_bUseCaption; } bool& UseCaption() { return m_bUseCaption; }
bool UseCaption() const { return m_bUseCaption; } bool UseCaption() const { return m_bUseCaption; }
......
...@@ -39,6 +39,11 @@ public: ...@@ -39,6 +39,11 @@ public:
SwPageFootnoteInfoItem(SwPageFootnoteInfo const & rInfo); SwPageFootnoteInfoItem(SwPageFootnoteInfo const & rInfo);
virtual ~SwPageFootnoteInfoItem() override; virtual ~SwPageFootnoteInfoItem() override;
SwPageFootnoteInfoItem(SwPageFootnoteInfoItem const &) = default;
SwPageFootnoteInfoItem(SwPageFootnoteInfoItem &&) = default;
SwPageFootnoteInfoItem & operator =(SwPageFootnoteInfoItem const &) = default;
SwPageFootnoteInfoItem & operator =(SwPageFootnoteInfoItem &&) = default;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
virtual bool operator==( const SfxPoolItem& ) const override; virtual bool operator==( const SfxPoolItem& ) const override;
virtual bool GetPresentation( SfxItemPresentation ePres, virtual bool GetPresentation( SfxItemPresentation ePres,
......
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