summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-09-29 21:37:25 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-10-03 17:19:33 +0200
commit5c7a82a0d3db4e6e9d0ecb252c307a0b6075f41e (patch)
treedaf0dfeec4ba89541e58cc6589e99a1bb7b85653
parent729752b2df5c64429aff10628680d91c8bbbe1a6 (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 (cherry picked from commit 8b2619177c16058ae9994d5e39f04a813bacd061) Reviewed-on: https://gerrit.libreoffice.org/42954 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/source/uibase/utlui/content.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 6a6d5c96c894..bb2a16a16488 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2401,11 +2401,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;
@@ -2426,10 +2426,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;
}