diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-09-29 21:37:25 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-09-29 22:17:03 +0200 |
commit | 8b2619177c16058ae9994d5e39f04a813bacd061 (patch) | |
tree | cbd1c7a228c532fafcb31689def45b38deec31e0 | |
parent | 15dbae3bd0d13a5c374e2297b170e285e57af438 (diff) |
tdf#112732 sw: fix conditions in SwContentTree::ExecCommand()
It has to be checked first that it's a CTYPE_CNT because otherwise
it's not a SwOutlineContent.
The assertion also didn't match the actual requirement.
Change-Id: I7fc3a6410f5de1e6b4c18965fff9bd9700562ed1
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 2c9301d212eb..d78a08e2b5e8 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -2442,11 +2442,11 @@ void SwContentTree::ExecCommand(const OUString& rCmd, bool bOutlineWithChildren) while (pEntry) { pEntry = Next(pEntry); - assert(pEntry == nullptr || dynamic_cast<SwOutlineContent*>(static_cast<SwTypeNumber*>(pEntry->GetUserData()))); + assert(pEntry == nullptr || static_cast<SwTypeNumber*>(pEntry->GetUserData())); // nDest++ may only executed if pEntry != 0 if (pEntry && nDest++ && - (nActLevel >= static_cast<SwOutlineContent*>(pEntry->GetUserData())->GetOutlineLevel() || - CTYPE_CNT != static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId())) + (CTYPE_CNT != static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId() + || nActLevel >= static_cast<SwOutlineContent*>(pEntry->GetUserData())->GetOutlineLevel())) { nDest--; break; @@ -2467,10 +2467,10 @@ void SwContentTree::ExecCommand(const OUString& rCmd, bool bOutlineWithChildren) { nDest--; pEntry = Prev(pEntry); - assert(pEntry == nullptr || dynamic_cast<SwOutlineContent*>(static_cast<SwTypeNumber*>(pEntry->GetUserData()))); + assert(pEntry == nullptr || static_cast<SwTypeNumber*>(pEntry->GetUserData())); if (pEntry && - (nActLevel >= static_cast<SwOutlineContent*>(pEntry->GetUserData())->GetOutlineLevel() || - CTYPE_CNT != static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId())) + (CTYPE_CNT != static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId() + || nActLevel >= static_cast<SwOutlineContent*>(pEntry->GetUserData())->GetOutlineLevel())) { break; } |