[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sw/source
Michael Stahl
mstahl at redhat.com
Tue Oct 3 15:19:59 UTC 2017
sw/source/uibase/utlui/content.cxx | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
New commits:
commit 5c7a82a0d3db4e6e9d0ecb252c307a0b6075f41e
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Sep 29 21:37:25 2017 +0200
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 at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
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;
}
More information about the Libreoffice-commits
mailing list