summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2005-01-27 09:10:08 +0000
committerRüdiger Timm <rt@openoffice.org>2005-01-27 09:10:08 +0000
commitc27d9f3d0493ae0103d93e8d52f58834f97de9ad (patch)
tree22bdc58f568cb335cbf9f56b8e2e56c5b81b0e69 /toolkit
parent39dde3a03f68b7215a5668a92451e0738610d501 (diff)
INTEGRATION: CWS cd04 (1.5.62); FILE MERGED
2005/01/14 16:37:48 cd 1.5.62.1: #i37504# Fix wrong implementation of removeItem
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxmenu.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index 071e1e8da3b2..a764f10c9582 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: vclxmenu.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: obo $ $Date: 2004-07-06 12:02:05 $
+ * last change: $Author: rt $ $Date: 2005-01-27 10:10:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -245,10 +245,11 @@ void VCLXMenu::removeItem( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::sun::
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- if ( mpMenu && nCount )
+ sal_uInt32 nItemCount = (sal_uInt32)mpMenu->GetItemCount();
+ if ( mpMenu && ( nCount > 0 ) && ( nPos >= 0 ) && ( nPos < nItemCount ) && ( nItemCount > 0 ))
{
- sal_uInt16 nP = (sal_uInt16) Min( sal_uInt32(nPos+nCount), (sal_uInt32)mpMenu->GetItemCount() );
- for ( nP; nP; )
+ sal_uInt16 nP = (sal_uInt16)Min( sal_uInt32( nPos+nCount ), nItemCount );
+ for( nP; nP-nPos>0; )
mpMenu->RemoveItem( --nP );
}
}