Kaydet (Commit) 0c316e70 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

coverity: fix memory leak

Change-Id: Ie7ba893ed08ca6ba0083db20e4c887866d0b6642
üst 8063ede1
...@@ -315,7 +315,7 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord ) ...@@ -315,7 +315,7 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord )
const EditTextObject* pTObject = NULL; const EditTextObject* pTObject = NULL;
ScBaseCell* pCell = NULL; ScBaseCell* pCell = NULL;
EditView* pEditView = NULL; EditView* pEditView = NULL;
ESelection* pEditSel = NULL; boost::scoped_ptr<ESelection> pEditSel;
ScEditEngineDefaulter* pThesaurusEngine; ScEditEngineDefaulter* pThesaurusEngine;
sal_Bool bIsEditMode = GetViewData()->HasEditView(eWhich); sal_Bool bIsEditMode = GetViewData()->HasEditView(eWhich);
if (bRecord && !pDoc->IsUndoEnabled()) if (bRecord && !pDoc->IsUndoEnabled())
...@@ -323,7 +323,7 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord ) ...@@ -323,7 +323,7 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord )
if (bIsEditMode) // Edit-Mode aktiv if (bIsEditMode) // Edit-Mode aktiv
{ {
GetViewData()->GetEditView(eWhich, pEditView, nCol, nRow); GetViewData()->GetEditView(eWhich, pEditView, nCol, nRow);
pEditSel = new ESelection(pEditView->GetSelection()); pEditSel.reset(new ESelection(pEditView->GetSelection()));
SC_MOD()->InputEnterHandler(); SC_MOD()->InputEnterHandler();
GetViewData()->GetBindings().Update(); // sonst kommt der Sfx durcheinander... GetViewData()->GetBindings().Update(); // sonst kommt der Sfx durcheinander...
} }
...@@ -338,7 +338,6 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord ) ...@@ -338,7 +338,6 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord )
if (!aTester.IsEditable()) if (!aTester.IsEditable())
{ {
ErrorMessage(aTester.GetMessageId()); ErrorMessage(aTester.GetMessageId());
delete pEditSel;
return; return;
} }
pDoc->GetCellType(nCol, nRow, nTab, eCellType); pDoc->GetCellType(nCol, nRow, nTab, eCellType);
...@@ -440,7 +439,6 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord ) ...@@ -440,7 +439,6 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord )
delete pEditDefaults; delete pEditDefaults;
delete pThesaurusEngine; delete pThesaurusEngine;
delete pOldTObj; delete pOldTObj;
delete pEditSel;
pDocSh->PostPaintGridAll(); pDocSh->PostPaintGridAll();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment