summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2017-11-26 21:51:26 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2017-12-08 16:17:55 +0100
commit8f4c5a34b9e8704035c6ec770fc2947eb9964502 (patch)
tree9bd9a083366b0570aba82ab44bceee11b36c8d2a
parentd67eaa235db15853b3b454f2ef45c9a72529a3dc (diff)
GetMarkableObjCount() is only compared against 1
Change-Id: I390b260fe481c7db73a065dd271c78a5df188ccc
-rw-r--r--include/svx/svdmrkv.hxx3
-rw-r--r--sc/source/ui/drawfunc/fudraw.cxx2
-rw-r--r--sd/source/ui/func/fudraw.cxx2
-rw-r--r--svx/source/svdraw/svdmrkv.cxx25
4 files changed, 16 insertions, 16 deletions
diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index 21b6df1583ab..3fba52b0453e 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -199,7 +199,8 @@ public:
void SetFrameHandles(bool bOn);
bool IsFrameHandles() const { return mbForceFrameHandles; }
- sal_uIntPtr GetMarkableObjCount() const;
+ // returns true if number of markable objects is greater than 1
+ bool HasMultipleMarkableObjects() const;
void SetEditMode(SdrViewEditMode eMode);
SdrViewEditMode GetEditMode() const { return meEditMode; }
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index 5fbd8d9ab608..630d3abc4818 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -271,7 +271,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
if(!pView->MarkNextObj( !aCode.IsShift() ))
{
//If there is only one object, don't do the UnmarkAllObj() & MarkNextObj().
- if ( pView->GetMarkableObjCount() > 1 && pView->HasMarkableObj() )
+ if ( pView->HasMultipleMarkableObjects() && pView->HasMarkableObj() )
{
// No next object: go over open end and
// get first from the other side
diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index bf1d2ba36699..008321e0b0ee 100644
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -372,7 +372,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
if(!mpView->MarkNextObj( !aCode.IsShift() ))
{
//If there is only one object, don't do the UnmarkAllObj() & MarkNextObj().
- if ( mpView->GetMarkableObjCount() > 1 && mpView->AreObjectsMarked() )
+ if ( mpView->HasMultipleMarkableObjects() && mpView->AreObjectsMarked() )
{
// No next object: go over open end and get first from
// the other side
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 9fc9f3a0bf0c..d02758a6eee8 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -522,23 +522,22 @@ void SdrMarkView::BrkMarkGluePoints()
}
}
-sal_uIntPtr SdrMarkView::GetMarkableObjCount() const
+bool SdrMarkView::HasMultipleMarkableObjects() const
{
- sal_uIntPtr nCount=0;
SdrPageView* pPV = GetSdrPageView();
+ if (!pPV)
+ return false;
- if(pPV)
- {
- SdrObjList* pOL=pPV->GetObjList();
- const size_t nObjCount = pOL->GetObjCount();
- for (size_t nObjNum=0; nObjNum<nObjCount; ++nObjNum) {
- SdrObject* pObj=pOL->GetObj(nObjNum);
- if (IsObjMarkable(pObj,pPV)) {
- nCount++;
- }
- }
+ int nCount=0;
+ SdrObjList* pOL=pPV->GetObjList();
+ const size_t nObjCount = pOL->GetObjCount();
+ for (size_t nObjNum=0; nObjNum<nObjCount; ++nObjNum) {
+ SdrObject* pObj=pOL->GetObj(nObjNum);
+ if (IsObjMarkable(pObj,pPV) && ++nCount>1)
+ return true;
}
- return nCount;
+
+ return false;
}
bool SdrMarkView::HasMarkableObj() const