[Libreoffice-commits] core.git: editeng/source forms/source include/editeng include/svx sc/inc sc/source sd/source starmath/source svx/source sw/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Apr 12 11:05:52 UTC 2018


 editeng/source/uno/unoedprx.cxx                            |    6 +--
 editeng/source/uno/unotext.cxx                             |    9 +++--
 editeng/source/uno/unotext2.cxx                            |    5 +--
 editeng/source/xml/editsource.hxx                          |    2 -
 editeng/source/xml/xmltxtexp.cxx                           |    4 +-
 forms/source/richtext/richtextunowrapper.cxx               |    4 +-
 forms/source/richtext/richtextunowrapper.hxx               |    2 -
 include/editeng/unoedprx.hxx                               |    2 -
 include/editeng/unoedsrc.hxx                               |    2 -
 include/editeng/unotext.hxx                                |    2 -
 include/svx/unoshtxt.hxx                                   |    2 -
 sc/inc/editsrc.hxx                                         |   10 +++---
 sc/source/ui/unoobj/editsrc.cxx                            |   20 ++++++-------
 sd/source/core/text/textapi.cxx                            |    6 +--
 sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx |    4 +-
 sd/source/ui/inc/AccessibleOutlineEditSource.hxx           |    2 -
 starmath/source/accessibility.cxx                          |    4 +-
 starmath/source/accessibility.hxx                          |    2 -
 svx/source/accessibility/AccessibleEmptyEditSource.cxx     |    8 ++---
 svx/source/accessibility/AccessibleEmptyEditSource.hxx     |    2 -
 svx/source/unodraw/unoshtxt.cxx                            |    4 +-
 sw/source/core/fields/textapi.cxx                          |    4 +-
 sw/source/core/inc/textapi.hxx                             |    2 -
 sw/source/uibase/docvw/SidebarTxtControlAcc.cxx            |    6 +--
 24 files changed, 58 insertions(+), 56 deletions(-)

New commits:
commit 61dd9cafab20af893204deaca81ef26c1e7f7bb0
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Apr 11 11:19:37 2018 +0200

    make SvxEditSource::Clone return std::unique_ptr
    
    Change-Id: If0d93024a642cc80a2a84d0c15525af1c0596546
    Reviewed-on: https://gerrit.libreoffice.org/52715
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx
index c17c97971658..2ebc9bf56a01 100644
--- a/editeng/source/uno/unoedprx.cxx
+++ b/editeng/source/uno/unoedprx.cxx
@@ -300,7 +300,7 @@ SvxEditSourceAdapter::~SvxEditSourceAdapter()
 {
 }
 
-SvxEditSource* SvxEditSourceAdapter::Clone() const
+std::unique_ptr<SvxEditSource> SvxEditSourceAdapter::Clone() const
 {
     if( mbEditSourceValid && mpAdaptee.get() )
     {
@@ -308,9 +308,9 @@ SvxEditSource* SvxEditSourceAdapter::Clone() const
 
         if( pClonedAdaptee.get() )
         {
-            SvxEditSourceAdapter* pClone = new SvxEditSourceAdapter();
+            std::unique_ptr<SvxEditSourceAdapter> pClone(new SvxEditSourceAdapter());
             pClone->SetEditSource( std::move(pClonedAdaptee) );
-            return pClone;
+            return std::unique_ptr< SvxEditSource >(pClone.release());
         }
     }
 
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 09805ce0705d..39cff94eb2d6 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -219,7 +219,7 @@ SvxUnoTextRangeBase::SvxUnoTextRangeBase(const SvxEditSource* pSource, const Svx
 
     DBG_ASSERT(pSource,"SvxUnoTextRangeBase: I need a valid SvxEditSource!");
 
-    mpEditSource.reset( pSource->Clone() );
+    mpEditSource = pSource->Clone();
     if (mpEditSource != nullptr)
     {
         ESelection aSelection;
@@ -244,7 +244,8 @@ SvxUnoTextRangeBase::SvxUnoTextRangeBase(const SvxUnoTextRangeBase& rRange)
 {
     SolarMutexGuard aGuard;
 
-    mpEditSource.reset( rRange.mpEditSource ? rRange.mpEditSource->Clone() : nullptr );
+    if (rRange.mpEditSource)
+        mpEditSource = rRange.mpEditSource->Clone();
 
     SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr;
     if( pForwarder )
@@ -2291,9 +2292,9 @@ SvxDummyTextSource::~SvxDummyTextSource()
 {
 };
 
-SvxEditSource* SvxDummyTextSource::Clone() const
+std::unique_ptr<SvxEditSource> SvxDummyTextSource::Clone() const
 {
-    return new SvxDummyTextSource;
+    return std::unique_ptr<SvxEditSource>(new SvxDummyTextSource);
 }
 
 SvxTextForwarder* SvxDummyTextSource::GetTextForwarder()
diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx
index 9c2c26151cfd..09c178e8c434 100644
--- a/editeng/source/uno/unotext2.cxx
+++ b/editeng/source/uno/unotext2.cxx
@@ -45,7 +45,7 @@ SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase
 {
     mxParentText = const_cast<SvxUnoTextBase*>(&_rText);
     if( mrText.GetEditSource() )
-        mpEditSource.reset( mrText.GetEditSource()->Clone() );
+        mpEditSource = mrText.GetEditSource()->Clone();
     mnNextParagraph = 0;
     for( sal_Int32 currentPara = 0; currentPara < mrText.GetEditSource()->GetTextForwarder()->GetParagraphCount(); currentPara++ )
     {
@@ -384,7 +384,8 @@ SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration(const SvxUnoTextBase& rTe
     mnNextPortion( 0 ),
     mnSel( rSel )
 {
-    mpEditSource.reset( rText.GetEditSource() ? rText.GetEditSource()->Clone() : nullptr );
+    if (rText.GetEditSource())
+        mpEditSource = rText.GetEditSource()->Clone();
 
     if( mpEditSource && mpEditSource->GetTextForwarder() && (mnParagraph == mnSel.nStartPara && mnParagraph == mnSel.nEndPara) )
     {
diff --git a/editeng/source/xml/editsource.hxx b/editeng/source/xml/editsource.hxx
index 335427808690..51d5fc968976 100644
--- a/editeng/source/xml/editsource.hxx
+++ b/editeng/source/xml/editsource.hxx
@@ -31,7 +31,7 @@ public:
     explicit SvxEditEngineSource( EditEngine* pEditEngine );
     virtual ~SvxEditEngineSource() override;
 
-    virtual SvxEditSource*      Clone() const override;
+    virtual std::unique_ptr<SvxEditSource> Clone() const override;
     virtual SvxTextForwarder*   GetTextForwarder() override;
     virtual void                UpdateData() override;
 
diff --git a/editeng/source/xml/xmltxtexp.cxx b/editeng/source/xml/xmltxtexp.cxx
index 083d23626bd8..0f4e59ebefcb 100644
--- a/editeng/source/xml/xmltxtexp.cxx
+++ b/editeng/source/xml/xmltxtexp.cxx
@@ -108,9 +108,9 @@ SvxEditEngineSource::~SvxEditEngineSource()
 {
 }
 
-SvxEditSource* SvxEditEngineSource::Clone() const
+std::unique_ptr<SvxEditSource> SvxEditEngineSource::Clone() const
 {
-    return new SvxEditEngineSource( mxImpl.get() );
+    return std::unique_ptr<SvxEditSource>(new SvxEditEngineSource( mxImpl.get() ));
 }
 
 SvxTextForwarder* SvxEditEngineSource::GetTextForwarder()
diff --git a/forms/source/richtext/richtextunowrapper.cxx b/forms/source/richtext/richtextunowrapper.cxx
index a168361d2950..34a6fb48568c 100644
--- a/forms/source/richtext/richtextunowrapper.cxx
+++ b/forms/source/richtext/richtextunowrapper.cxx
@@ -85,9 +85,9 @@ namespace frm
     }
 
 
-    SvxEditSource* RichTextEditSource::Clone() const
+    std::unique_ptr<SvxEditSource> RichTextEditSource::Clone() const
     {
-        return new RichTextEditSource( m_rEngine, m_pTextChangeListener );
+        return std::unique_ptr<SvxEditSource>(new RichTextEditSource( m_rEngine, m_pTextChangeListener ));
     }
 
 
diff --git a/forms/source/richtext/richtextunowrapper.hxx b/forms/source/richtext/richtextunowrapper.hxx
index a612cdc74947..add7c5983ed7 100644
--- a/forms/source/richtext/richtextunowrapper.hxx
+++ b/forms/source/richtext/richtextunowrapper.hxx
@@ -63,7 +63,7 @@ namespace frm
         RichTextEditSource( EditEngine& _rEngine, IEngineTextChangeListener* _pTextChangeListener );
 
         // SvxEditSource
-        virtual SvxEditSource*      Clone() const override;
+        virtual std::unique_ptr<SvxEditSource> Clone() const override;
         virtual SvxTextForwarder*   GetTextForwarder() override;
         virtual void                UpdateData() override;
 
diff --git a/include/editeng/unoedprx.hxx b/include/editeng/unoedprx.hxx
index 559c0390294e..f4f9cd66c0a5 100644
--- a/include/editeng/unoedprx.hxx
+++ b/include/editeng/unoedprx.hxx
@@ -142,7 +142,7 @@ public:
     SvxEditSourceAdapter();
     virtual ~SvxEditSourceAdapter() override;
 
-    virtual SvxEditSource*                      Clone() const override;
+    virtual std::unique_ptr<SvxEditSource>      Clone() const override;
     virtual SvxTextForwarder*                   GetTextForwarder() override;
     SvxAccessibleTextAdapter*                   GetTextForwarderAdapter(); // covariant return types don't work on MSVC
     virtual SvxViewForwarder*                   GetViewForwarder() override;
diff --git a/include/editeng/unoedsrc.hxx b/include/editeng/unoedsrc.hxx
index adfdae894aeb..026f887f0c41 100644
--- a/include/editeng/unoedsrc.hxx
+++ b/include/editeng/unoedsrc.hxx
@@ -59,7 +59,7 @@ public:
     virtual                 ~SvxEditSource();
 
     /// Returns a new reference to the same object. This is a shallow copy
-    virtual SvxEditSource*      Clone() const = 0;
+    virtual std::unique_ptr<SvxEditSource> Clone() const = 0;
 
     /** Query the text forwarder
 
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index 1e15f8d5e033..ca263071bf98 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -172,7 +172,7 @@ public:
 
     // SvxEditSource
     virtual ~SvxDummyTextSource() override;
-    virtual SvxEditSource*          Clone() const override;
+    virtual std::unique_ptr<SvxEditSource> Clone() const override;
     virtual SvxTextForwarder*       GetTextForwarder() override;
     virtual void                    UpdateData() override;
 
diff --git a/include/svx/unoshtxt.hxx b/include/svx/unoshtxt.hxx
index 7cb75bd1f118..55afd0f40207 100644
--- a/include/svx/unoshtxt.hxx
+++ b/include/svx/unoshtxt.hxx
@@ -56,7 +56,7 @@ public:
     SvxTextEditSource& operator=(const SvxTextEditSource&) = delete;
     virtual ~SvxTextEditSource() override;
 
-    virtual SvxEditSource*          Clone() const override;
+    virtual std::unique_ptr<SvxEditSource> Clone() const override;
     virtual SvxTextForwarder*       GetTextForwarder() override;
     virtual SvxViewForwarder*      GetViewForwarder() override;
     virtual SvxEditViewForwarder*  GetEditViewForwarder( bool bCreate = false ) override;
diff --git a/sc/inc/editsrc.hxx b/sc/inc/editsrc.hxx
index ae07f6e43907..71c5f90c488d 100644
--- a/sc/inc/editsrc.hxx
+++ b/sc/inc/editsrc.hxx
@@ -59,7 +59,7 @@ public:
     //  GetEditEngine is needed because the forwarder doesn't have field functions
     virtual ScEditEngineDefaulter* GetEditEngine() override;
 
-    virtual SvxEditSource*      Clone() const override;
+    virtual std::unique_ptr<SvxEditSource> Clone() const override;
     virtual SvxTextForwarder*   GetTextForwarder() override;
     virtual void                UpdateData() override;
 };
@@ -83,7 +83,7 @@ public:
     //  GetEditEngine is needed because the forwarder doesn't have field functions
     virtual ScEditEngineDefaulter* GetEditEngine() override;
 
-    virtual SvxEditSource* Clone() const override;
+    virtual std::unique_ptr<SvxEditSource> Clone() const override;
     virtual SvxTextForwarder* GetTextForwarder() override;
 
     virtual void UpdateData() override;
@@ -106,7 +106,7 @@ public:
                                 ScAnnotationEditSource(ScDocShell* pDocSh, const ScAddress& rP);
     virtual                     ~ScAnnotationEditSource() override;
 
-    virtual SvxEditSource*      Clone() const override ;
+    virtual std::unique_ptr<SvxEditSource> Clone() const override ;
     virtual SvxTextForwarder*   GetTextForwarder() override;
     virtual void                UpdateData() override;
 
@@ -124,7 +124,7 @@ public:
                         ScSimpleEditSource( SvxTextForwarder* pForw );
     virtual             ~ScSimpleEditSource() override;
 
-    virtual SvxEditSource*      Clone() const override ;
+    virtual std::unique_ptr<SvxEditSource> Clone() const override ;
     virtual SvxTextForwarder*   GetTextForwarder() override;
     virtual void                UpdateData() override;
 
@@ -139,7 +139,7 @@ public:
                         ScAccessibilityEditSource( ::std::unique_ptr < ScAccessibleTextData > && pAccessibleCellTextData );
     virtual             ~ScAccessibilityEditSource() override;
 
-    virtual SvxEditSource*      Clone() const override;
+    virtual std::unique_ptr<SvxEditSource> Clone() const override;
     virtual SvxTextForwarder*   GetTextForwarder() override;
     virtual SvxViewForwarder*   GetViewForwarder() override;
     virtual SvxEditViewForwarder*   GetEditViewForwarder( bool bCreate = false ) override;
diff --git a/sc/source/ui/unoobj/editsrc.cxx b/sc/source/ui/unoobj/editsrc.cxx
index b30fb6909b23..fb59b24b328e 100644
--- a/sc/source/ui/unoobj/editsrc.cxx
+++ b/sc/source/ui/unoobj/editsrc.cxx
@@ -55,9 +55,9 @@ ScEditEngineDefaulter* ScHeaderFooterEditSource::GetEditEngine()
     return mrTextData.GetEditEngine();
 }
 
-SvxEditSource* ScHeaderFooterEditSource::Clone() const
+std::unique_ptr<SvxEditSource> ScHeaderFooterEditSource::Clone() const
 {
-    return new ScHeaderFooterEditSource(mrTextData);
+    return std::unique_ptr<SvxEditSource>(new ScHeaderFooterEditSource(mrTextData));
 }
 
 SvxTextForwarder* ScHeaderFooterEditSource::GetTextForwarder()
@@ -77,9 +77,9 @@ ScCellEditSource::~ScCellEditSource()
 {
 }
 
-SvxEditSource* ScCellEditSource::Clone() const
+std::unique_ptr<SvxEditSource> ScCellEditSource::Clone() const
 {
-    return new ScCellEditSource(pCellTextData->GetDocShell(), pCellTextData->GetCellPos());
+    return std::unique_ptr<SvxEditSource>(new ScCellEditSource(pCellTextData->GetDocShell(), pCellTextData->GetCellPos()));
 }
 
 SvxTextForwarder* ScCellEditSource::GetTextForwarder()
@@ -129,9 +129,9 @@ ScAnnotationEditSource::~ScAnnotationEditSource()
     delete pEditEngine;
 }
 
-SvxEditSource* ScAnnotationEditSource::Clone() const
+std::unique_ptr<SvxEditSource> ScAnnotationEditSource::Clone() const
 {
-    return new ScAnnotationEditSource( pDocShell, aCellPos );
+    return std::unique_ptr<SvxEditSource>(new ScAnnotationEditSource( pDocShell, aCellPos ));
 }
 
 SdrObject* ScAnnotationEditSource::GetCaptionObj()
@@ -227,9 +227,9 @@ ScSimpleEditSource::~ScSimpleEditSource()
 {
 }
 
-SvxEditSource* ScSimpleEditSource::Clone() const
+std::unique_ptr<SvxEditSource> ScSimpleEditSource::Clone() const
 {
-    return new ScSimpleEditSource( pForwarder );
+    return std::unique_ptr<SvxEditSource>(new ScSimpleEditSource( pForwarder ));
 }
 
 SvxTextForwarder* ScSimpleEditSource::GetTextForwarder()
@@ -251,9 +251,9 @@ ScAccessibilityEditSource::~ScAccessibilityEditSource()
 {
 }
 
-SvxEditSource* ScAccessibilityEditSource::Clone() const
+std::unique_ptr<SvxEditSource> ScAccessibilityEditSource::Clone() const
 {
-    return new ScAccessibilityEditSource(::std::unique_ptr < ScAccessibleTextData > (mpAccessibleTextData->Clone()));
+    return std::unique_ptr<SvxEditSource>(new ScAccessibilityEditSource(::std::unique_ptr < ScAccessibleTextData > (mpAccessibleTextData->Clone())));
 }
 
 SvxTextForwarder* ScAccessibilityEditSource::GetTextForwarder()
diff --git a/sd/source/core/text/textapi.cxx b/sd/source/core/text/textapi.cxx
index e9806a66a646..40e40dc3fb3b 100644
--- a/sd/source/core/text/textapi.cxx
+++ b/sd/source/core/text/textapi.cxx
@@ -88,7 +88,7 @@ class TextAPIEditSource : public SvxEditSource
     // refcounted
     std::shared_ptr<TextAPIEditSource_Impl> m_xImpl;
 
-    virtual SvxEditSource*      Clone() const override;
+    virtual std::unique_ptr<SvxEditSource> Clone() const override;
     virtual SvxTextForwarder*   GetTextForwarder() override;
     virtual void                UpdateData() override;
     explicit            TextAPIEditSource( const TextAPIEditSource& rSource );
@@ -186,9 +186,9 @@ TextAPIEditSource::TextAPIEditSource(const TextAPIEditSource& rSource)
 {
 }
 
-SvxEditSource* TextAPIEditSource::Clone() const
+std::unique_ptr<SvxEditSource> TextAPIEditSource::Clone() const
 {
-    return new TextAPIEditSource( *this );
+    return std::unique_ptr<SvxEditSource>(new TextAPIEditSource( *this ));
 }
 
 void TextAPIEditSource::UpdateData()
diff --git a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx
index 1b64aebb1687..703aeedbd6a8 100644
--- a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx
+++ b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx
@@ -53,9 +53,9 @@ namespace accessibility
         Broadcast( TextHint( SfxHintId::Dying ) );
     }
 
-    SvxEditSource* AccessibleOutlineEditSource::Clone() const
+    std::unique_ptr<SvxEditSource> AccessibleOutlineEditSource::Clone() const
     {
-        return new AccessibleOutlineEditSource(*mpOutliner, mrView, *mpOutlinerView, mrWindow);
+        return std::unique_ptr<SvxEditSource>(new AccessibleOutlineEditSource(*mpOutliner, mrView, *mpOutlinerView, mrWindow));
     }
 
     SvxTextForwarder* AccessibleOutlineEditSource::GetTextForwarder()
diff --git a/sd/source/ui/inc/AccessibleOutlineEditSource.hxx b/sd/source/ui/inc/AccessibleOutlineEditSource.hxx
index 48af77ca7015..b703f8c6d0a0 100644
--- a/sd/source/ui/inc/AccessibleOutlineEditSource.hxx
+++ b/sd/source/ui/inc/AccessibleOutlineEditSource.hxx
@@ -56,7 +56,7 @@ namespace accessibility
         virtual ~AccessibleOutlineEditSource() override;
 
         /// This method is disabled and always returns NULL
-        virtual SvxEditSource*          Clone() const override;
+        virtual std::unique_ptr<SvxEditSource> Clone() const override;
         virtual SvxTextForwarder*       GetTextForwarder() override;
         virtual SvxViewForwarder*       GetViewForwarder() override;
         virtual SvxEditViewForwarder*   GetEditViewForwarder( bool bCreate = false ) override;
diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index 84eb1b1c0911..9b2bf3a3b97b 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -761,9 +761,9 @@ SmEditSource::~SmEditSource()
 {
 }
 
-SvxEditSource* SmEditSource::Clone() const
+std::unique_ptr<SvxEditSource> SmEditSource::Clone() const
 {
-    return new SmEditSource( *this );
+    return std::unique_ptr<SvxEditSource>(new SmEditSource( *this ));
 }
 
 SvxTextForwarder* SmEditSource::GetTextForwarder()
diff --git a/starmath/source/accessibility.hxx b/starmath/source/accessibility.hxx
index e2ed62cc8dce..2dc092af1099 100644
--- a/starmath/source/accessibility.hxx
+++ b/starmath/source/accessibility.hxx
@@ -279,7 +279,7 @@ public:
             SmEditSource( SmEditAccessible &rAcc );
     virtual ~SmEditSource() override;
 
-    virtual SvxEditSource*      Clone() const override;
+    virtual std::unique_ptr<SvxEditSource> Clone() const override;
     virtual SvxTextForwarder*   GetTextForwarder() override;
     virtual SvxViewForwarder*  GetViewForwarder() override;
     virtual SvxEditViewForwarder*  GetEditViewForwarder( bool bCreate = false ) override;
diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
index 19a09ec8f502..f42ba7221187 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
@@ -60,7 +60,7 @@ namespace accessibility
         SvxViewForwarder*       GetViewForwarder() override;
         SvxEditViewForwarder*   GetEditViewForwarder( bool bCreate = false ) override;
 
-        SvxEditSource*          Clone() const override;
+        std::unique_ptr<SvxEditSource> Clone() const override;
 
         void                    UpdateData() override;
 
@@ -82,7 +82,7 @@ namespace accessibility
         // SvxEditSource
         SvxTextForwarder*       GetTextForwarder() override { return this; }
         SvxViewForwarder*       GetViewForwarder() override { return this; }
-        SvxEditSource*          Clone() const override { return nullptr; }
+        std::unique_ptr<SvxEditSource> Clone() const override { return nullptr; }
         void                    UpdateData() override {}
         SfxBroadcaster&         GetBroadcaster() const override { return *const_cast<AccessibleEmptyEditSource_Impl*>(this); }
 
@@ -190,7 +190,7 @@ namespace accessibility
         return maEditSource.GetEditViewForwarder( bCreate );
     }
 
-    SvxEditSource* AccessibleProxyEditSource_Impl::Clone() const
+    std::unique_ptr<SvxEditSource> AccessibleProxyEditSource_Impl::Clone() const
     {
         return maEditSource.Clone();
     }
@@ -278,7 +278,7 @@ namespace accessibility
         return mpEditSource->GetEditViewForwarder( bCreate );
     }
 
-    SvxEditSource* AccessibleEmptyEditSource::Clone() const
+    std::unique_ptr<SvxEditSource> AccessibleEmptyEditSource::Clone() const
     {
         if( !mpEditSource.get() )
             return nullptr;
diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.hxx b/svx/source/accessibility/AccessibleEmptyEditSource.hxx
index 5fb7926c62ae..beb3bdae9f9d 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.hxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.hxx
@@ -56,7 +56,7 @@ namespace accessibility
         SvxTextForwarder*       GetTextForwarder() override;
         SvxViewForwarder*       GetViewForwarder() override;
 
-        SvxEditSource*          Clone() const override;
+        std::unique_ptr<SvxEditSource> Clone() const override;
 
         // this method internally switches from empty to proxy mode,
         // creating an SvxTextEditSource for the functionality.
diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index a90040b10a86..9fdefcbb5791 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -976,9 +976,9 @@ SvxTextEditSource::~SvxTextEditSource()
 }
 
 
-SvxEditSource* SvxTextEditSource::Clone() const
+std::unique_ptr<SvxEditSource> SvxTextEditSource::Clone() const
 {
-    return new SvxTextEditSource( mpImpl.get() );
+    return std::unique_ptr<SvxEditSource>(new SvxTextEditSource( mpImpl.get() ));
 }
 
 
diff --git a/sw/source/core/fields/textapi.cxx b/sw/source/core/fields/textapi.cxx
index 0a35462ce69c..5813ecc832cc 100644
--- a/sw/source/core/fields/textapi.cxx
+++ b/sw/source/core/fields/textapi.cxx
@@ -85,9 +85,9 @@ SwTextAPIEditSource::SwTextAPIEditSource( const SwTextAPIEditSource& rSource )
     pImpl->mnRef++;
 }
 
-SvxEditSource* SwTextAPIEditSource::Clone() const
+std::unique_ptr<SvxEditSource> SwTextAPIEditSource::Clone() const
 {
-    return new SwTextAPIEditSource( *this );
+    return std::unique_ptr<SvxEditSource>(new SwTextAPIEditSource( *this ));
 }
 
 void SwTextAPIEditSource::UpdateData()
diff --git a/sw/source/core/inc/textapi.hxx b/sw/source/core/inc/textapi.hxx
index ff9305585610..4b3fa15628f4 100644
--- a/sw/source/core/inc/textapi.hxx
+++ b/sw/source/core/inc/textapi.hxx
@@ -35,7 +35,7 @@ class SwTextAPIEditSource : public SvxEditSource
 {
     SwTextAPIEditSource_Impl* pImpl;
 
-    virtual SvxEditSource*      Clone() const override;
+    virtual std::unique_ptr<SvxEditSource> Clone() const override;
     virtual SvxTextForwarder*   GetTextForwarder() override;
     virtual void                UpdateData() override;
     explicit            SwTextAPIEditSource( const SwTextAPIEditSource& rSource );
diff --git a/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx b/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
index 1df89c8e13f5..7cab19c264d5 100644
--- a/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
@@ -46,7 +46,7 @@ class SidebarTextEditSource : public SvxEditSource,
         explicit SidebarTextEditSource(SidebarTextControl& rSidebarTextControl);
         virtual ~SidebarTextEditSource() override;
 
-        virtual SvxEditSource* Clone() const override;
+        virtual std::unique_ptr<SvxEditSource> Clone() const override;
 
         virtual SvxTextForwarder* GetTextForwarder() override;
         virtual SvxViewForwarder* GetViewForwarder() override;
@@ -83,9 +83,9 @@ SidebarTextEditSource::~SidebarTextEditSource()
     }
 }
 
-SvxEditSource* SidebarTextEditSource::Clone() const
+std::unique_ptr<SvxEditSource> SidebarTextEditSource::Clone() const
 {
-    return new SidebarTextEditSource( mrSidebarTextControl );
+    return std::unique_ptr<SvxEditSource>(new SidebarTextEditSource( mrSidebarTextControl ));
 }
 
 SvxTextForwarder* SidebarTextEditSource::GetTextForwarder()


More information about the Libreoffice-commits mailing list