[Libreoffice-commits] core.git: Branch 'aoo/trunk' - sc/source sd/source svx/inc svx/source sw/source

Don Lewis truckman at apache.org
Fri Sep 2 00:08:26 UTC 2016


 sc/source/ui/drawfunc/fudraw.cxx          |    2 +-
 sc/source/ui/drawfunc/futext.cxx          |    2 +-
 sd/source/ui/animations/motionpathtag.cxx |    6 +++---
 sd/source/ui/func/fupoor.cxx              |    2 +-
 sd/source/ui/func/fusel.cxx               |    4 ++--
 svx/inc/svx/svdmrkv.hxx                   |    4 ++--
 svx/source/dialog/graphctl.cxx            |    2 +-
 sw/source/ui/ribbar/drawbase.cxx          |    4 ++--
 8 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit d8e7261d2d1992eb7e36ff9fbb58b26688168bf3
Author: Don Lewis <truckman at apache.org>
Date:   Thu Sep 1 22:08:51 2016 +0000

    Fix by far the largest source of -Wtautological-undefined-compare
    
    compile warnings.
    
    The class definition for SdrMarkView in svx/inc/svx/svdmrkv.hxx
    contains two inline methods that take a reference argument and
    perform an &rArg == NULL test on it.  The compiler warns that this
    condition should always be false because dereferencing a NULL pointer
    to generate a reference is not valid in C++ and a valid reference will
    never be at address 0.  Warnings are generated every time this header
    is included in a .cxx file.
    
    It turns out that there are no callers for the IsGluePoint() method,
    so just comment out its definition.
    
    It also turns out that all the callers of IsPointMarked() pass it
    a dereferenced pointer, so convert IsPointMarked() to take a pointer
    argument and modify all the callers to pass a pointer without
    dereferencing it first.

diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index fb17aa1..26c6c1d 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -637,7 +637,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
                         sal_uInt32 nPol(pHdl->GetPolyNum());
                         sal_uInt32 nPnt(pHdl->GetPointNum());
 
-                        if(pView->IsPointMarked(*pHdl))
+                        if(pView->IsPointMarked(pHdl))
                         {
                             if(rKEvt.GetKeyCode().IsShift())
                             {
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index d14e6ec..404fce3 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -163,7 +163,7 @@ sal_Bool __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
         {
             if (pView->HasMarkablePoints() && pView->IsPointMarkable(*pHdl))
             {
-                sal_Bool bPointMarked=pView->IsPointMarked(*pHdl);
+                sal_Bool bPointMarked=pView->IsPointMarked(pHdl);
 
                 if ( rMEvt.IsShift() )
                 {
diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx
index 1fc0f66..71010a4 100644
--- a/sd/source/ui/animations/motionpathtag.cxx
+++ b/sd/source/ui/animations/motionpathtag.cxx
@@ -552,7 +552,7 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl )
             else
             {
                 SmartHdl* pHdl = &rHdl;
-                if (!mrView.IsPointMarked(*pHdl) || rMEvt.IsShift())
+                if (!mrView.IsPointMarked(pHdl) || rMEvt.IsShift())
                 {
                     if (!rMEvt.IsShift())
                     {
@@ -561,7 +561,7 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl )
                     }
                     else
                     {
-                        if (mrView.IsPointMarked(*pHdl) )
+                        if (mrView.IsPointMarked(pHdl) )
                         {
                             mrView.UnmarkPoint(*pHdl);
                             pHdl = NULL;
@@ -698,7 +698,7 @@ bool MotionPathTag::OnMarkHandle( const KeyEvent& rKEvt )
         sal_uInt32 nPol(pHdl->GetPolyNum());
         sal_uInt32 nPnt(pHdl->GetPointNum());
 
-        if(mrView.IsPointMarked(*pHdl))
+        if(mrView.IsPointMarked(pHdl))
         {
             if(rKEvt.GetKeyCode().IsShift())
             {
diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx
index 9c042d4..eb0da7b 100644
--- a/sd/source/ui/func/fupoor.cxx
+++ b/sd/source/ui/func/fupoor.cxx
@@ -596,7 +596,7 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
                     sal_uInt32 nPol(pHdl->GetPolyNum());
                     sal_uInt32 nPnt(pHdl->GetPointNum());
 
-                    if(mpView->IsPointMarked(*pHdl))
+                    if(mpView->IsPointMarked(pHdl))
                     {
                         if(rKEvt.GetKeyCode().IsShift())
                         {
diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx
index 617f666..7ed3d92 100644
--- a/sd/source/ui/func/fusel.cxx
+++ b/sd/source/ui/func/fusel.cxx
@@ -497,7 +497,7 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
             /******************************************************************
             * Klebepunkt selektieren
             ******************************************************************/
-            if (!mpView->IsPointMarked(*aVEvt.pHdl) || rMEvt.IsShift())
+            if (!mpView->IsPointMarked(aVEvt.pHdl) || rMEvt.IsShift())
             {
                 if (!rMEvt.IsShift())
                 {
@@ -506,7 +506,7 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
                 }
                 else
                 {
-                    if (mpView->IsPointMarked(*aVEvt.pHdl))
+                    if (mpView->IsPointMarked(aVEvt.pHdl))
                     {
                         mpView->UnmarkPoint(*aVEvt.pHdl);
                         pHdl = NULL;
diff --git a/svx/inc/svx/svdmrkv.hxx b/svx/inc/svx/svdmrkv.hxx
index b796646..9d2f2e6 100644
--- a/svx/inc/svx/svdmrkv.hxx
+++ b/svx/inc/svx/svdmrkv.hxx
@@ -368,7 +368,7 @@ public:
     sal_Bool MarkPoints(const Rectangle& rRect, sal_Bool bUnmark=sal_False) { return MarkPoints(&rRect,bUnmark); }
     sal_Bool UnmarkPoint(SdrHdl& rHdl) { return MarkPoint(rHdl,sal_True); }
     sal_Bool UnMarkPoint(SdrHdl& rHdl) { return MarkPoint(rHdl,sal_True); }
-    sal_Bool IsPointMarked(const SdrHdl& rHdl) const { ForceUndirtyMrkPnt(); return &rHdl!=NULL && rHdl.IsSelected(); }
+    sal_Bool IsPointMarked(const SdrHdl* pHdl) const { ForceUndirtyMrkPnt(); return pHdl!=NULL && pHdl->IsSelected(); }
     sal_Bool MarkAllPoints() { return MarkPoints(NULL,sal_False); }
     sal_Bool UnmarkAllPoints() { return MarkPoints(NULL,sal_True); }
     sal_Bool UnMarkAllPoints() { return MarkPoints(NULL,sal_True); }
@@ -437,7 +437,7 @@ public:
     // Hdl eines markierten GluePoints holen. Nicht markierte
     // GluePoints haben keine Handles
     SdrHdl* GetGluePointHdl(const SdrObject* pObj, sal_uInt16 nId) const;
-    sal_Bool IsGluePoint(const SdrHdl& rHdl) const { return &rHdl!=NULL && rHdl.GetKind()==HDL_GLUE; }
+    // sal_Bool IsGluePoint(const SdrHdl& rHdl) const { return &rHdl!=NULL && rHdl.GetKind()==HDL_GLUE; }
 
     // alle Punkte innerhalb dieses Rechtecks markieren (Viewkoordinaten)
     sal_Bool MarkGluePoints(const Rectangle& rRect) { return MarkGluePoints(&rRect,sal_False); }
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx
index cfaa6e1..b4daa5e 100644
--- a/svx/source/dialog/graphctl.cxx
+++ b/svx/source/dialog/graphctl.cxx
@@ -651,7 +651,7 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
                     sal_uInt32 nPol(pHdl->GetPolyNum());
                     sal_uInt32 nPnt(pHdl->GetPointNum());
 
-                    if(pView->IsPointMarked(*pHdl))
+                    if(pView->IsPointMarked(pHdl))
                     {
                         if(rKEvt.GetKeyCode().IsShift())
                         {
diff --git a/sw/source/ui/ribbar/drawbase.cxx b/sw/source/ui/ribbar/drawbase.cxx
index 02be6a6..c0bf424 100644
--- a/sw/source/ui/ribbar/drawbase.cxx
+++ b/sw/source/ui/ribbar/drawbase.cxx
@@ -182,7 +182,7 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
                 /******************************************************************
                 * Klebepunkt selektieren
                 ******************************************************************/
-                if (pSdrView->HasMarkablePoints() && (!pSdrView->IsPointMarked(*aVEvt.pHdl) || rMEvt.IsShift()))
+                if (pSdrView->HasMarkablePoints() && (!pSdrView->IsPointMarked(aVEvt.pHdl) || rMEvt.IsShift()))
                 {
                     SdrHdl* pHdl = NULL;
 
@@ -193,7 +193,7 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
                     }
                     else
                     {
-                        if (pSdrView->IsPointMarked(*aVEvt.pHdl))
+                        if (pSdrView->IsPointMarked(aVEvt.pHdl))
                         {
                             bReturn = pSdrView->UnmarkPoint(*aVEvt.pHdl);
                             pHdl = NULL;


More information about the Libreoffice-commits mailing list