diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-02-08 17:51:27 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-02-11 07:09:02 +0100 |
commit | 2ded5f80b43f91fc1bcd8fbc17bafb0758de3f70 (patch) | |
tree | b569b23699ed0e0bd689ab14e66aab094a80c301 /sc | |
parent | 30c0134cd31c1409c374b9b0b38d2f2ac2f4bd03 (diff) |
tdf#120703 PVS: Check object type before static_cast
V560 A part of conditional expression is always false:
!pPrevActContent.
Change-Id: Ief1b560ea8a4e1d85a693909b6a6a80566fa2f34
Reviewed-on: https://gerrit.libreoffice.org/67547
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx index d110d9290b81..35babb1de541 100644 --- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx @@ -577,17 +577,15 @@ void ScXMLChangeTrackingImportHelper::SetMovementDependencies(ScMyMoveAction* pA void ScXMLChangeTrackingImportHelper::SetContentDependencies(const ScMyContentAction* pAction, ScChangeActionContent* pActContent) { - if (!pAction->nPreviousAction) + if (!pActContent || !pAction->nPreviousAction) return; OSL_ENSURE(pAction->nActionType == SC_CAT_CONTENT, "wrong action type"); ScChangeAction* pPrevAct = pTrack->GetAction(pAction->nPreviousAction); - if (!pPrevAct) + if (!pPrevAct || pPrevAct->GetType() != SC_CAT_CONTENT) return; ScChangeActionContent* pPrevActContent = static_cast<ScChangeActionContent*>(pPrevAct); - if (!pPrevActContent || !pActContent) - return; pActContent->SetPrevContent(pPrevActContent); pPrevActContent->SetNextContent(pActContent); |