From 7634b279a53e7212925566e0de25d721fa7598ac Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Fri, 11 Aug 2017 11:39:20 +0200 Subject: vcl: use default copy-ctor for TextAttrib Type of TextAttrib (mnWhich) never changes, const it up. Derived classes can use implicit default copy-ctor. No need to explicitly delete default-ctor if there is a user provided ctor. And no need to define a default override dtor here either. Change-Id: I7a0d1896f659801319dc5fa74844df94c5888a7b Reviewed-on: https://gerrit.libreoffice.org/41022 Tested-by: Jenkins Reviewed-by: Noel Grandin --- cui/source/dialogs/SpellAttrib.cxx | 36 ------------------------------------ cui/source/dialogs/SpellAttrib.hxx | 11 ----------- 2 files changed, 47 deletions(-) (limited to 'cui') diff --git a/cui/source/dialogs/SpellAttrib.cxx b/cui/source/dialogs/SpellAttrib.cxx index b71449d98295..cc1b86c6a66a 100644 --- a/cui/source/dialogs/SpellAttrib.cxx +++ b/cui/source/dialogs/SpellAttrib.cxx @@ -32,18 +32,6 @@ SpellErrorAttrib::SpellErrorAttrib( const SpellErrorDescription& rDesc ) : } -SpellErrorAttrib::SpellErrorAttrib( const SpellErrorAttrib& rAttr ) : - TextAttrib(TEXTATTR_SPELL_ERROR), - m_aSpellErrorDescription( rAttr.m_aSpellErrorDescription ) -{ -} - - -SpellErrorAttrib::~SpellErrorAttrib() -{ -} - - void SpellErrorAttrib::SetFont( vcl::Font& ) const { //this attribute doesn't have a visual effect @@ -70,18 +58,6 @@ SpellLanguageAttrib::SpellLanguageAttrib(LanguageType eLang) : } -SpellLanguageAttrib::SpellLanguageAttrib( const SpellLanguageAttrib& rAttr ) : - TextAttrib(TEXTATTR_SPELL_LANGUAGE), - m_eLanguage(rAttr.m_eLanguage) -{ -} - - -SpellLanguageAttrib::~SpellLanguageAttrib() -{ -} - - void SpellLanguageAttrib::SetFont( vcl::Font& ) const { //no visual effect @@ -108,18 +84,6 @@ SpellBackgroundAttrib::SpellBackgroundAttrib(const Color& rCol) : } -SpellBackgroundAttrib::SpellBackgroundAttrib( const SpellBackgroundAttrib& rAttr ) : - TextAttrib(TEXTATTR_SPELL_BACKGROUND), - m_aBackgroundColor(rAttr.m_aBackgroundColor) -{ -} - - -SpellBackgroundAttrib::~SpellBackgroundAttrib() -{ -} - - void SpellBackgroundAttrib::SetFont( vcl::Font& rFont ) const { rFont.SetFillColor(m_aBackgroundColor); diff --git a/cui/source/dialogs/SpellAttrib.hxx b/cui/source/dialogs/SpellAttrib.hxx index 3ce4048d4021..aabf466235c3 100644 --- a/cui/source/dialogs/SpellAttrib.hxx +++ b/cui/source/dialogs/SpellAttrib.hxx @@ -96,11 +96,8 @@ public: private: SpellErrorDescription m_aSpellErrorDescription; - SpellErrorAttrib() = delete; public: SpellErrorAttrib( const SpellErrorDescription& ); - SpellErrorAttrib( const SpellErrorAttrib& rAttr ); - virtual ~SpellErrorAttrib() override; const SpellErrorDescription& GetErrorDescription() const { return m_aSpellErrorDescription; } @@ -115,12 +112,8 @@ class SpellLanguageAttrib : public TextAttrib { LanguageType m_eLanguage; - SpellLanguageAttrib() = delete; - public: SpellLanguageAttrib(LanguageType eLanguage); - SpellLanguageAttrib( const SpellLanguageAttrib& rAttr ); - virtual ~SpellLanguageAttrib() override; LanguageType GetLanguage() const {return m_eLanguage;} @@ -134,12 +127,8 @@ class SpellBackgroundAttrib : public TextAttrib { Color m_aBackgroundColor; - SpellBackgroundAttrib() = delete; - public: SpellBackgroundAttrib(const Color& rCol); - SpellBackgroundAttrib( const SpellBackgroundAttrib& rAttr ); - virtual ~SpellBackgroundAttrib() override; virtual void SetFont( vcl::Font& rFont ) const override; virtual TextAttrib* Clone() const override; -- cgit