Kaydet (Commit) 46aec301 authored tarafından Thorsten Behrens's avatar Thorsten Behrens

Fix crash during polygon handle travelling.

Improving on 7d5922ca wrt. bound
checking and non-truncation of index magic values.

Change-Id: If33495075472fdf242b2de0893fd44109ec7bc83
üst 091b9e46
...@@ -480,7 +480,7 @@ public: ...@@ -480,7 +480,7 @@ public:
// 3.Level Position (x+y) // 3.Level Position (x+y)
void Sort(); void Sort();
sal_uIntPtr GetHdlCount() const { return aList.size(); } sal_uIntPtr GetHdlCount() const { return aList.size(); }
SdrHdl* GetHdl(sal_uIntPtr nNum) const { return aList[nNum]; } SdrHdl* GetHdl(sal_uIntPtr nNum) const { return nNum != CONTAINER_ENTRY_NOTFOUND ? aList[nNum] : NULL; }
sal_uIntPtr GetHdlNum(const SdrHdl* pHdl) const; sal_uIntPtr GetHdlNum(const SdrHdl* pHdl) const;
void SetHdlSize(sal_uInt16 nSiz); void SetHdlSize(sal_uInt16 nSiz);
sal_uInt16 GetHdlSize() const { return nHdlSize; } sal_uInt16 GetHdlSize() const { return nHdlSize; }
......
...@@ -1911,7 +1911,7 @@ void SdrHdlList::TravelFocusHdl(sal_Bool bForward) ...@@ -1911,7 +1911,7 @@ void SdrHdlList::TravelFocusHdl(sal_Bool bForward)
} }
// build new HdlNum // build new HdlNum
sal_uInt32 nNewHdlNum(nNewHdl); sal_uIntPtr nNewHdlNum(nNewHdl);
// look for old num in sorted array // look for old num in sorted array
if(nNewHdl != CONTAINER_ENTRY_NOTFOUND) if(nNewHdl != CONTAINER_ENTRY_NOTFOUND)
...@@ -2020,7 +2020,7 @@ void SdrHdlList::SetHdlSize(sal_uInt16 nSiz) ...@@ -2020,7 +2020,7 @@ void SdrHdlList::SetHdlSize(sal_uInt16 nSiz)
nHdlSize = nSiz; nHdlSize = nSiz;
// propagate change to IAOs // propagate change to IAOs
for(sal_uInt32 i=0; i<GetHdlCount(); i++) for(sal_uIntPtr i=0; i<GetHdlCount(); i++)
{ {
SdrHdl* pHdl = GetHdl(i); SdrHdl* pHdl = GetHdl(i);
pHdl->Touch(); pHdl->Touch();
...@@ -2036,7 +2036,7 @@ void SdrHdlList::SetMoveOutside(sal_Bool bOn) ...@@ -2036,7 +2036,7 @@ void SdrHdlList::SetMoveOutside(sal_Bool bOn)
bMoveOutside = bOn; bMoveOutside = bOn;
// propagate change to IAOs // propagate change to IAOs
for(sal_uInt32 i=0; i<GetHdlCount(); i++) for(sal_uIntPtr i=0; i<GetHdlCount(); i++)
{ {
SdrHdl* pHdl = GetHdl(i); SdrHdl* pHdl = GetHdl(i);
pHdl->Touch(); pHdl->Touch();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment