summaryrefslogtreecommitdiff
path: root/vcl/source/window/accel.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/window/accel.cxx')
-rw-r--r--vcl/source/window/accel.cxx128
1 files changed, 64 insertions, 64 deletions
diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx
index c78a1eb13f6a..0f0caecfe856 100644
--- a/vcl/source/window/accel.cxx
+++ b/vcl/source/window/accel.cxx
@@ -42,7 +42,7 @@
DECLARE_TABLE( ImplAccelTable, ImplAccelEntry* )
typedef ::std::vector< ImplAccelEntry* > ImplAccelList;
-#define ACCELENTRY_NOTFOUND ((USHORT)0xFFFF)
+#define ACCELENTRY_NOTFOUND ((sal_uInt16)0xFFFF)
// =======================================================================
@@ -59,14 +59,14 @@ DBG_NAME( Accelerator )
// =======================================================================
-USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId,
- USHORT* pIndex = NULL )
+sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId,
+ sal_uInt16* pIndex = NULL )
{
size_t nLow;
size_t nHigh;
size_t nMid;
size_t nCount = pList->size();
- USHORT nCompareId;
+ sal_uInt16 nCompareId;
// Abpruefen, ob der erste Key groesser als der Vergleichskey ist
if ( !nCount || (nId < (*pList)[ 0 ]->mnId) )
@@ -90,7 +90,7 @@ USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId,
if ( nId > nCompareId )
nLow = nMid + 1;
else
- return (USHORT)nMid;
+ return (sal_uInt16)nMid;
}
}
while ( nLow <= nHigh );
@@ -98,9 +98,9 @@ USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId,
if ( pIndex )
{
if ( nId > nCompareId )
- *pIndex = (USHORT)(nMid+1);
+ *pIndex = (sal_uInt16)(nMid+1);
else
- *pIndex = (USHORT)nMid;
+ *pIndex = (sal_uInt16)nMid;
}
return ACCELENTRY_NOTFOUND;
@@ -110,8 +110,8 @@ USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId,
static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry )
{
- USHORT nInsIndex;
- USHORT nIndex = ImplAccelEntryGetIndex( pList, pEntry->mnId, &nInsIndex );
+ sal_uInt16 nInsIndex;
+ sal_uInt16 nIndex = ImplAccelEntryGetIndex( pList, pEntry->mnId, &nInsIndex );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
@@ -145,9 +145,9 @@ static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry )
// -----------------------------------------------------------------------
-static USHORT ImplAccelEntryGetFirstPos( ImplAccelList* pList, USHORT nId )
+static sal_uInt16 ImplAccelEntryGetFirstPos( ImplAccelList* pList, sal_uInt16 nId )
{
- USHORT nIndex = ImplAccelEntryGetIndex( pList, nId );
+ sal_uInt16 nIndex = ImplAccelEntryGetIndex( pList, nId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
while ( nIndex )
@@ -170,7 +170,7 @@ void Accelerator::ImplInit()
{
mnCurId = 0;
mnCurRepeat = 0;
- mbIsCancel = FALSE;
+ mbIsCancel = sal_False;
mpDel = NULL;
}
@@ -199,7 +199,7 @@ void Accelerator::ImplCopyData( ImplAccelData& rAccelData )
else
pEntry->mpAutoAccel = NULL;
- mpData->maKeyTable.Insert( (ULONG)pEntry->maKeyCode.GetFullKeyCode(), pEntry );
+ mpData->maKeyTable.Insert( (sal_uLong)pEntry->maKeyCode.GetFullKeyCode(), pEntry );
mpData->maIdList.push_back( pEntry );
}
}
@@ -221,18 +221,18 @@ void Accelerator::ImplDeleteData()
// -----------------------------------------------------------------------
-void Accelerator::ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode,
- BOOL bEnable, Accelerator* pAutoAccel )
+void Accelerator::ImplInsertAccel( sal_uInt16 nItemId, const KeyCode& rKeyCode,
+ sal_Bool bEnable, Accelerator* pAutoAccel )
{
DBG_CHKTHIS( Accelerator, NULL );
DBG_ASSERT( nItemId, "Accelerator::InsertItem(): ItemId == 0" );
if ( rKeyCode.IsFunction() )
{
- USHORT nCode1;
- USHORT nCode2;
- USHORT nCode3;
- USHORT nCode4;
+ sal_uInt16 nCode1;
+ sal_uInt16 nCode2;
+ sal_uInt16 nCode3;
+ sal_uInt16 nCode4;
ImplGetKeyCode( rKeyCode.GetFunction(), nCode1, nCode2, nCode3, nCode4 );
if ( nCode1 )
ImplInsertAccel( nItemId, KeyCode( nCode1, nCode1 ), bEnable, pAutoAccel );
@@ -260,7 +260,7 @@ void Accelerator::ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode,
pEntry->mbEnabled = bEnable;
// Ab in die Tabellen
- ULONG nCode = rKeyCode.GetFullKeyCode();
+ sal_uLong nCode = rKeyCode.GetFullKeyCode();
if ( !nCode )
{
OSL_FAIL( "Accelerator::InsertItem(): KeyCode with KeyCode 0 not allowed" );
@@ -319,9 +319,9 @@ void Accelerator::ImplLoadRes( const ResId& rResId )
GetRes( rResId );
maHelpStr = ReadStringRes();
- ULONG nObjFollows = ReadLongRes();
+ sal_uLong nObjFollows = ReadLongRes();
- for( ULONG i = 0; i < nObjFollows; i++ )
+ for( sal_uLong i = 0; i < nObjFollows; i++ )
{
InsertItem( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
@@ -336,7 +336,7 @@ Accelerator::~Accelerator()
// AccelManager benachrichtigen, das Accelrator geloescht wurde
if ( mpDel )
- *mpDel = TRUE;
+ *mpDel = sal_True;
ImplDeleteData();
delete mpData;
@@ -365,9 +365,9 @@ void Accelerator::Select()
// -----------------------------------------------------------------------
-void Accelerator::InsertItem( USHORT nItemId, const KeyCode& rKeyCode )
+void Accelerator::InsertItem( sal_uInt16 nItemId, const KeyCode& rKeyCode )
{
- ImplInsertAccel( nItemId, rKeyCode, TRUE, NULL );
+ ImplInsertAccel( nItemId, rKeyCode, sal_True, NULL );
}
// -----------------------------------------------------------------------
@@ -376,15 +376,15 @@ void Accelerator::InsertItem( const ResId& rResId )
{
DBG_CHKTHIS( Accelerator, NULL );
- ULONG nObjMask;
- USHORT nAccelKeyId;
- USHORT bDisable;
+ sal_uLong nObjMask;
+ sal_uInt16 nAccelKeyId;
+ sal_uInt16 bDisable;
KeyCode aKeyCode;
Accelerator* pAutoAccel = NULL;
GetRes( rResId.SetRT( RSC_ACCELITEM ) );
nObjMask = ReadLongRes();
- nAccelKeyId = sal::static_int_cast<USHORT>(ReadLongRes());
+ nAccelKeyId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
bDisable = ReadShortRes();
if ( nObjMask & ACCELITEM_KEY )
@@ -407,15 +407,15 @@ void Accelerator::InsertItem( const ResId& rResId )
// -----------------------------------------------------------------------
-void Accelerator::RemoveItem( USHORT nItemId )
+void Accelerator::RemoveItem( sal_uInt16 nItemId )
{
DBG_CHKTHIS( Accelerator, NULL );
// Aus der Id-Liste entfernen
- USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
- USHORT nItemCount = GetItemCount();
+ sal_uInt16 nItemCount = GetItemCount();
do
{
ImplAccelEntry* pEntry = ( nIndex < mpData->maIdList.size() ) ? mpData->maIdList[ nIndex ] : NULL;
@@ -450,8 +450,8 @@ void Accelerator::RemoveItem( const KeyCode rKeyCode )
if ( pEntry )
{
// Aus der Id-Liste entfernen
- USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), pEntry->mnId );
- USHORT nItemCount = GetItemCount();
+ sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), pEntry->mnId );
+ sal_uInt16 nItemCount = GetItemCount();
do
{
if ( mpData->maIdList[ nIndex ] == pEntry )
@@ -486,16 +486,16 @@ void Accelerator::Clear()
// -----------------------------------------------------------------------
-USHORT Accelerator::GetItemCount() const
+sal_uInt16 Accelerator::GetItemCount() const
{
DBG_CHKTHIS( Accelerator, NULL );
- return (USHORT)mpData->maIdList.size();
+ return (sal_uInt16)mpData->maIdList.size();
}
// -----------------------------------------------------------------------
-USHORT Accelerator::GetItemId( USHORT nPos ) const
+sal_uInt16 Accelerator::GetItemId( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -508,7 +508,7 @@ USHORT Accelerator::GetItemId( USHORT nPos ) const
// -----------------------------------------------------------------------
-KeyCode Accelerator::GetItemKeyCode( USHORT nPos ) const
+KeyCode Accelerator::GetItemKeyCode( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -521,7 +521,7 @@ KeyCode Accelerator::GetItemKeyCode( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT Accelerator::GetItemId( const KeyCode& rKeyCode ) const
+sal_uInt16 Accelerator::GetItemId( const KeyCode& rKeyCode ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -534,11 +534,11 @@ USHORT Accelerator::GetItemId( const KeyCode& rKeyCode ) const
// -----------------------------------------------------------------------
-KeyCode Accelerator::GetKeyCode( USHORT nItemId ) const
+KeyCode Accelerator::GetKeyCode( sal_uInt16 nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
return mpData->maIdList[ nIndex ]->maKeyCode;
else
@@ -547,17 +547,17 @@ KeyCode Accelerator::GetKeyCode( USHORT nItemId ) const
// -----------------------------------------------------------------------
-BOOL Accelerator::IsIdValid( USHORT nItemId ) const
+sal_Bool Accelerator::IsIdValid( sal_uInt16 nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
return (nIndex != ACCELENTRY_NOTFOUND);
}
// -----------------------------------------------------------------------
-BOOL Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const
+sal_Bool Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -567,7 +567,7 @@ BOOL Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const
// -----------------------------------------------------------------------
-BOOL Accelerator::Call( const KeyCode& rKeyCode, USHORT nRepeat )
+sal_Bool Accelerator::Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat )
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -576,7 +576,7 @@ BOOL Accelerator::Call( const KeyCode& rKeyCode, USHORT nRepeat )
{
if ( pEntry->mbEnabled )
{
- BOOL bDel = FALSE;
+ sal_Bool bDel = sal_False;
mnCurId = pEntry->mnId;
maCurKeyCode = rKeyCode;
mnCurRepeat = nRepeat;
@@ -589,23 +589,23 @@ BOOL Accelerator::Call( const KeyCode& rKeyCode, USHORT nRepeat )
mnCurRepeat = 0;
}
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void Accelerator::SetAccel( USHORT nItemId, Accelerator* pAccel )
+void Accelerator::SetAccel( sal_uInt16 nItemId, Accelerator* pAccel )
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
- USHORT nItemCount = GetItemCount();
+ sal_uInt16 nItemCount = GetItemCount();
do
{
ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ];
@@ -621,11 +621,11 @@ void Accelerator::SetAccel( USHORT nItemId, Accelerator* pAccel )
// -----------------------------------------------------------------------
-Accelerator* Accelerator::GetAccel( USHORT nItemId ) const
+Accelerator* Accelerator::GetAccel( sal_uInt16 nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
return mpData->maIdList[ nIndex ]->mpAccel;
else
@@ -653,19 +653,19 @@ Accelerator* Accelerator::GetAccel( const KeyCode rKeyCode ) const
if ( pEntry )
return pEntry->mpAccel;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void Accelerator::EnableItem( USHORT nItemId, BOOL bEnable )
+void Accelerator::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
- USHORT nItemCount = GetItemCount();
+ sal_uInt16 nItemCount = GetItemCount();
do
{
ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ];
@@ -681,20 +681,20 @@ void Accelerator::EnableItem( USHORT nItemId, BOOL bEnable )
// -----------------------------------------------------------------------
-BOOL Accelerator::IsItemEnabled( USHORT nItemId ) const
+sal_Bool Accelerator::IsItemEnabled( sal_uInt16 nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
return mpData->maIdList[ nIndex ]->mbEnabled;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void Accelerator::EnableItem( const KeyCode rKeyCode, BOOL bEnable )
+void Accelerator::EnableItem( const KeyCode rKeyCode, sal_Bool bEnable )
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -705,7 +705,7 @@ void Accelerator::EnableItem( const KeyCode rKeyCode, BOOL bEnable )
// -----------------------------------------------------------------------
-BOOL Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const
+sal_Bool Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -713,7 +713,7 @@ BOOL Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const
if ( pEntry )
return pEntry->mbEnabled;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -728,7 +728,7 @@ Accelerator& Accelerator::operator=( const Accelerator& rAccel )
maCurKeyCode = KeyCode();
mnCurId = 0;
mnCurRepeat = 0;
- mbIsCancel = FALSE;
+ mbIsCancel = sal_False;
// Tabellen loeschen und kopieren
ImplDeleteData();