diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-20 12:54:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-22 09:53:45 +0100 |
commit | b7654432bfeca619b7657abc8d27193e44cf4dfc (patch) | |
tree | 0935306e00e967c1dca4efc8af57f4d67c30a508 /sc/source/ui/unoobj/textuno.cxx | |
parent | f82888653c853f236ab0035bb578a7129ec72fa5 (diff) |
loplugin:useuniqueptr in ScDocument
and fix bug where we were deleting a pointer to an object
we did not own via pFormatExchangeList
Change-Id: I488c679734c48bd21bc6be04837e037e97550647
Reviewed-on: https://gerrit.libreoffice.org/51668
Tested-by: Jenkins <ci@libreoffice.org>
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.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index ee4600b6627c..5d4576636105 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -889,7 +889,7 @@ ScCellTextData::~ScCellTextData() pDocShell->GetDocument().DisposeFieldEditEngine(pEditEngine); } else - delete pEditEngine; + pEditEngine.reset(); delete pForwarder; @@ -916,7 +916,7 @@ SvxTextForwarder* ScCellTextData::GetTextForwarder() { SfxItemPool* pEnginePool = EditEngine::CreatePool(); pEnginePool->FreezeIdRanges(); - pEditEngine = new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true); + pEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true) ); } // currently, GetPortions doesn't work if UpdateMode is sal_False, // this will be fixed (in EditEngine) by src600 @@ -1004,7 +1004,7 @@ void ScCellTextData::Notify( SfxBroadcaster&, const SfxHint& rHint ) pDocShell = nullptr; // invalid now DELETEZ( pForwarder ); - DELETEZ( pEditEngine ); // EditEngine uses document's pool + pEditEngine.reset(); // EditEngine uses document's pool } else if ( nId == SfxHintId::DataChanged ) { |