coverity#705829 Dereference before null check

Change-Id: Ic624b6bab3215148ff0b9a73fd24577623b398f9
This commit is contained in:
Caolán McNamara
2014-03-15 14:12:06 +00:00
parent 267c37038b
commit cf4ad5f6c5

View File

@@ -410,15 +410,23 @@ void ScXMLChangeTrackingImportHelper::AddGenerated(ScMyCellInfo* pCellInfo, cons
void ScXMLChangeTrackingImportHelper::EndChangeAction() void ScXMLChangeTrackingImportHelper::EndChangeAction()
{ {
if (!pCurrentAction)
{
OSL_FAIL("no current action");
return;
}
if ((pCurrentAction->nActionType == SC_CAT_DELETE_COLS) || if ((pCurrentAction->nActionType == SC_CAT_DELETE_COLS) ||
(pCurrentAction->nActionType == SC_CAT_DELETE_ROWS)) (pCurrentAction->nActionType == SC_CAT_DELETE_ROWS))
GetMultiSpannedRange(); GetMultiSpannedRange();
if (pCurrentAction && pCurrentAction->nActionNumber > 0)
if (pCurrentAction->nActionNumber > 0)
aActions.push_back(pCurrentAction); aActions.push_back(pCurrentAction);
else else
{ {
OSL_FAIL("no current action"); OSL_FAIL("no current action");
} }
pCurrentAction = NULL; pCurrentAction = NULL;
} }