diff options
author | Don Lewis <truckman@apache.org> | 2016-09-01 22:08:51 +0000 |
---|---|---|
committer | Don Lewis <truckman@apache.org> | 2016-09-01 22:08:51 +0000 |
commit | d8e7261d2d1992eb7e36ff9fbb58b26688168bf3 (patch) | |
tree | 65d29d55ed5c4ac17e3d425c55b03b00f207e6aa /svx | |
parent | cc9823f5bde6f49eb75e4ad0e8f8a162bf341f34 (diff) |
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.
Notes
Notes:
prefer: 16889f355d1f7157bad84b42ad5a1b2b715ae767
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/svx/svdmrkv.hxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/graphctl.cxx | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/svx/inc/svx/svdmrkv.hxx b/svx/inc/svx/svdmrkv.hxx index b796646f4cdd..9d2f2e6e0c48 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 cfaa6e1d441f..b4daa5e9b125 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()) { |