summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-10 11:19:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-12 14:18:09 +0200
commit92ac45b1920fcce8259c1eab94357415e8f50d82 (patch)
tree4d55408b9346e99f2ee138080206a31ab685c104
parentd43fa87fbcb46a44e61338105b6da9eb8a1a5b15 (diff)
loplugin:useuniqueptr in ScAccessibleHeaderTextData
Change-Id: I545988d672b9b07ab7930ce280d93ced8b31f327 Reviewed-on: https://gerrit.libreoffice.org/52761 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx14
-rw-r--r--sc/source/ui/inc/AccessibleText.hxx4
2 files changed, 9 insertions, 9 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 3ca075385213..e75f49850177 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -1325,8 +1325,8 @@ ScAccessibleHeaderTextData::~ScAccessibleHeaderTextData()
mpDocSh->GetDocument().RemoveUnoObject(*this);
if (mpEditEngine)
mpEditEngine->SetNotifyHdl(Link<EENotify&,void>());
- delete mpEditEngine;
- delete mpForwarder;
+ mpEditEngine.reset();
+ mpForwarder.reset();
}
ScAccessibleTextData* ScAccessibleHeaderTextData::Clone() const
@@ -1351,7 +1351,7 @@ SvxTextForwarder* ScAccessibleHeaderTextData::GetTextForwarder()
{
SfxItemPool* pEnginePool = EditEngine::CreatePool();
pEnginePool->FreezeIdRanges();
- ScHeaderEditEngine* pHdrEngine = new ScHeaderEditEngine( pEnginePool );
+ std::unique_ptr<ScHeaderEditEngine> pHdrEngine(new ScHeaderEditEngine( pEnginePool ));
pHdrEngine->EnableUndo( false );
pHdrEngine->SetRefMapMode(MapMode(MapUnit::MapTwip));
@@ -1380,12 +1380,12 @@ SvxTextForwarder* ScAccessibleHeaderTextData::GetTextForwarder()
ScHeaderFooterTextObj::FillDummyFieldData( aData );
pHdrEngine->SetData( aData );
- mpEditEngine = pHdrEngine;
- mpForwarder = new SvxEditEngineForwarder(*mpEditEngine);
+ mpEditEngine = std::move(pHdrEngine);
+ mpForwarder.reset(new SvxEditEngineForwarder(*mpEditEngine));
}
if (mbDataValid)
- return mpForwarder;
+ return mpForwarder.get();
if ( mpViewShell )
{
@@ -1401,7 +1401,7 @@ SvxTextForwarder* ScAccessibleHeaderTextData::GetTextForwarder()
mpEditEngine->SetText(*mpEditObj);
mbDataValid = true;
- return mpForwarder;
+ return mpForwarder.get();
}
SvxViewForwarder* ScAccessibleHeaderTextData::GetViewForwarder()
diff --git a/sc/source/ui/inc/AccessibleText.hxx b/sc/source/ui/inc/AccessibleText.hxx
index 860534504c85..e802af493082 100644
--- a/sc/source/ui/inc/AccessibleText.hxx
+++ b/sc/source/ui/inc/AccessibleText.hxx
@@ -216,8 +216,8 @@ public:
private:
ScPreviewViewForwarder* mpViewForwarder;
ScPreviewShell* mpViewShell;
- ScEditEngineDefaulter* mpEditEngine;
- SvxEditEngineForwarder* mpForwarder;
+ std::unique_ptr<ScEditEngineDefaulter> mpEditEngine;
+ std::unique_ptr<SvxEditEngineForwarder> mpForwarder;
ScDocShell* mpDocSh;
const EditTextObject* mpEditObj;
bool mbHeader;