diff options
Diffstat (limited to 'sfx2/source/control/msgpool.cxx')
-rwxr-xr-x[-rw-r--r--] | sfx2/source/control/msgpool.cxx | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/sfx2/source/control/msgpool.cxx b/sfx2/source/control/msgpool.cxx index 227f7c91c7d5..b2afa3dc1e22 100644..100755 --- a/sfx2/source/control/msgpool.cxx +++ b/sfx2/source/control/msgpool.cxx @@ -39,8 +39,7 @@ #include <sfx2/app.hxx> #include <sfx2/objface.hxx> #include "sfxtypes.hxx" -#include <sfx2/macrconf.hxx> -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include "arrdecl.hxx" #include <sfx2/module.hxx> @@ -50,15 +49,15 @@ struct SfxSlotType_Impl { - USHORT nId; + sal_uInt16 nId; TypeId nType; - SfxSlotType_Impl( USHORT nTheId, TypeId nTheType ): + SfxSlotType_Impl( sal_uInt16 nTheId, TypeId nTheType ): nId(nTheId), nType(nTheType) {} }; -DECL_2BYTEARRAY(SfxSlotGroupArr_Impl, USHORT, 6, 4) +DECL_2BYTEARRAY(SfxSlotGroupArr_Impl, sal_uInt16, 6, 4) DECL_PTRARRAY(SfxInterfaceArr_Impl, SfxInterface*, 6, 3) DECL_PTRARRAY(SfxSlotTypeArr_Impl, SfxSlotType_Impl*, 8, 8) @@ -91,7 +90,7 @@ SfxSlotPool::~SfxSlotPool() delete _pGroups; if ( _pTypes ) { - for ( USHORT n =_pTypes->Count(); n--; ) + for ( sal_uInt16 n =_pTypes->Count(); n--; ) delete _pTypes->GetObject(n); delete _pTypes; } @@ -123,14 +122,14 @@ void SfxSlotPool::RegisterInterface( SfxInterface& rInterface ) { // The Groups in parent Slotpool are also known here SfxSlotGroupArr_Impl& rGroups = *_pParentPool->_pGroups; - for ( USHORT n=0; n<rGroups.Count(); n++ ) + for ( sal_uInt16 n=0; n<rGroups.Count(); n++ ) _pGroups->Append( rGroups[n] ); } } if ( !_pTypes ) _pTypes = new SfxSlotTypeArr_Impl; - for ( USHORT nFunc = 0; nFunc < rInterface.Count(); ++nFunc ) + for ( sal_uInt16 nFunc = 0; nFunc < rInterface.Count(); ++nFunc ) { SfxSlot *pDef = rInterface[nFunc]; if ( pDef->GetGroupId() && /* pDef->GetGroupId() != GID_INTERN && */ @@ -146,7 +145,7 @@ void SfxSlotPool::RegisterInterface( SfxInterface& rInterface ) //==================================================================== -TypeId SfxSlotPool::GetSlotType( USHORT nId ) const +TypeId SfxSlotPool::GetSlotType( sal_uInt16 nId ) const { const SfxSlot* pSlot = (const_cast <SfxSlotPool*> (this))->GetSlot( nId ); return pSlot ? pSlot->GetType()->Type() : 0; @@ -167,13 +166,13 @@ void SfxSlotPool::ReleaseInterface( SfxInterface& rInterface ) // get the first SfxMessage for a special Id (e.g. for getting check-mode) -const SfxSlot* SfxSlotPool::GetSlot( USHORT nId ) +const SfxSlot* SfxSlotPool::GetSlot( sal_uInt16 nId ) { DBG_MEMTEST(); DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" ); // First, search their own interfaces - for ( USHORT nInterf = 0; nInterf < _pInterfaces->Count(); ++nInterf ) + for ( sal_uInt16 nInterf = 0; nInterf < _pInterfaces->Count(); ++nInterf ) { const SfxSlot *pDef = _pInterfaces->GetObject(nInterf)->GetSlot(nId); if ( pDef ) @@ -188,7 +187,7 @@ const SfxSlot* SfxSlotPool::GetSlot( USHORT nId ) // skips to the next group -String SfxSlotPool::SeekGroup( USHORT nNo ) +String SfxSlotPool::SeekGroup( sal_uInt16 nNo ) { DBG_MEMTEST(); DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" ); @@ -200,14 +199,14 @@ String SfxSlotPool::SeekGroup( USHORT nNo ) if ( _pParentPool ) { // In most cases, the order of the IDs agree - USHORT nParentCount = _pParentPool->_pGroups->Count(); + sal_uInt16 nParentCount = _pParentPool->_pGroups->Count(); if ( nNo < nParentCount && (*_pGroups)[nNo] == (*_pParentPool->_pGroups)[nNo] ) _pParentPool->_nCurGroup = nNo; else { // Otherwise search. If the group is not found in the parent // pool, _nCurGroup is set outside the valid range - USHORT i; + sal_uInt16 i; for ( i=1; i<nParentCount; i++ ) if ( (*_pGroups)[nNo] == (*_pParentPool->_pGroups)[i] ) break; @@ -232,7 +231,7 @@ String SfxSlotPool::SeekGroup( USHORT nNo ) //-------------------------------------------------------------------- -USHORT SfxSlotPool::GetGroupCount() +sal_uInt16 SfxSlotPool::GetGroupCount() { return _pGroups->Count(); } @@ -242,13 +241,13 @@ USHORT SfxSlotPool::GetGroupCount() // internal search loop -const SfxSlot* SfxSlotPool::SeekSlot( USHORT nStartInterface ) +const SfxSlot* SfxSlotPool::SeekSlot( sal_uInt16 nStartInterface ) { DBG_MEMTEST(); DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" ); // The numbering starts at the interfaces of the parent pool - USHORT nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0; + sal_uInt16 nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0; // have reached the end of the Parent-Pools? if ( nStartInterface < nFirstInterface && @@ -264,7 +263,7 @@ const SfxSlot* SfxSlotPool::SeekSlot( USHORT nStartInterface ) } // find the first func-def with the current group id - USHORT nCount = _pInterfaces->Count() + nFirstInterface; + sal_uInt16 nCount = _pInterfaces->Count() + nFirstInterface; for ( _nCurInterface = nStartInterface; _nCurInterface < nCount; ++_nCurInterface ) @@ -292,7 +291,7 @@ const SfxSlot* SfxSlotPool::NextSlot() DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" ); // The numbering starts at the interfaces of the parent pool - USHORT nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0; + sal_uInt16 nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0; if ( _nCurInterface < nFirstInterface && _nCurGroup >= _pParentPool->_pGroups->Count() ) _nCurInterface = nFirstInterface; @@ -309,7 +308,7 @@ const SfxSlot* SfxSlotPool::NextSlot() return SeekSlot( nFirstInterface ); } - USHORT nInterface = _nCurInterface - nFirstInterface; + sal_uInt16 nInterface = _nCurInterface - nFirstInterface; // possibly we are already at the end if ( nInterface >= _pInterfaces->Count() ) return 0; @@ -345,17 +344,17 @@ SfxInterface* SfxSlotPool::FirstInterface() SfxInterface* SfxSlotPool::NextInterface() { _nCurInterface++; - USHORT nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0; + sal_uInt16 nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0; if ( _nCurInterface < nFirstInterface ) return (*_pParentPool->_pInterfaces)[_nCurInterface]; - USHORT nInterface = _nCurInterface - nFirstInterface; + sal_uInt16 nInterface = _nCurInterface - nFirstInterface; return nInterface < _pInterfaces->Count() ? (*_pInterfaces)[nInterface] : 0; } const SfxSlot* SfxSlotPool::GetUnoSlot( const String& rName ) { const SfxSlot *pSlot = NULL; - for ( USHORT nInterface=0; nInterface<_pInterfaces->Count(); nInterface++ ) + for ( sal_uInt16 nInterface=0; nInterface<_pInterfaces->Count(); nInterface++ ) { pSlot = (*_pInterfaces)[nInterface]->GetSlot( rName ); if ( pSlot ) |