sw/source/uibase/docvw/edtdd.cxx  |    4 ++--
 sw/source/uibase/docvw/edtwin.cxx |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 627869ff6cd910faa92bd7511e5fd0e8c10b8379
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Fri Feb 4 08:02:59 2022 +0100
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Fri Feb 4 10:10:54 2022 +0100

    Don't cast enum to bool instead of comparing to a defined constant
    
    Change-Id: I1be04d5c52903bb75105182c3cf46defa266d755
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129431
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sw/source/uibase/docvw/edtdd.cxx b/sw/source/uibase/docvw/edtdd.cxx
index 0f67dcf70dc9..8f86aa1d310a 100644
--- a/sw/source/uibase/docvw/edtdd.cxx
+++ b/sw/source/uibase/docvw/edtdd.cxx
@@ -311,7 +311,7 @@ SotExchangeDest SwEditWin::GetDropDestination( const Point& 
rPixPnt, SdrObject *
         default: OSL_ENSURE( false, "new ObjectType?" );
         }
     }
-    if ( !bool(nDropDestination) )
+    if ( nDropDestination == SotExchangeDest::NONE )
     {
         if( dynamic_cast< const SwWebDocShell *>( rSh.GetView().GetDocShell() 
) != nullptr  )
             nDropDestination = SotExchangeDest::SWDOC_FREE_AREA_WEB;
@@ -374,7 +374,7 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt 
)
 
     SdrObject *pObj = nullptr;
     m_nDropDestination = GetDropDestination( aPixPt, &pObj );
-    if( !bool(m_nDropDestination) )
+    if( m_nDropDestination == SotExchangeDest::NONE )
         return DND_ACTION_NONE;
 
     sal_uInt8 nEventAction;
diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 859c35664fea..6a0c5ac106b2 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -5588,7 +5588,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
                 break;
 
             SotExchangeDest nDropDestination = GetDropDestination( 
rCEvt.GetMousePosPixel() );
-            if( !bool(nDropDestination) )
+            if( nDropDestination == SotExchangeDest::NONE )
                 break;
             SotClipboardFormatId nDropFormat;
             sal_uInt8 nEventAction, nDropAction;

Reply via email to