diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-22 12:13:21 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-23 09:32:22 +0200 |
commit | dc29ba58ab50e3e32df348c4b23da176729d2504 (patch) | |
tree | 22b61e6e576d2f91c83e781ba64c2c98e2ce4e7b | |
parent | 08c393a3d26dc336db790ad1900d598a039417b8 (diff) |
cid#1448428 Dereference before null check
Change-Id: Ied813af9926f405aef36dc3b8b450f32f9106d9c
Reviewed-on: https://gerrit.libreoffice.org/76132
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index ae42953cf7f3..11bef9fd89d9 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -2476,7 +2476,7 @@ void SwContentTree::ExecCommand(const OUString& rCmd, bool bOutlineWithChildren) for (auto const pCurrentEntry : selected) { assert(pCurrentEntry && lcl_IsContent(pCurrentEntry)); - if (pCurrentEntry && lcl_IsContent(pCurrentEntry)) + if (lcl_IsContent(pCurrentEntry)) { assert(dynamic_cast<SwContent*>(static_cast<SwTypeNumber*>(pCurrentEntry->GetUserData()))); if ((m_bIsRoot && m_nRootType == ContentTypeId::OUTLINE) || @@ -2511,7 +2511,7 @@ void SwContentTree::ExecCommand(const OUString& rCmd, bool bOutlineWithChildren) // Set cursor back to the current position pShell->GotoOutline( nActPos + nDir); } - else if (bOutlineWithChildren && pCurrentEntry) + else if (bOutlineWithChildren) { SwOutlineNodes::size_type nActEndPos = nActPos; SvTreeListEntry* pEntry = pCurrentEntry; @@ -2529,7 +2529,7 @@ void SwContentTree::ExecCommand(const OUString& rCmd, bool bOutlineWithChildren) } if (nDir == 1) // move down { - if (pCurrentEntry && IsSelected(pCurrentEntry->NextSibling())) + if (IsSelected(pCurrentEntry->NextSibling())) nDir = nDirLast; else { @@ -2587,7 +2587,7 @@ void SwContentTree::ExecCommand(const OUString& rCmd, bool bOutlineWithChildren) } else // move up { - if (pCurrentEntry && IsSelected(pCurrentEntry->PrevSibling())) + if (IsSelected(pCurrentEntry->PrevSibling())) nDir = nDirLast; else { |