summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdmrkv.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-11-12 17:07:22 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-11-14 08:52:21 +0000
commitaa3f954222a270d3e2fa531badd2fa7febd30338 (patch)
treef9921a240795044f00ce61718d052c26ebbc8ae0 /svx/source/svdraw/svdmrkv.cxx
parent90a77e9c13eb9b2aa6e83653d9d2d1409bc47f36 (diff)
coverity#703927 Unchecked return value
make these less odd and simply return the thing they selected, rather than a bool that indicates that the rpObj arg was successfully set to non-null, so there's one flag to check not two which both mean the same thing. Change-Id: If70e412f98dea8b7114fb77f26a9c59aab93be50 Reviewed-on: https://gerrit.libreoffice.org/30794 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/svdraw/svdmrkv.cxx')
-rw-r--r--svx/source/svdraw/svdmrkv.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index cadb11a08c94..21895ed767e0 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1372,17 +1372,16 @@ SdrHdl* SdrMarkView::PickHandle(const Point& rPnt) const
bool SdrMarkView::MarkObj(const Point& rPnt, short nTol, bool bToggle, bool bDeep)
{
- SdrObject* pObj;
SdrPageView* pPV;
nTol=ImpGetHitTolLogic(nTol,nullptr);
SdrSearchOptions nOptions=SdrSearchOptions::PICKMARKABLE;
if (bDeep) nOptions=nOptions|SdrSearchOptions::DEEP;
- bool bRet=PickObj(rPnt,(sal_uInt16)nTol,pObj,pPV,nOptions);
- if (bRet) {
+ SdrObject* pObj = PickObj(rPnt, (sal_uInt16)nTol, pPV, nOptions);
+ if (pObj) {
bool bUnmark=bToggle && IsObjMarked(pObj);
MarkObj(pObj,pPV,bUnmark);
}
- return bRet;
+ return pObj != nullptr;
}
bool SdrMarkView::MarkNextObj(bool bPrev)
@@ -1741,17 +1740,17 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT
return pRet;
}
-bool SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, SdrSearchOptions nOptions) const
+SdrObject* SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrPageView*& rpPV, SdrSearchOptions nOptions) const
{
- return PickObj(rPnt,nTol,rpObj,rpPV,nOptions,nullptr);
+ return PickObj(rPnt, nTol, rpPV, nOptions, nullptr);
}
-bool SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, SdrSearchOptions nOptions, SdrObject** ppRootObj, bool* pbHitPassDirect) const
+SdrObject* SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrPageView*& rpPV, SdrSearchOptions nOptions, SdrObject** ppRootObj, bool* pbHitPassDirect) const
{ // TODO: lacks a Pass2,Pass3
SortMarkedObjects();
if (ppRootObj!=nullptr) *ppRootObj=nullptr;
if (pbHitPassDirect!=nullptr) *pbHitPassDirect=true;
- rpObj=nullptr;
+ SdrObject* pRet = nullptr;
rpPV=nullptr;
bool bWholePage(nOptions & SdrSearchOptions::WHOLEPAGE);
bool bMarked(nOptions & SdrSearchOptions::MARKED);
@@ -1856,11 +1855,11 @@ bool SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrP
}
}
if (pObj!=nullptr) {
- rpObj=pObj;
+ pRet=pObj;
rpPV=pPV;
}
}
- return rpObj!=nullptr;
+ return pRet;
}
bool SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, SdrSearchOptions nOptions) const