summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/textuno.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-03 09:40:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-04 09:56:53 +0200
commitaab78c06f42fea5662c32d842e513bd212aa9c31 (patch)
tree760269c198de99ce6137f9a4b013b73cae255d99 /sc/source/ui/unoobj/textuno.cxx
parent96928bb74a993f3020ed71776d11b9849501f90c (diff)
loplugin:useuniqueptr in ScCellTextData
Change-Id: I60a0ffe27b2bbd7d2661fc0fa288730cb71be0b2 Reviewed-on: https://gerrit.libreoffice.org/56904 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/unoobj/textuno.cxx')
-rw-r--r--sc/source/ui/unoobj/textuno.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index 6642e3af57a8..9bf082c2b184 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -886,16 +886,16 @@ ScCellTextData::~ScCellTextData()
else
pEditEngine.reset();
- delete pForwarder;
+ pForwarder.reset();
- delete pOriginalSource;
+ pOriginalSource.reset();
}
ScCellEditSource* ScCellTextData::GetOriginalSource()
{
if (!pOriginalSource)
- pOriginalSource = new ScCellEditSource(pDocShell, aCellPos);
- return pOriginalSource;
+ pOriginalSource.reset( new ScCellEditSource(pDocShell, aCellPos) );
+ return pOriginalSource.get();
}
SvxTextForwarder* ScCellTextData::GetTextForwarder()
@@ -921,11 +921,11 @@ SvxTextForwarder* ScCellTextData::GetTextForwarder()
pEditEngine->SetRefDevice(pDocShell->GetRefDevice());
else
pEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM));
- pForwarder = new SvxEditEngineForwarder(*pEditEngine);
+ pForwarder.reset( new SvxEditEngineForwarder(*pEditEngine) );
}
if (bDataValid)
- return pForwarder;
+ return pForwarder.get();
OUString aText;
@@ -959,7 +959,7 @@ SvxTextForwarder* ScCellTextData::GetTextForwarder()
}
bDataValid = true;
- return pForwarder;
+ return pForwarder.get();
}
void ScCellTextData::UpdateData()
@@ -990,7 +990,7 @@ void ScCellTextData::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
pDocShell = nullptr; // invalid now
- DELETEZ( pForwarder );
+ pForwarder.reset();
pEditEngine.reset(); // EditEngine uses document's pool
}
else if ( nId == SfxHintId::DataChanged )