From d1d9a96337abb7ae40bbd2660ea4d5933b09a001 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 22 Jul 2019 08:55:19 +0100 Subject: cid#1448433 Unintended comparison to logical negation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I78488ff5b8087eabb4dd306f226defa2607b1660 Reviewed-on: https://gerrit.libreoffice.org/76096 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/core/crsr/callnk.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sw') diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx index 358d0895ed67..41a119792efc 100644 --- a/sw/source/core/crsr/callnk.cxx +++ b/sw/source/core/crsr/callnk.cxx @@ -125,6 +125,8 @@ SwCallLink::~SwCallLink() COVERITY_NOEXCEPT_FALSE // attribute changes can be signaled over the link. pCNd->Add( &rShell ); + const bool bCurrentHasSelection = (*pCurrentCursor->GetPoint() != *pCurrentCursor->GetMark()); + if( nNdTyp != nNdWhich || nNode != nCurrentNode ) { // Every time a switch between nodes occurs, there is a chance that @@ -133,7 +135,7 @@ SwCallLink::~SwCallLink() COVERITY_NOEXCEPT_FALSE // That can be done in one go by the handler. rShell.CallChgLnk(); } - else if( !bHasSelection != (*pCurrentCursor->GetPoint() == *pCurrentCursor->GetMark()) ) + else if (bHasSelection != bCurrentHasSelection) { // always call change link when selection changes rShell.CallChgLnk(); -- cgit