summaryrefslogtreecommitdiff
path: root/editeng/source/uno/unotext.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-11 11:19:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-12 13:04:37 +0200
commit61dd9cafab20af893204deaca81ef26c1e7f7bb0 (patch)
tree295d290223a484138c2bea2f7e000e274815794a /editeng/source/uno/unotext.cxx
parente722564d40143fa029fe10d22a625539c795ee04 (diff)
make SvxEditSource::Clone return std::unique_ptr
Change-Id: If0d93024a642cc80a2a84d0c15525af1c0596546 Reviewed-on: https://gerrit.libreoffice.org/52715 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source/uno/unotext.cxx')
-rw-r--r--editeng/source/uno/unotext.cxx9
1 files changed, 5 insertions, 4 deletions
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()