summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-05-28 11:32:42 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-05-28 11:32:42 +0000
commitead40d96382372e59dc716091fe1ad275679f212 (patch)
tree8e2d871570d12e237fe5b17711a4a55195898604 /vcl
parent8a204482da443dcf9e6f4c0c33dd05816799bcbe (diff)
INTEGRATION: CWS vcl09 (1.19.4); FILE MERGED
2003/05/08 11:12:19 oj 1.19.4.1: #109372# VCLEVENT_TOOLBOX_ITEMADDED now gets the correct position
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/toolbox2.cxx36
1 files changed, 24 insertions, 12 deletions
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 2c321d0e90aa..ca2afdeafaf3 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: toolbox2.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: rt $ $Date: 2003-04-17 15:19:56 $
+ * last change: $Author: vg $ $Date: 2003-05-28 12:32:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -537,7 +537,8 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
ImplInvalidate( bNewCalc );
// Notify
- ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nPos );
+ USHORT nNewPos = ( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos;
+ ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nNewPos );
}
// -----------------------------------------------------------------------
@@ -556,7 +557,8 @@ void ToolBox::InsertItem( USHORT nItemId, const Image& rImage,
ImplInvalidate( TRUE );
// Notify
- ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nPos );
+ USHORT nNewPos = ( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos;
+ ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nNewPos );
}
// -----------------------------------------------------------------------
@@ -576,7 +578,8 @@ void ToolBox::InsertItem( USHORT nItemId, const Image& rImage,
ImplInvalidate( TRUE );
// Notify
- ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nPos );
+ USHORT nNewPos = ( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos;
+ ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nNewPos );
}
// -----------------------------------------------------------------------
@@ -595,7 +598,8 @@ void ToolBox::InsertItem( USHORT nItemId, const XubString& rText,
ImplInvalidate( TRUE );
// Notify
- ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nPos );
+ USHORT nNewPos = ( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos;
+ ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nNewPos );
}
// -----------------------------------------------------------------------
@@ -622,7 +626,8 @@ void ToolBox::InsertWindow( USHORT nItemId, Window* pWindow,
ImplInvalidate( TRUE );
// Notify
- ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nPos );
+ USHORT nNewPos = ( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos;
+ ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nNewPos );
}
// -----------------------------------------------------------------------
@@ -639,7 +644,8 @@ void ToolBox::InsertSpace( USHORT nPos )
ImplInvalidate( FALSE );
// Notify
- ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nPos );
+ USHORT nNewPos = ( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos;
+ ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nNewPos );
}
// -----------------------------------------------------------------------
@@ -658,7 +664,8 @@ void ToolBox::InsertSeparator( USHORT nPos, USHORT nPixSize )
ImplInvalidate( FALSE );
// Notify
- ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nPos );
+ USHORT nNewPos = ( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos;
+ ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nNewPos );
}
// -----------------------------------------------------------------------
@@ -675,7 +682,8 @@ void ToolBox::InsertBreak( USHORT nPos )
ImplInvalidate( FALSE );
// Notify
- ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nPos );
+ USHORT nNewPos = ( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos;
+ ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nNewPos );
}
// -----------------------------------------------------------------------
@@ -740,7 +748,10 @@ void ToolBox::MoveItem( USHORT nItemId, USHORT nNewPos )
if( nPos < nNewPos ) // only send one event, all indices above this item are invalid anyway
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMREMOVED, (void*) nPos );
else
- ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nNewPos );
+ {
+ USHORT nNewPos2 = ( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos;
+ ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nNewPos2 );
+ }
}
}
@@ -769,7 +780,8 @@ void ToolBox::CopyItem( const ToolBox& rToolBox, USHORT nItemId,
ImplInvalidate( FALSE );
// Notify
- ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nPos );
+ USHORT nNewPos2 = ( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos;
+ ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, (void*) nNewPos2 );
}
}