cui/source/dialogs/SpellAttrib.cxx |   12 ++++++------
 cui/source/dialogs/SpellAttrib.hxx |    6 +++---
 include/vcl/txtattr.hxx            |    8 ++++----
 vcl/source/edit/txtattr.cxx        |   12 ++++++------
 4 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 846027306a9edcbdf7bf1a3271fd6f8b0d4b139d
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Wed Apr 11 14:06:15 2018 +0200

    make TextAttrib::Clone return by std::unique_ptr
    
    Change-Id: I8e3941c4c8507e7a898f5f2e0fb13543e5c129cd
    Reviewed-on: https://gerrit.libreoffice.org/52748
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/cui/source/dialogs/SpellAttrib.cxx 
b/cui/source/dialogs/SpellAttrib.cxx
index 7207f6c791e0..9d761a55b3f1 100644
--- a/cui/source/dialogs/SpellAttrib.cxx
+++ b/cui/source/dialogs/SpellAttrib.cxx
@@ -38,9 +38,9 @@ void SpellErrorAttrib::SetFont( vcl::Font&  ) const
 }
 
 
-TextAttrib*     SpellErrorAttrib::Clone() const
+std::unique_ptr<TextAttrib> SpellErrorAttrib::Clone() const
 {
-    return new SpellErrorAttrib(*this);
+    return std::unique_ptr<TextAttrib>(new SpellErrorAttrib(*this));
 }
 
 
@@ -64,9 +64,9 @@ void SpellLanguageAttrib::SetFont( vcl::Font&  ) const
 }
 
 
-TextAttrib* SpellLanguageAttrib::Clone() const
+std::unique_ptr<TextAttrib> SpellLanguageAttrib::Clone() const
 {
-    return new SpellLanguageAttrib(*this);
+    return std::unique_ptr<TextAttrib>(new SpellLanguageAttrib(*this));
 }
 
 
@@ -90,9 +90,9 @@ void SpellBackgroundAttrib::SetFont( vcl::Font& rFont ) const
 }
 
 
-TextAttrib* SpellBackgroundAttrib::Clone() const
+std::unique_ptr<TextAttrib> SpellBackgroundAttrib::Clone() const
 {
-    return new SpellBackgroundAttrib(*this);
+    return std::unique_ptr<TextAttrib>(new SpellBackgroundAttrib(*this));
 }
 
 
diff --git a/cui/source/dialogs/SpellAttrib.hxx 
b/cui/source/dialogs/SpellAttrib.hxx
index aabf466235c3..2a458166b42d 100644
--- a/cui/source/dialogs/SpellAttrib.hxx
+++ b/cui/source/dialogs/SpellAttrib.hxx
@@ -103,7 +103,7 @@ public:
 
 
     virtual void            SetFont( vcl::Font& rFont ) const override;
-    virtual TextAttrib*     Clone() const override;
+    virtual std::unique_ptr<TextAttrib> Clone() const override;
     virtual bool            operator==( const TextAttrib& rAttr ) const 
override;
 };
 
@@ -118,7 +118,7 @@ public:
     LanguageType            GetLanguage() const {return m_eLanguage;}
 
     virtual void            SetFont( vcl::Font& rFont ) const override;
-    virtual TextAttrib*     Clone() const override;
+    virtual std::unique_ptr<TextAttrib> Clone() const override;
     virtual bool            operator==( const TextAttrib& rAttr ) const 
override;
 };
 
@@ -131,7 +131,7 @@ public:
                             SpellBackgroundAttrib(const Color& rCol);
 
     virtual void            SetFont( vcl::Font& rFont ) const override;
-    virtual TextAttrib*     Clone() const override;
+    virtual std::unique_ptr<TextAttrib> Clone() const override;
     virtual bool            operator==( const TextAttrib& rAttr ) const 
override;
 };
 }//namespace svx
diff --git a/include/vcl/txtattr.hxx b/include/vcl/txtattr.hxx
index 8fadf98cc46f..db8da72f3d47 100644
--- a/include/vcl/txtattr.hxx
+++ b/include/vcl/txtattr.hxx
@@ -51,7 +51,7 @@ public:
 
     sal_uInt16              Which() const   { return mnWhich; }
     virtual void            SetFont( vcl::Font& rFont ) const = 0;
-    virtual TextAttrib*     Clone() const = 0;
+    virtual std::unique_ptr<TextAttrib> Clone() const = 0;
 
     virtual bool            operator==( const TextAttrib& rAttr ) const = 0;
     bool                    operator!=( const TextAttrib& rAttr ) const
@@ -70,7 +70,7 @@ public:
     const Color&            GetColor() const { return maColor; }
 
     virtual void            SetFont( vcl::Font& rFont ) const override;
-    virtual TextAttrib*     Clone() const override;
+    virtual std::unique_ptr<TextAttrib> Clone() const override;
     virtual bool            operator==( const TextAttrib& rAttr ) const 
override;
 
 };
@@ -84,7 +84,7 @@ public:
                             TextAttribFontWeight( FontWeight eWeight );
 
     virtual void            SetFont( vcl::Font& rFont ) const override;
-    virtual TextAttrib*     Clone() const override;
+    virtual std::unique_ptr<TextAttrib> Clone() const override;
     virtual bool            operator==( const TextAttrib& rAttr ) const 
override;
 
     FontWeight getFontWeight() const { return meWeight; }
@@ -96,7 +96,7 @@ public:
                             TextAttribProtect();
 
     virtual void            SetFont( vcl::Font& rFont ) const override;
-    virtual TextAttrib*     Clone() const override;
+    virtual std::unique_ptr<TextAttrib> Clone() const override;
     virtual bool            operator==( const TextAttrib& rAttr ) const 
override;
 
 };
diff --git a/vcl/source/edit/txtattr.cxx b/vcl/source/edit/txtattr.cxx
index 006c77b99160..8e979c1e3f94 100644
--- a/vcl/source/edit/txtattr.cxx
+++ b/vcl/source/edit/txtattr.cxx
@@ -39,9 +39,9 @@ void TextAttribFontColor::SetFont( vcl::Font& rFont ) const
     rFont.SetColor( maColor );
 }
 
-TextAttrib* TextAttribFontColor::Clone() const
+std::unique_ptr<TextAttrib> TextAttribFontColor::Clone() const
 {
-    return new TextAttribFontColor( *this );
+    return std::unique_ptr<TextAttrib>(new TextAttribFontColor( *this ));
 }
 
 bool TextAttribFontColor::operator==( const TextAttrib& rAttr ) const
@@ -60,9 +60,9 @@ void TextAttribFontWeight::SetFont( vcl::Font& rFont ) const
     rFont.SetWeight( meWeight );
 }
 
-TextAttrib* TextAttribFontWeight::Clone() const
+std::unique_ptr<TextAttrib> TextAttribFontWeight::Clone() const
 {
-    return new TextAttribFontWeight( *this );
+    return std::unique_ptr<TextAttrib>(new TextAttribFontWeight( *this ));
 }
 
 bool TextAttribFontWeight::operator==( const TextAttrib& rAttr ) const
@@ -80,9 +80,9 @@ void TextAttribProtect::SetFont( vcl::Font& ) const
 {
 }
 
-TextAttrib*     TextAttribProtect::Clone() const
+std::unique_ptr<TextAttrib> TextAttribProtect::Clone() const
 {
-    return new TextAttribProtect();
+    return std::unique_ptr<TextAttrib>(new TextAttribProtect());
 }
 
 bool TextAttribProtect::operator==( const TextAttrib& rAttr ) const
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to