diff options
-rw-r--r-- | cui/source/dialogs/SpellAttrib.cxx | 36 | ||||
-rw-r--r-- | cui/source/dialogs/SpellAttrib.hxx | 11 | ||||
-rw-r--r-- | include/vcl/txtattr.hxx | 16 | ||||
-rw-r--r-- | vcl/source/edit/textdoc.cxx | 16 | ||||
-rw-r--r-- | vcl/source/edit/txtattr.cxx | 27 |
5 files changed, 9 insertions, 97 deletions
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; diff --git a/include/vcl/txtattr.hxx b/include/vcl/txtattr.hxx index e446ee203563..8fadf98cc46f 100644 --- a/include/vcl/txtattr.hxx +++ b/include/vcl/txtattr.hxx @@ -39,11 +39,11 @@ namespace vcl { class Font; } class VCL_DLLPUBLIC TextAttrib { private: - sal_uInt16 mnWhich; + sal_uInt16 const mnWhich; protected: - TextAttrib( sal_uInt16 nWhich ) { mnWhich = nWhich; } - TextAttrib( const TextAttrib& rAttr ) { mnWhich = rAttr.mnWhich; } + TextAttrib( sal_uInt16 nWhich ) : mnWhich(nWhich) {} + TextAttrib( const TextAttrib& ) = default; public: @@ -66,8 +66,6 @@ private: public: TextAttribFontColor( const Color& rColor ); - TextAttribFontColor( const TextAttribFontColor& rAttr ); - virtual ~TextAttribFontColor() override; const Color& GetColor() const { return maColor; } @@ -84,8 +82,6 @@ private: public: TextAttribFontWeight( FontWeight eWeight ); - TextAttribFontWeight( const TextAttribFontWeight& rAttr ); - virtual ~TextAttribFontWeight() override; virtual void SetFont( vcl::Font& rFont ) const override; virtual TextAttrib* Clone() const override; @@ -98,8 +94,6 @@ class VCL_DLLPUBLIC TextAttribProtect : public TextAttrib { public: TextAttribProtect(); - TextAttribProtect( const TextAttribProtect& rAttr ); - virtual ~TextAttribProtect() override; virtual void SetFont( vcl::Font& rFont ) const override; virtual TextAttrib* Clone() const override; @@ -116,13 +110,9 @@ private: sal_Int32 mnStart; sal_Int32 mnEnd; -protected: - public: - TextCharAttrib( const TextAttrib& rAttr, sal_Int32 nStart, sal_Int32 nEnd ); TextCharAttrib( const TextCharAttrib& rTextCharAttrib ); - ~TextCharAttrib(); const TextAttrib& GetAttr() const { return *mpAttr; } diff --git a/vcl/source/edit/textdoc.cxx b/vcl/source/edit/textdoc.cxx index dce76e1cc0b6..25b19fb521c4 100644 --- a/vcl/source/edit/textdoc.cxx +++ b/vcl/source/edit/textdoc.cxx @@ -29,20 +29,16 @@ static bool CompareStart( const std::unique_ptr<TextCharAttrib>& pFirst, const s } TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_Int32 nStart, sal_Int32 nEnd ) + : mpAttr(rAttr.Clone()) + , mnStart(nStart) + , mnEnd(nEnd) { - mpAttr.reset( rAttr.Clone() ); - mnStart = nStart; - mnEnd = nEnd; } TextCharAttrib::TextCharAttrib( const TextCharAttrib& rTextCharAttrib ) -{ - mpAttr.reset( rTextCharAttrib.GetAttr().Clone() ); - mnStart = rTextCharAttrib.mnStart; - mnEnd = rTextCharAttrib.mnEnd; -} - -TextCharAttrib::~TextCharAttrib() + : mpAttr(rTextCharAttrib.mpAttr->Clone()) + , mnStart(rTextCharAttrib.mnStart) + , mnEnd(rTextCharAttrib.mnEnd) { } diff --git a/vcl/source/edit/txtattr.cxx b/vcl/source/edit/txtattr.cxx index 4065995314ec..f1a6e1ea6b0c 100644 --- a/vcl/source/edit/txtattr.cxx +++ b/vcl/source/edit/txtattr.cxx @@ -34,15 +34,6 @@ TextAttribFontColor::TextAttribFontColor( const Color& rColor ) { } -TextAttribFontColor::TextAttribFontColor( const TextAttribFontColor& rAttr ) - : TextAttrib( rAttr ), maColor( rAttr.maColor ) -{ -} - -TextAttribFontColor::~TextAttribFontColor() -{ -} - void TextAttribFontColor::SetFont( vcl::Font& rFont ) const { rFont.SetColor( maColor ); @@ -64,15 +55,6 @@ TextAttribFontWeight::TextAttribFontWeight( FontWeight eWeight ) { } -TextAttribFontWeight::TextAttribFontWeight( const TextAttribFontWeight& rAttr ) - : TextAttrib( rAttr ), meWeight( rAttr.meWeight ) -{ -} - -TextAttribFontWeight::~TextAttribFontWeight() -{ -} - void TextAttribFontWeight::SetFont( vcl::Font& rFont ) const { rFont.SetWeight( meWeight ); @@ -94,15 +76,6 @@ TextAttribProtect::TextAttribProtect() : { } -TextAttribProtect::TextAttribProtect( const TextAttribProtect&) : - TextAttrib( TEXTATTR_PROTECTED ) -{ -} - -TextAttribProtect::~TextAttribProtect() -{ -} - void TextAttribProtect::SetFont( vcl::Font& ) const { } |