diff options
author | Thorsten Behrens <tbehrens@suse.com> | 2012-11-02 19:42:47 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2012-11-02 19:48:11 +0100 |
commit | 46aec3014b16286df97ed0c7a47f509fffb564c9 (patch) | |
tree | 7ec6c8398cc5b97fa5d467c89317d799bd158d10 /svx | |
parent | 091b9e46ece9bb94a67c8867e0d33f4e4bee6fad (diff) |
Fix crash during polygon handle travelling.
Improving on 7d5922ca8f04604aba57708ee20fb4cdeaea2e44 wrt. bound
checking and non-truncation of index magic values.
Change-Id: If33495075472fdf242b2de0893fd44109ec7bc83
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/svx/svdhdl.hxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdhdl.cxx | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/svx/inc/svx/svdhdl.hxx b/svx/inc/svx/svdhdl.hxx index 3a44b927fb20..10fcc84a9c98 100644 --- a/svx/inc/svx/svdhdl.hxx +++ b/svx/inc/svx/svdhdl.hxx @@ -480,7 +480,7 @@ public: // 3.Level Position (x+y) void Sort(); 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; void SetHdlSize(sal_uInt16 nSiz); sal_uInt16 GetHdlSize() const { return nHdlSize; } diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 7931db8656a5..7b7548f3a0be 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -1911,7 +1911,7 @@ void SdrHdlList::TravelFocusHdl(sal_Bool bForward) } // build new HdlNum - sal_uInt32 nNewHdlNum(nNewHdl); + sal_uIntPtr nNewHdlNum(nNewHdl); // look for old num in sorted array if(nNewHdl != CONTAINER_ENTRY_NOTFOUND) @@ -2020,7 +2020,7 @@ void SdrHdlList::SetHdlSize(sal_uInt16 nSiz) nHdlSize = nSiz; // propagate change to IAOs - for(sal_uInt32 i=0; i<GetHdlCount(); i++) + for(sal_uIntPtr i=0; i<GetHdlCount(); i++) { SdrHdl* pHdl = GetHdl(i); pHdl->Touch(); @@ -2036,7 +2036,7 @@ void SdrHdlList::SetMoveOutside(sal_Bool bOn) bMoveOutside = bOn; // propagate change to IAOs - for(sal_uInt32 i=0; i<GetHdlCount(); i++) + for(sal_uIntPtr i=0; i<GetHdlCount(); i++) { SdrHdl* pHdl = GetHdl(i); pHdl->Touch(); |