diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-02-16 00:39:24 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-02-16 01:01:00 +0100 |
commit | 0c316e7048131730a9a5bc713796dd917149700e (patch) | |
tree | 3d1080fdfc0c399d8cec07a0c6d881133ede1543 /sc/source/ui/view/viewfun4.cxx | |
parent | 8063ede18d03560cec296fab4152be9b24ec8ff8 (diff) |
coverity: fix memory leak
Change-Id: Ie7ba893ed08ca6ba0083db20e4c887866d0b6642
Diffstat (limited to 'sc/source/ui/view/viewfun4.cxx')
-rw-r--r-- | sc/source/ui/view/viewfun4.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index 695b2ab7669d..0b3158c6d291 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -315,7 +315,7 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord ) const EditTextObject* pTObject = NULL; ScBaseCell* pCell = NULL; EditView* pEditView = NULL; - ESelection* pEditSel = NULL; + boost::scoped_ptr<ESelection> pEditSel; ScEditEngineDefaulter* pThesaurusEngine; sal_Bool bIsEditMode = GetViewData()->HasEditView(eWhich); if (bRecord && !pDoc->IsUndoEnabled()) @@ -323,7 +323,7 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord ) if (bIsEditMode) // Edit-Mode aktiv { GetViewData()->GetEditView(eWhich, pEditView, nCol, nRow); - pEditSel = new ESelection(pEditView->GetSelection()); + pEditSel.reset(new ESelection(pEditView->GetSelection())); SC_MOD()->InputEnterHandler(); GetViewData()->GetBindings().Update(); // sonst kommt der Sfx durcheinander... } @@ -338,7 +338,6 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord ) if (!aTester.IsEditable()) { ErrorMessage(aTester.GetMessageId()); - delete pEditSel; return; } pDoc->GetCellType(nCol, nRow, nTab, eCellType); @@ -440,7 +439,6 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord ) delete pEditDefaults; delete pThesaurusEngine; delete pOldTObj; - delete pEditSel; pDocSh->PostPaintGridAll(); } |