diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2011-02-14 16:17:22 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2011-02-14 16:17:22 +0100 |
commit | 1fb042333fe6287756ff1fac11d18cd7c150730d (patch) | |
tree | 595de5d187177832ce656d7832af9dce9dce2d99 /sfx2/source/control | |
parent | 5b3e910e926c7dd1e8dcfe8e0a5c6cb5bd17480a (diff) | |
parent | cd0d6a5a6775f197fdb7e78b54c8133074a7a236 (diff) |
rebase to DEV300_m100
Diffstat (limited to 'sfx2/source/control')
-rw-r--r-- | sfx2/source/control/bindings.cxx | 63 | ||||
-rw-r--r-- | sfx2/source/control/ctrlitem.cxx | 24 | ||||
-rwxr-xr-x | sfx2/source/control/dispatch.cxx | 129 | ||||
-rw-r--r-- | sfx2/source/control/macrconf.cxx | 874 | ||||
-rw-r--r-- | sfx2/source/control/macro.cxx | 46 | ||||
-rw-r--r-- | sfx2/source/control/minfitem.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/msg.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/msgpool.cxx | 49 | ||||
-rw-r--r-- | sfx2/source/control/objface.cxx | 110 | ||||
-rw-r--r-- | sfx2/source/control/querystatus.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/control/request.cxx | 134 | ||||
-rw-r--r-- | sfx2/source/control/sfxstatuslistener.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/control/shell.cxx | 158 | ||||
-rw-r--r-- | sfx2/source/control/sorgitm.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/control/statcach.cxx | 14 | ||||
-rw-r--r-- | sfx2/source/control/unoctitm.cxx | 16 |
16 files changed, 342 insertions, 1301 deletions
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 40f6346de8ee..d8e4258e60d4 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -64,7 +64,6 @@ #include <sfx2/objface.hxx> #include "sfxtypes.hxx" #include "workwin.hxx" -#include <sfx2/macrconf.hxx> #include <sfx2/unoctitm.hxx> #include <sfx2/sfx.hrc> #include <sfx2/sfxuno.hxx> @@ -92,7 +91,7 @@ DBG_NAME(SfxBindingsInvalidateAll) //==================================================================== -static USHORT nTimeOut = 300; +static sal_uInt16 nTimeOut = 300; #define TIMEOUT_FIRST nTimeOut #define TIMEOUT_UPDATING 20 @@ -101,7 +100,7 @@ static USHORT nTimeOut = 300; static sal_uInt32 nCache1 = 0; static sal_uInt32 nCache2 = 0; -typedef std::hash_map< USHORT, bool > InvalidateSlotMap; +typedef std::hash_map< sal_uInt16, bool > InvalidateSlotMap; //==================================================================== @@ -400,7 +399,7 @@ void SfxBindings::Update_Impl { if( pCache->GetDispatch().is() && pCache->GetItemLink() ) { - pCache->SetCachedState(TRUE); + pCache->SetCachedState(sal_True); if ( !pCache->GetInternalController() ) return; } @@ -468,7 +467,7 @@ void SfxBindings::InvalidateSlotsInMap_Impl() //-------------------------------------------------------------------- -void SfxBindings::AddSlotToInvalidateSlotsMap_Impl( USHORT nId ) +void SfxBindings::AddSlotToInvalidateSlotsMap_Impl( sal_uInt16 nId ) { pImp->m_aInvalidateSlots[nId] = sal_True; } @@ -505,10 +504,10 @@ void SfxBindings::Update if (pCache) { - BOOL bInternalUpdate = TRUE; + sal_Bool bInternalUpdate = sal_True; if( pCache->GetDispatch().is() && pCache->GetItemLink() ) { - pCache->SetCachedState(TRUE); + pCache->SetCachedState(sal_True); bInternalUpdate = ( pCache->GetInternalController() != 0 ); } @@ -1028,16 +1027,16 @@ sal_uInt16 SfxBindings::GetSlotPos( sal_uInt16 nId, sal_uInt16 nStartSearchAt ) //-------------------------------------------------------------------- void SfxBindings::RegisterInternal_Impl( SfxControllerItem& rItem ) { - Register_Impl( rItem, TRUE ); + Register_Impl( rItem, sal_True ); } void SfxBindings::Register( SfxControllerItem& rItem ) { - Register_Impl( rItem, FALSE ); + Register_Impl( rItem, sal_False ); } -void SfxBindings::Register_Impl( SfxControllerItem& rItem, BOOL bInternal ) +void SfxBindings::Register_Impl( SfxControllerItem& rItem, sal_Bool bInternal ) { DBG_MEMTEST(); DBG_ASSERT( nRegLevel > 0, "registration without EnterRegistrations" ); @@ -1118,13 +1117,7 @@ void SfxBindings::Release( SfxControllerItem& rItem ) delete (*pImp->pCaches)[nPos]; pImp->pCaches->Remove(nPos, 1); #endif - if ( SfxMacroConfig::IsMacroSlot( nId ) ) - { - delete (*pImp->pCaches)[nPos]; - pImp->pCaches->Remove(nPos, 1); - } - else - pImp->bCtrlReleased = sal_True; + pImp->bCtrlReleased = sal_True; } } @@ -1157,14 +1150,14 @@ sal_Bool SfxBindings::Execute( sal_uInt16 nId, const SfxPoolItem** ppItems, sal_ return ( pRet != 0 ); } -void SfxBindings::ExecuteGlobal_Impl( USHORT nId ) +void SfxBindings::ExecuteGlobal_Impl( sal_uInt16 nId ) { if( nId && pDispatcher ) - Execute_Impl( nId, NULL, 0, SFX_CALLMODE_ASYNCHRON, NULL, TRUE ); + Execute_Impl( nId, NULL, 0, SFX_CALLMODE_ASYNCHRON, NULL, sal_True ); } const SfxPoolItem* SfxBindings::Execute_Impl( sal_uInt16 nId, const SfxPoolItem** ppItems, sal_uInt16 nModi, SfxCallMode nCallMode, - const SfxPoolItem **ppInternalArgs, BOOL bGlobalOnly ) + const SfxPoolItem **ppInternalArgs, sal_Bool bGlobalOnly ) { SfxStateCache *pCache = GetStateCache( nId ); if ( !pCache ) @@ -1384,10 +1377,10 @@ void SfxBindings::UpdateSlotServer_Impl() ( pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY ); //if ( xFrame.is() ) // xFrame->contextChanged(); - pImp->bContextChanged = FALSE; + pImp->bContextChanged = sal_False; } else - pImp->bContextChanged = TRUE; + pImp->bContextChanged = sal_True; } const sal_uInt16 nCount = pImp->pCaches->Count(); @@ -1473,8 +1466,8 @@ SfxItemSet* SfxBindings::CreateSet_Impl pRealSlot->GetSlotId(), pRealSlot->GetWhich(rPool), pRealSlot, pCache ); rFound.Insert( pFound ); - USHORT nSlot = pRealSlot->GetSlotId(); - if ( !SfxMacroConfig::IsMacroSlot( nSlot ) && !(nSlot >= SID_VERB_START && nSlot <= SID_VERB_END) ) + sal_uInt16 nSlot = pRealSlot->GetSlotId(); + if ( !(nSlot >= SID_VERB_START && nSlot <= SID_VERB_END) ) { pInterface = pInterface->GetRealInterfaceForSlot( pRealSlot ); DBG_ASSERT (pInterface,"Slot in angegebener Shell nicht gefunden!"); @@ -1503,10 +1496,10 @@ SfxItemSet* SfxBindings::CreateSet_Impl } // Mu\s der Slot "uberhaupt upgedatet werden ? - FASTBOOL bInsert = pSiblingCache && pSiblingCache->IsControllerDirty(); + bool bInsert = pSiblingCache && pSiblingCache->IsControllerDirty(); // Bugfix #26161#: Es reicht nicht, nach der selben Shell zu fragen !! - FASTBOOL bSameMethod = pSiblingCache && pFnc == pSiblingFnc; + bool bSameMethod = pSiblingCache && pFnc == pSiblingFnc; // Wenn der Slot ein nicht-dirty MasterSlot ist, dann ist vielleicht // einer seiner Slaves dirty ? Dann wird der Masterslot doch eingef"ugt. @@ -1550,7 +1543,7 @@ SfxItemSet* SfxBindings::CreateSet_Impl // aus den Ranges ein Set erzeugen sal_uInt16 *pRanges = new sal_uInt16[rFound.Count() * 2 + 1]; int j = 0; - USHORT i = 0; + sal_uInt16 i = 0; while ( i < rFound.Count() ) { pRanges[j++] = rFound[i]->nWhichId; @@ -1736,7 +1729,7 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) pImp->aTimer.SetTimeout(TIMEOUT_UPDATING); // at least 10 loops and further if more jobs are available but no input - FASTBOOL bPreEmptive = pTimer && !pSfxApp->Get_Impl()->nInReschedule; + bool bPreEmptive = pTimer && !pSfxApp->Get_Impl()->nInReschedule; sal_uInt16 nLoops = 10; pImp->bInNextJob = sal_True; const sal_uInt16 nCount = pImp->pCaches->Count(); @@ -1920,7 +1913,7 @@ void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int { if ( pImp->bContextChanged ) { - pImp->bContextChanged = FALSE; + pImp->bContextChanged = sal_False; /* ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame ( pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY ); @@ -2132,12 +2125,12 @@ SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, SfxPoolItem* &rpState ) if ( !pDisp ) { - BOOL bDeleteCache = FALSE; + sal_Bool bDeleteCache = sal_False; if ( !pCache ) { pCache = new SfxStateCache( nSlot ); pCache->GetSlotServer( *GetDispatcher_Impl(), pImp->xProv ); - bDeleteCache = TRUE; + bDeleteCache = sal_True; } SfxItemState eState = SFX_ITEM_SET; @@ -2353,7 +2346,7 @@ SystemWindow* SfxBindings::GetSystemWindow() const return pTop->GetFrame().GetTopWindow_Impl(); } -BOOL SfxBindings::ExecuteCommand_Impl( const String& rCommand ) +sal_Bool SfxBindings::ExecuteCommand_Impl( const String& rCommand ) { ::com::sun::star::util::URL aURL; aURL.Complete = rCommand; @@ -2382,10 +2375,10 @@ BOOL SfxBindings::ExecuteCommand_Impl( const String& rCommand ) ::comphelper::UiEventsLogger::logDispatch(aURL, source); } new SfxAsyncExec_Impl( aURL, xDisp ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > SfxBindings::GetRecorder() const @@ -2402,7 +2395,7 @@ void SfxBindings::ContextChanged_Impl() { if ( !pImp->bInUpdate && ( !pImp->bContextChanged || !pImp->bAllMsgDirty ) ) { - InvalidateAll( TRUE ); + InvalidateAll( sal_True ); } } diff --git a/sfx2/source/control/ctrlitem.cxx b/sfx2/source/control/ctrlitem.cxx index 9376b81fa0ff..e90b680ffa13 100644 --- a/sfx2/source/control/ctrlitem.cxx +++ b/sfx2/source/control/ctrlitem.cxx @@ -45,7 +45,7 @@ DBG_NAME(SfxControllerItem); //-------------------------------------------------------------------- #ifdef DBG_UTIL -void SfxControllerItem::CheckConfigure_Impl( ULONG nType ) +void SfxControllerItem::CheckConfigure_Impl( sal_uIntPtr nType ) { // echter Slot? (also kein Separator etc.) if ( !nId ) @@ -77,9 +77,9 @@ SfxControllerItem* SfxControllerItem::GetItemLink() //-------------------------------------------------------------------- -// returns TRUE if this binding is really bound to a function +// returns sal_True if this binding is really bound to a function -BOOL SfxControllerItem::IsBound() const +sal_Bool SfxControllerItem::IsBound() const { DBG_MEMTEST(); DBG_CHKTHIS(SfxControllerItem, 0); @@ -90,13 +90,13 @@ BOOL SfxControllerItem::IsBound() const // returns the associated function-id or 0 if none -// USHORT SfxControllerItem::GetId() const; +// sal_uInt16 SfxControllerItem::GetId() const; //==================================================================== // registeres with the id at the bindings -void SfxControllerItem::Bind( USHORT nNewId, SfxBindings *pBindinx ) +void SfxControllerItem::Bind( sal_uInt16 nNewId, SfxBindings *pBindinx ) { DBG_MEMTEST(); DBG_CHKTHIS(SfxControllerItem, 0); @@ -115,7 +115,7 @@ void SfxControllerItem::Bind( USHORT nNewId, SfxBindings *pBindinx ) pBindings->Register(*this); } -void SfxControllerItem::BindInternal_Impl( USHORT nNewId, SfxBindings *pBindinx ) +void SfxControllerItem::BindInternal_Impl( sal_uInt16 nNewId, SfxBindings *pBindinx ) { DBG_MEMTEST(); DBG_CHKTHIS(SfxControllerItem, 0); @@ -261,7 +261,7 @@ SfxControllerItem* SfxControllerItem::ChangeItemLink( SfxControllerItem* pNewLin // changes the id of unbound functions (e.g. for sub-menu-ids) -void SfxControllerItem::SetId( USHORT nItemId ) +void SfxControllerItem::SetId( sal_uInt16 nItemId ) { DBG_MEMTEST(); DBG_CHKTHIS(SfxControllerItem, 0); @@ -286,7 +286,7 @@ SfxControllerItem::SfxControllerItem(): // creates a representation of the function nId and registeres it -SfxControllerItem::SfxControllerItem( USHORT nID, SfxBindings &rBindings ): +SfxControllerItem::SfxControllerItem( sal_uInt16 nID, SfxBindings &rBindings ): nId(nID), pNext(this), pBindings(&rBindings) @@ -312,7 +312,7 @@ SfxControllerItem::~SfxControllerItem() void SfxControllerItem::StateChanged ( - USHORT , // <SID> des ausl"osenden Slot + sal_uInt16 , // <SID> des ausl"osenden Slot SfxItemState , // <SfxItemState> von 'pState' const SfxPoolItem* // Slot-Status, ggf. 0 oder IsInvalidItem() ) @@ -352,7 +352,7 @@ void SfxControllerItem::DeleteFloatingWindow() void SfxStatusForwarder::StateChanged ( - USHORT nSID, // <SID> des ausl"osenden Slot + sal_uInt16 nSID, // <SID> des ausl"osenden Slot SfxItemState eState, // <SfxItemState> von 'pState' const SfxPoolItem* pState // Slot-Status, ggf. 0 oder IsInvalidItem() ) @@ -364,7 +364,7 @@ void SfxStatusForwarder::StateChanged //-------------------------------------------------------------------- SfxStatusForwarder::SfxStatusForwarder( - USHORT nSlotId, + sal_uInt16 nSlotId, SfxControllerItem& rMaster ): SfxControllerItem( nSlotId, rMaster.GetBindings() ), pMaster( &rMaster ) @@ -448,7 +448,7 @@ SfxMapUnit SfxControllerItem::GetCoreMetric() const { SfxShell *pSh = pDispat->GetShell( pServer->GetShellLevel() ); SfxItemPool &rPool = pSh->GetPool(); - USHORT nWhich = rPool.GetWhich( nId ); + sal_uInt16 nWhich = rPool.GetWhich( nId ); return rPool.GetMetric( nWhich ); } } diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index c08d713547a0..9b403e3ddab4 100755 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -69,7 +69,6 @@ #include "slotserv.hxx" #include <sfx2/ipclient.hxx> #include "sfxtypes.hxx" -#include <sfx2/macrconf.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/viewsh.hxx> #include <sfx2/childwin.hxx> @@ -159,7 +158,6 @@ struct SfxDispatcher_Impl SfxObjectBars_Impl aObjBars[SFX_OBJECTBAR_MAX]; SfxObjectBars_Impl aFixedObjBars[SFX_OBJECTBAR_MAX]; SvULongs aChildWins; - sal_uInt16 nActionLevel; // in EnterAction sal_uInt32 nEventId; // EventId UserEvent sal_Bool bUILocked; // Update abgeklemmt (!zappeln) sal_Bool bNoUI; // UI nur vom Parent Dispatcher @@ -367,7 +365,6 @@ void SfxDispatcher::Construct_Impl( SfxDispatcher* pParent ) pImp->pParent = pParent; pImp->bInvalidateOnUnlock = sal_False; - pImp->nActionLevel = 0; for (sal_uInt16 n=0; n<SFX_OBJECTBAR_MAX; n++) pImp->aObjBars[n].nResId = 0; @@ -488,9 +485,6 @@ void SfxDispatcher::Pop DBG_MEMTEST(); DBG_ASSERT( rShell.GetInterface(), "pushing SfxShell without previous RegisterInterface()" ); - DBG_ASSERT( pImp->nActionLevel == 0, "Push or Pop within Action" ); -// DBG_ASSERT( SFX_APP()->IsInAsynchronCall_Impl(), -// "Dispatcher Push/Pop in synchron-call-stack" ); bool bDelete = (nMode & SFX_SHELL_POP_DELETE) == SFX_SHELL_POP_DELETE; bool bUntil = (nMode & SFX_SHELL_POP_UNTIL) == SFX_SHELL_POP_UNTIL; @@ -802,11 +796,11 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ ) SfxBindings *pBind = GetBindings(); while ( pBind ) { - pBind->HidePopupCtrls_Impl( FALSE ); + pBind->HidePopupCtrls_Impl( sal_False ); pBind = pBind->GetSubBindings_Impl(); } - pImp->pFrame->GetFrame().GetWorkWindow_Impl()->HidePopups_Impl( FALSE, FALSE, 1 ); + pImp->pFrame->GetFrame().GetWorkWindow_Impl()->HidePopups_Impl( sal_False, sal_False, 1 ); } if ( pImp->aToDoStack.Count() ) @@ -888,7 +882,7 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew ) for ( sal_uInt16 i = 0; i < pImp->aStack.Count(); ++i ) pImp->aStack.Top(i)->DoDeactivate_Impl(pImp->pFrame, bMDI); - BOOL bHidePopups = bMDI && pImp->pFrame; + sal_Bool bHidePopups = bMDI && pImp->pFrame; if ( pNew && pImp->pFrame ) { com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xOldFrame( @@ -898,7 +892,7 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew ) GetFrame()->GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY ); if ( xOldFrame == xMyFrame ) - bHidePopups = FALSE; + bHidePopups = sal_False; } if ( bHidePopups ) @@ -907,11 +901,11 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew ) SfxBindings *pBind = GetBindings(); while ( pBind ) { - pBind->HidePopupCtrls_Impl( TRUE ); + pBind->HidePopupCtrls_Impl( sal_True ); pBind = pBind->GetSubBindings_Impl(); } - pImp->pFrame->GetFrame().GetWorkWindow_Impl()->HidePopups_Impl( TRUE, FALSE, 1 ); + pImp->pFrame->GetFrame().GetWorkWindow_Impl()->HidePopups_Impl( sal_True, sal_False, 1 ); } Flush(); @@ -1029,10 +1023,6 @@ void SfxDispatcher::_Execute if ( IsLocked( rSlot.GetSlotId() ) ) return; - sal_uInt16 nSlot = rSlot.GetSlotId(); - if ( SfxMacroConfig::IsMacroSlot( nSlot ) ) - SFX_APP()->GetMacroConfig()->RegisterSlotId( nSlot ); - if ( (eCallMode & SFX_CALLMODE_ASYNCHRON) || ( !(eCallMode & SFX_CALLMODE_SYNCHRON) && rSlot.IsMode(SFX_SLOT_ASYNCHRON) ) ) @@ -1046,7 +1036,7 @@ void SfxDispatcher::_Execute if ( &rShell == pDispat->pImp->aStack.Top(n) ) { if ( eCallMode & SFX_CALLMODE_RECORD ) - rReq.AllowRecording( TRUE ); + rReq.AllowRecording( sal_True ); pDispat->pImp->xPoster->Post(new SfxRequest(rReq)); // pDispat->pImp->xPoster->Post(new Executer(new SfxRequest(rReq), &rSlot, n )); return; @@ -1293,11 +1283,11 @@ const SfxPoolItem* SfxDispatcher::Execute( const SfxExecuteItem& rItem ) //-------------------------------------------------------------------- const SfxPoolItem* SfxDispatcher::Execute( - USHORT nSlot, + sal_uInt16 nSlot, SfxCallMode nCall, SfxItemSet* pArgs, SfxItemSet* pInternalArgs, - USHORT nModi) + sal_uInt16 nModi) { if ( IsLocked(nSlot) ) return 0; @@ -1418,9 +1408,9 @@ const SfxPoolItem* SfxDispatcher::Execute //-------------------------------------------------------------------- const SfxPoolItem* SfxDispatcher::Execute ( - USHORT nSlot, + sal_uInt16 nSlot, SfxCallMode eCall, - USHORT nModi, + sal_uInt16 nModi, const SfxItemSet &rArgs ) { @@ -1618,38 +1608,6 @@ IMPL_LINK( SfxDispatcher, PostMsgHandler, SfxRequest*, pReq ) return 0; } //-------------------------------------------------------------------- -void SfxDispatcher::EnterAction( const String& rName ) - -// marks the beginning of a block of actions - -{ - DBG_MEMTEST(); - Flush(); - DBG_ASSERT( pImp->aStack.Count() > 0, "EnterAction on empty dispatcher stack" ); - if ( ++pImp->nActionLevel == 1 ) - { - SfxUndoManager *pUndoMgr = GetShell(0)->GetUndoManager(); - if ( pUndoMgr ) - pUndoMgr->EnterListAction( rName, rName HACK(RepeatComment), 0 HACK(ID) ); - } -} -//-------------------------------------------------------------------- -void SfxDispatcher::LeaveAction() - -// marks the end of a block of actions - -{ - DBG_MEMTEST(); - DBG_ASSERT( pImp->nActionLevel > 0, "EnterAction without LeaveAction" ); - if ( --pImp->nActionLevel == 0 ) - { - SfxUndoManager *pUndoMgr = GetShell(0)->GetUndoManager(); - if ( pUndoMgr ) - pUndoMgr->LeaveListAction(); - } -} - -//-------------------------------------------------------------------- void SfxDispatcher::SetMenu_Impl() { if ( pImp->pFrame ) @@ -1839,10 +1797,10 @@ void SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, sal_Bo // check for toolboxes that are exclusively for a viewer if ( pImp->pFrame) { - BOOL bViewerTbx = SFX_VISIBILITY_VIEWER == ( nPos & SFX_VISIBILITY_VIEWER ); + sal_Bool bViewerTbx = SFX_VISIBILITY_VIEWER == ( nPos & SFX_VISIBILITY_VIEWER ); SfxObjectShell* pSh = pImp->pFrame->GetObjectShell(); SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pItem, SfxBoolItem, SID_VIEWONLY, sal_False ); - BOOL bIsViewer = pItem && pItem->GetValue(); + sal_Bool bIsViewer = pItem && pItem->GetValue(); if ( bIsViewer != bViewerTbx ) continue; } @@ -2022,7 +1980,7 @@ void SfxDispatcher::FlushImpl() { // tats"aechlich poppen SfxShell* pPopped = 0; - FASTBOOL bFound = sal_False; + bool bFound = sal_False; do { DBG_ASSERT( pImp->aStack.Count(), "popping from empty stack" ); @@ -2298,7 +2256,6 @@ sal_Bool SfxDispatcher::_FindServer SFX_STACK(SfxDispatcher::_FindServer); // Dispatcher gelockt? (SID_HELP_PI trotzdem durchlassen) - SfxApplication *pSfxApp = SFX_APP(); if ( IsLocked(nSlot) ) { pImp->bInvalidateOnUnlock = sal_True; @@ -2318,25 +2275,8 @@ sal_Bool SfxDispatcher::_FindServer } } - // Makro-Slot? - if ( SfxMacroConfig::IsMacroSlot( nSlot ) ) - { - const SfxMacroInfo* pInfo = pSfxApp->GetMacroConfig()->GetMacroInfo(nSlot); - if ( pInfo ) - { - const SfxSlot* pSlot = pInfo->GetSlot(); - if ( pSlot ) - { - rServer.SetShellLevel(nTotCount-1); - rServer.SetSlot( pSlot ); - return sal_True; - } - } - - return sal_False; - } // Verb-Slot? - else if (nSlot >= SID_VERB_START && nSlot <= SID_VERB_END) + if (nSlot >= SID_VERB_START && nSlot <= SID_VERB_END) { for ( sal_uInt16 nShell = 0;; ++nShell ) { @@ -2403,12 +2343,12 @@ sal_Bool SfxDispatcher::_FindServer if ( pSlot ) { // Slot geh"ort zum Container? - FASTBOOL bIsContainerSlot = pSlot->IsMode(SFX_SLOT_CONTAINER); - FASTBOOL bIsInPlace = pImp->pFrame && pImp->pFrame->GetObjectShell()->IsInPlaceActive(); + bool bIsContainerSlot = pSlot->IsMode(SFX_SLOT_CONTAINER); + bool bIsInPlace = pImp->pFrame && pImp->pFrame->GetObjectShell()->IsInPlaceActive(); // Shell geh"ort zum Server? // AppDispatcher oder IPFrame-Dispatcher - FASTBOOL bIsServerShell = !pImp->pFrame || bIsInPlace; + bool bIsServerShell = !pImp->pFrame || bIsInPlace; // Nat"urlich sind ServerShell-Slots auch ausf"uhrbar, wenn sie auf // einem Container-Dispatcher ohne IPClient ausgef"uhrt werden sollen. @@ -2420,7 +2360,7 @@ sal_Bool SfxDispatcher::_FindServer // Shell geh"ort zum Container? // AppDispatcher oder kein IPFrameDispatcher - FASTBOOL bIsContainerShell = !pImp->pFrame || !bIsInPlace; + bool bIsContainerShell = !pImp->pFrame || !bIsInPlace; // Shell und Slot passen zusammen if ( !( ( bIsContainerSlot && bIsContainerShell ) || ( !bIsContainerSlot && bIsServerShell ) ) ) @@ -2474,10 +2414,7 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot ) nTotCount = nTotCount + pImp->aStack.Count(); } - if ( SfxMacroConfig::IsMacroSlot( nSlot ) ) - // Makro-Slot? - return sal_True; - else if (nSlot >= SID_VERB_START && nSlot <= SID_VERB_END) + if (nSlot >= SID_VERB_START && nSlot <= SID_VERB_END) { // Verb-Slot? for ( sal_uInt16 nShell = 0;; ++nShell ) @@ -2521,12 +2458,12 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot ) if ( pSlot ) { // Slot geh"ort zum Container? - FASTBOOL bIsContainerSlot = pSlot->IsMode(SFX_SLOT_CONTAINER); - FASTBOOL bIsInPlace = pImp->pFrame && pImp->pFrame->GetObjectShell()->IsInPlaceActive(); + bool bIsContainerSlot = pSlot->IsMode(SFX_SLOT_CONTAINER); + bool bIsInPlace = pImp->pFrame && pImp->pFrame->GetObjectShell()->IsInPlaceActive(); // Shell geh"ort zum Server? // AppDispatcher oder IPFrame-Dispatcher - FASTBOOL bIsServerShell = !pImp->pFrame || bIsInPlace; + bool bIsServerShell = !pImp->pFrame || bIsInPlace; // Nat"urlich sind ServerShell-Slots auch ausf"uhrbar, wenn sie auf // einem Container-Dispatcher ohne IPClient ausgef"uhrt werden sollen. @@ -2538,7 +2475,7 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot ) // Shell geh"ort zum Container? // AppDispatcher oder kein IPFrameDispatcher - FASTBOOL bIsContainerShell = !pImp->pFrame || !bIsInPlace; + bool bIsContainerShell = !pImp->pFrame || !bIsInPlace; // Shell und Slot passen zusammen if ( !( ( bIsContainerSlot && bIsContainerShell ) || @@ -2592,7 +2529,7 @@ sal_Bool SfxDispatcher::_FillState { DBG_ASSERT(bFlushed, "Dispatcher not flushed after retrieving slot servers!"); if ( !bFlushed ) - return FALSE; + return sal_False; // Flush(); // Objekt ermitteln und Message an diesem Objekt aufrufen @@ -2658,10 +2595,6 @@ const SfxPoolItem* SfxDispatcher::_Execute( const SfxSlotServer &rSvr ) { Flush(); - sal_uInt16 nSlot = pSlot->GetSlotId(); - if ( SfxMacroConfig::IsMacroSlot( nSlot ) ) - SFX_APP()->GetMacroConfig()->RegisterSlotId( nSlot ); - if ( pSlot->IsMode(SFX_SLOT_ASYNCHRON) ) //! ignoriert rSvr { @@ -2815,8 +2748,8 @@ void SfxDispatcher::Lock( sal_Bool bLock ) pImp->bLocked = bLock; if ( !bLock ) { - USHORT nCount = pImp->aReqArr.Count(); - for ( USHORT i=0; i<nCount; i++ ) + sal_uInt16 nCount = pImp->aReqArr.Count(); + for ( sal_uInt16 i=0; i<nCount; i++ ) pImp->xPoster->Post( pImp->aReqArr[i] ); pImp->aReqArr.Remove( 0, nCount ); } @@ -2970,7 +2903,7 @@ SfxItemState SfxDispatcher::QueryState( sal_uInt16 nSlot, const SfxPoolItem* &rp return SFX_ITEM_DISABLED; } -SfxItemState SfxDispatcher::QueryState( USHORT nSID, ::com::sun::star::uno::Any& rAny ) +SfxItemState SfxDispatcher::QueryState( sal_uInt16 nSID, ::com::sun::star::uno::Any& rAny ) { SfxShell *pShell = 0; const SfxSlot *pSlot = 0; @@ -2986,12 +2919,12 @@ SfxItemState SfxDispatcher::QueryState( USHORT nSID, ::com::sun::star::uno::Any& ::com::sun::star::uno::Any aState; if ( !pItem->ISA(SfxVoidItem) ) { - USHORT nSubId( 0 ); + sal_uInt16 nSubId( 0 ); SfxItemPool& rPool = pShell->GetPool(); - USHORT nWhich = rPool.GetWhich( nSID ); + sal_uInt16 nWhich = rPool.GetWhich( nSID ); if ( rPool.GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ) nSubId |= CONVERT_TWIPS; - pItem->QueryValue( aState, (BYTE)nSubId ); + pItem->QueryValue( aState, (sal_uInt8)nSubId ); } rAny = aState; diff --git a/sfx2/source/control/macrconf.cxx b/sfx2/source/control/macrconf.cxx deleted file mode 100644 index 079c7180ac1a..000000000000 --- a/sfx2/source/control/macrconf.cxx +++ /dev/null @@ -1,874 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sfx2.hxx" -#include <basic/sbstar.hxx> -#include <basic/basmgr.hxx> -#ifndef _SBX_HXX //autogen -#include <basic/sbx.hxx> -#endif -#include <svl/intitem.hxx> -#include <basic/sbmeth.hxx> -#include <basic/sbmod.hxx> -#ifndef _BASIC_SBUNO_HXX -#include <basic/sbuno.hxx> -#endif - -#include <osl/mutex.hxx> - -#include <com/sun/star/script/XEngine.hpp> -#include <com/sun/star/document/MacroExecMode.hpp> - -#ifndef GCC -#endif - -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX -#include <comphelper/processfactory.hxx> -#endif -#include <unotools/intlwrapper.hxx> - -#include <sfx2/msgpool.hxx> -#include <sfx2/macrconf.hxx> -#include "sfxbasic.hxx" -#include <sfx2/sfx.hrc> -#include <sfx2/app.hxx> -#include <sfx2/objsh.hxx> -#include <sfx2/dispatch.hxx> -#include "sfx2/minfitem.hxx" -#include "sfx2/imgmgr.hxx" -#include <sfx2/evntconf.hxx> -#include <sfx2/docfile.hxx> -#include <sfx2/genlink.hxx> -#include <sfx2/viewfrm.hxx> -#include <appdata.hxx> -#include "objshimp.hxx" -#include <sfx2/request.hxx> - -static const sal_uInt16 nCompatVersion = 2; -static const sal_uInt16 nVersion = 3; - -// Static member -SfxMacroConfig* SfxMacroConfig::pMacroConfig = NULL; - -SfxMacroConfig* SfxMacroConfig::GetOrCreate() -{ - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if ( !pMacroConfig ) - pMacroConfig = new SfxMacroConfig; - return pMacroConfig; -} - -void SfxMacroConfig::Release_Impl() -{ - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - DELETEZ( pMacroConfig ); -} - -//========================================================================== - -struct SfxMacroConfig_Impl -{ - SfxMacroInfoArr_Impl aArr; - sal_uInt32 nEventId; - sal_Bool bWaitingForCallback; - - SfxMacroConfig_Impl() - : nEventId( 0 ) - , bWaitingForCallback( sal_False ) - {} -}; - -//========================================================================== - -SbMethod* SfxQueryMacro_Impl( BasicManager* pMgr , const String& rMacro, - const String &rLibName, const String& rModule ) -{ - IntlWrapper aIntlWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); - const CollatorWrapper* pCollator = aIntlWrapper.getCollator(); - sal_uInt16 nLibCount = pMgr->GetLibCount(); - for ( sal_uInt16 nLib = 0; nLib < nLibCount; ++nLib ) - { - if ( COMPARE_EQUAL == pCollator->compareString( pMgr->GetLibName( nLib ), rLibName ) ) - { - StarBASIC* pLib = pMgr->GetLib( nLib ); - if( !pLib ) - { - pMgr->LoadLib( nLib ); - pLib = pMgr->GetLib( nLib ); - } - - if( pLib ) - { - sal_uInt16 nModCount = pLib->GetModules()->Count(); - for( sal_uInt16 nMod = 0; nMod < nModCount; ++nMod ) - { - SbModule* pMod = (SbModule*)pLib->GetModules()->Get( nMod ); - if ( pMod && COMPARE_EQUAL == pCollator->compareString( pMod->GetName(), rModule ) ) - { - SbMethod* pMethod = (SbMethod*)pMod->Find( rMacro, SbxCLASS_METHOD ); - if( pMethod ) - return pMethod; - } - } - } - } - } - return 0; -} - -SbMethod* SfxQueryMacro( BasicManager* pMgr , const String& rMacro ) -{ - sal_uInt16 nLast = 0; - String aMacro = rMacro; - String aLibName = aMacro.GetToken( 0, '.', nLast ); - String aModule = aMacro.GetToken( 0, '.', nLast ); - aMacro.Erase( 0, nLast ); - - return SfxQueryMacro_Impl( pMgr, aMacro, aLibName, aModule ); -} - -ErrCode SfxCallMacro( BasicManager* pMgr, const String& rCode, - SbxArray *pArgs, SbxValue *pRet ) -{ - ErrCode nErr; - SfxApplication *pApp = SFX_APP(); - pApp->EnterBasicCall(); - SbMethod* pMethod = SfxQueryMacro( pMgr, rCode ); - if ( pMethod ) - { - if ( pArgs ) - pMethod->SetParameters( pArgs ); - nErr = pMethod->Call( pRet ); - } - else - nErr = ERRCODE_BASIC_PROC_UNDEFINED; - - pApp->LeaveBasicCall(); - return nErr; -} - -//========================================================================== - -SfxMacroInfo::SfxMacroInfo( const String& rURL ) : - pHelpText(0), - nRefCnt(0), - bAppBasic(TRUE), - nSlotId(0), - pSlot(0) -{ - if ( rURL.CompareToAscii( "macro:", 6 ) == COMPARE_EQUAL ) - { - String aTmp = rURL.Copy( 6 ); - if ( aTmp.GetTokenCount('/') > 3 ) - { - // 'macro:///lib.mod.proc(args)' => Macro via App-BASIC-Mgr - // 'macro://[docname|.]/lib.mod.proc(args)' => Macro via zugehoerigen Doc-BASIC-Mgr - if ( aTmp.CompareToAscii("///", 3 ) != COMPARE_EQUAL ) - bAppBasic = FALSE; - aTmp = rURL.GetToken( 3, '/' ); - if ( aTmp.GetTokenCount('.') == 3 ) - { - aLibName = aTmp.GetToken( 0, '.' ); - aModuleName = aTmp.GetToken( 1, '.' ); - aMethodName = aTmp.GetToken( 2, '.' ); - - // Remove arguments to be compatible - aMethodName.SearchAndReplaceAscii( "()", String(), sal::static_int_cast< xub_StrLen >(std::max( aMethodName.Len()-2, 0 ))); - } - } - - DBG_ASSERT( aLibName.Len() && aModuleName.Len() && aMethodName.Len(), "Wrong macro URL!" ); - } - else - aMethodName = rURL; -} - -SfxMacroInfo::SfxMacroInfo( bool _bAppBasic ) : - pHelpText(0), - nRefCnt(0), - bAppBasic(_bAppBasic), - nSlotId(0), - pSlot(0) -{} - -//========================================================================== - -SfxMacroInfo::SfxMacroInfo(bool _bAppBasic, const String& rLibName, - const String& rModuleName, const String& rMethodName) : - pHelpText(0), - nRefCnt(0), - bAppBasic(_bAppBasic), - aLibName(rLibName), - aModuleName(rModuleName), - aMethodName(rMethodName), - nSlotId(0), - pSlot(0) -{ -} - -//========================================================================== - -SfxMacroInfo::SfxMacroInfo(bool _bAppBasic, const String& rQualifiedName ) -: pHelpText(0), - nRefCnt(0), - bAppBasic(_bAppBasic), - nSlotId(0), - pSlot(0) -{ - sal_uInt16 nCount = rQualifiedName.GetTokenCount('.'); - aMethodName = rQualifiedName.GetToken( nCount-1, '.' ); - if ( nCount > 1 ) - aModuleName = rQualifiedName.GetToken( nCount-2, '.' ); - if ( nCount > 2 ) - aLibName = rQualifiedName.GetToken( 0, '.' ); -} - -//========================================================================== - -SfxMacroInfo::SfxMacroInfo(SfxMacroInfo& rOther) : - pHelpText(0), - nRefCnt(0), - bAppBasic(rOther.bAppBasic), - aLibName(rOther.aLibName), - aModuleName(rOther.aModuleName), - aMethodName(rOther.aMethodName), - nSlotId(rOther.nSlotId), - pSlot(0) -{} - -//========================================================================== - -SfxMacroInfo::~SfxMacroInfo() -{ - delete pSlot; - delete pHelpText; -} - -//========================================================================== - -sal_Bool SfxMacroInfo::operator==(const SfxMacroInfo& rOther) const -{ - if ( GetQualifiedName() == rOther.GetQualifiedName() && - bAppBasic == rOther.bAppBasic ) - return sal_True; - else - return sal_False; -} - -//========================================================================== - -String SfxMacroInfo::GetMacroName() const -{ - String aMacroName = aMethodName; - aMacroName += '('; - aMacroName += aLibName; - aMacroName += '.'; - aMacroName += aModuleName; - aMacroName += ')'; - return aMacroName; -} - -//========================================================================== - -String SfxMacroInfo::GetQualifiedName() const -{ - String aMacroName; - if( aMacroName.Len() || aLibName.Len() ) - { - // Altes Format - aMacroName = aLibName; - aMacroName += '.'; - aMacroName += aModuleName; - aMacroName += '.'; - } - - // Wg. ::com::sun::star::script::JavaScript kein Zerlegen des Strings mehr - aMacroName += aMethodName; - return aMacroName; -} - -String SfxMacroInfo::GetFullQualifiedName() const -{ - // Liefert nur Unsinn, wenn f"ur ein ::com::sun::star::script::JavaScript aufgerufen ! - String aRet; - if ( bAppBasic ) - aRet = SFX_APP()->GetName(); - aRet += '.'; - aRet += GetQualifiedName(); - return aRet; -} - -String SfxMacroInfo::GetURL() const -{ - if ( !aLibName.Len() ) - return aMethodName; - - // 'macro:///lib.mod.proc(args)' => Macro via App-BASIC-Mgr - // 'macro://[docname|.]/lib.mod.proc(args)' => Macro via zugehoerigen Doc-BASIC-Mgr - // 'macro://obj.method(args)' => Object via App-BASIC-Mgr - String aURL( String::CreateFromAscii("macro://") ); - if ( !bAppBasic ) - aURL += '.'; - aURL += '/'; - aURL += aLibName; - aURL += '.'; - aURL += aModuleName; - aURL += '.'; - aURL += aMethodName; - aURL += String::CreateFromAscii("()"); - - return aURL; -} - -//========================================================================== - -BasicManager* SfxMacroInfo::GetBasicManager() const -{ - if (bAppBasic) - { - return SFX_APP()->GetBasicManager(); - } - else - { - SfxObjectShell *pCurrDocShell = SfxObjectShell::Current(); - return pCurrDocShell ? pCurrDocShell->GetBasicManager() : - SFX_APP()->GetBasicManager(); - } -} - -//========================================================================== - -String SfxMacroInfo::GetBasicName() const -{ - if (bAppBasic) - { - return SFX_APP()->GetName(); - } - else - { - SfxObjectShell *pCurrDocShell = SfxObjectShell::Current(); - if ( pCurrDocShell ) - return pCurrDocShell->GetTitle(); - else - return SFX_APP()->GetName(); - } -} - -String SfxMacroInfo::GetHelpText() const -{ - if ( pHelpText ) - return *pHelpText; - return String(); -} - -String SfxMacroConfig::RequestHelp( sal_uInt16 nId ) -{ - SfxMacroInfo *pInfo = SFX_APP()->GetMacroConfig()->GetMacroInfo( nId ); - if ( !pInfo ) - return String(); - - if ( !pInfo->pHelpText ) - { - SbMethod *pMethod = - SfxQueryMacro_Impl( pInfo->GetBasicManager(), pInfo->aMethodName, - pInfo->aLibName, pInfo->aModuleName ); - if ( pMethod && pMethod->GetInfo() ) - pInfo->pHelpText = new String( pMethod->GetInfo()->GetComment() ); - } - - return pInfo->GetHelpText(); -} - -void SfxMacroInfo::SetHelpText( const String& rName ) -{ - if ( !pHelpText ) - pHelpText = new String; - *pHelpText = rName; -} - -//========================================================================== - -SvStream& operator >> (SvStream& rStream, SfxMacroInfo& rInfo) -{ - sal_uInt16 nAppBasic, nFileVersion; - String aDocName; - - rStream >> nFileVersion; - if ( nVersion < nCompatVersion ) - { - // In der 1.Version ohne Versionskennung - nAppBasic = nVersion; - nFileVersion = 1; - rStream.ReadByteString(aDocName,RTL_TEXTENCODING_UTF8); - rStream.ReadByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8); - rStream.ReadByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8); - rStream.ReadByteString(rInfo.aMethodName,RTL_TEXTENCODING_UTF8); - } - else - { - String aInput; - rStream >> nAppBasic; - rStream.ReadByteString(aDocName,RTL_TEXTENCODING_UTF8); // Vorsicht: kann bei AppName Unsinn sein! - rStream.ReadByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8); - rStream.ReadByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8); - rStream.ReadByteString(aInput,RTL_TEXTENCODING_UTF8); - - if ( nFileVersion == nCompatVersion ) - rInfo.aMethodName = aInput; - else - { - sal_uInt16 nCount = aInput.GetTokenCount('.'); - rInfo.aMethodName = aInput.GetToken( nCount-1, '.' ); - if ( nCount > 1 ) - rInfo.aModuleName = aInput.GetToken( nCount-2, '.' ); - if ( nCount > 2 ) - rInfo.aLibName = aInput.GetToken( 0, '.' ); - } - } - - rInfo.bAppBasic = (sal_Bool) nAppBasic; - return rStream; -} - -int SfxMacroInfo::Load( SvStream& rStream ) -{ - rStream >> (*this); - nSlotId = SFX_APP()->GetMacroConfig()->GetSlotId(this); - return 0; -} - -//========================================================================== - -SvStream& operator << (SvStream& rStream, const SfxMacroInfo& rInfo) -{ - if ( rInfo.bAppBasic ) - { - rStream << nVersion - << (sal_uInt16) rInfo.bAppBasic; - rStream.WriteByteString(rInfo.GetBasicName(),RTL_TEXTENCODING_UTF8); - rStream.WriteByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8); - rStream.WriteByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8); - rStream.WriteByteString(rInfo.aMethodName,RTL_TEXTENCODING_UTF8); - } - else - { - rStream << nVersion - << (sal_uInt16) rInfo.bAppBasic; - rStream.WriteByteString(SFX_APP()->GetName(),RTL_TEXTENCODING_UTF8); - rStream.WriteByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8); - rStream.WriteByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8); - rStream.WriteByteString(rInfo.aMethodName,RTL_TEXTENCODING_UTF8); - } - - return rStream; -} - -sal_Bool SfxMacroInfo::Compare( const SvxMacro& rMacro ) const -{ - String aName = rMacro.GetLibName(); - aName += '.'; - aName += rMacro.GetMacName(); - if ( GetFullQualifiedName() == aName ) - return sal_True; - return sal_False; -} - -//========================================================================== - -SfxMacroConfig::SfxMacroConfig() -{ - pImp = new SfxMacroConfig_Impl; -} - -//========================================================================== - -SfxMacroConfig::~SfxMacroConfig() -{ - if ( pImp->nEventId ) - Application::RemoveUserEvent( pImp->nEventId ); - delete pImp; -} - -//========================================================================== - -SFX_STATE_STUB( SfxApplication, MacroState_Impl ) -SFX_EXEC_STUB( SfxApplication, MacroExec_Impl ) - -sal_uInt16 SfxMacroConfig::GetSlotId(SfxMacroInfoPtr pInfo) -{ - sal_uInt16 nCount = pImp->aArr.Count(); // Macro suchen - sal_uInt16 i; - for (i=0; i<nCount; i++) - if ((*(pImp->aArr)[i]) == (*pInfo)) - break; - - if (i == nCount) - { // Macro noch unbekannt - nCount = aIdArray.Count(); - sal_uInt16 n; - for (n=0; n<nCount; n++) // freie SlotId suchen - if (aIdArray[n] > SID_MACRO_START + n) - break; - - sal_uInt16 nNewSlotId = SID_MACRO_START + n; - if ( nNewSlotId > SID_MACRO_END ) - return 0; - aIdArray.Insert( SID_MACRO_START + n, n ); - - SfxSlot *pNewSlot = new SfxSlot; - pNewSlot->nSlotId = SID_MACRO_START + n; - pNewSlot->nGroupId = 0; - pNewSlot->nFlags = SFX_SLOT_ASYNCHRON; - pNewSlot->nMasterSlotId = 0; - pNewSlot->nValue = 0; - pNewSlot->fnExec = SFX_STUB_PTR(SfxApplication,MacroExec_Impl); - pNewSlot->fnState = SFX_STUB_PTR(SfxApplication,MacroState_Impl); - pNewSlot->pType = 0; HACK(SFX_TYPE(SfxVoidItem)) - pNewSlot->pName = pNewSlot->pMethodName = U2S(pInfo->aMethodName).getStr(); - pNewSlot->pLinkedSlot = 0; - pNewSlot->nArgDefCount = 0; - pNewSlot->pFirstArgDef = 0; - pNewSlot->pUnoName = 0; - - if (nCount) - { - SfxSlot *pSlot = (pImp->aArr)[0]->pSlot; - pNewSlot->pNextSlot = pSlot->pNextSlot; - pSlot->pNextSlot = pNewSlot; - } - else - pNewSlot->pNextSlot = pNewSlot; - - // Macro uebernehmen - SfxMacroInfoPtr pNewInfo = new SfxMacroInfo(*pInfo); - pNewInfo->nSlotId = SID_MACRO_START + n; - pImp->aArr.Insert(pNewInfo,n); - pNewInfo->pSlot = pNewSlot; - pInfo->nSlotId = pNewInfo->nSlotId; - pNewInfo->nRefCnt++; - } - else - { - pInfo->nSlotId = (pImp->aArr)[i]->nSlotId; - (pImp->aArr)[i]->nRefCnt++; - } - - return pInfo->nSlotId; -} - -//========================================================================== - -void SfxMacroConfig::ReleaseSlotId(sal_uInt16 nId) -{ - DBG_ASSERT( IsMacroSlot( nId ), "SlotId ist kein Macro!"); - - sal_uInt16 nCount = pImp->aArr.Count(); - for (sal_uInt16 i=0; i<nCount; i++) - { - SfxMacroInfo *pInfo = (pImp->aArr)[i]; - if (pInfo->nSlotId == nId) - { - pInfo->nRefCnt--; - if (pInfo->nRefCnt == 0) - { - // Slot wird nicht mehr referenziert, also holen - SfxSlot *pSlot = pInfo->pSlot; - - // Slot aus der Verkettung rausnehmen - while (pSlot->pNextSlot != pInfo->pSlot) - pSlot = (SfxSlot*) pSlot->pNextSlot; - pSlot->pNextSlot = pInfo->pSlot->pNextSlot; - - // Slot selbst kurz schlie\sen - pSlot = pInfo->pSlot; - pSlot->pNextSlot = pSlot; - - // MacroInfo aus Array entfernen, damit sie kein Unheil - // anrichten kann - pImp->aArr.Remove(i); - - // SlotId wieder freigeben - sal_uInt16 nIdCount = aIdArray.Count(); - for (sal_uInt16 n=0; n<nIdCount; n++) - { - if (aIdArray[n] == nId) - { - aIdArray.Remove(n); - break; - } - } - - // Sofern nicht die Applikation heruntergefahren wird, mu\s - // der Slot asynchron gel"oscht werden, falls er in seinem - // eigenen Execute abgeschossen wird! - if ( !SFX_APP()->Get_Impl()->bInQuit ) - pImp->nEventId = Application::PostUserEvent( LINK(this, SfxMacroConfig, EventHdl_Impl), pInfo ); - else - EventHdl_Impl( pInfo ); - } - return; - } - } - - DBG_ERROR("Macro-SlotId nicht gefunden!"); -} - -//========================================================================== - -void SfxMacroConfig::RegisterSlotId(sal_uInt16 nId) -{ - DBG_ASSERT( IsMacroSlot( nId ), "SlotId ist kein Macro!"); - - sal_uInt16 nCount = pImp->aArr.Count(); - for (sal_uInt16 i=0; i<nCount; i++) - { - if ((pImp->aArr)[i]->nSlotId == nId) - { - (pImp->aArr)[i]->nRefCnt++; - return; - } - } - - DBG_ERROR("Macro-SlotId nicht gefunden!"); -} - -//========================================================================== - -SfxMacroInfo* SfxMacroConfig::GetMacroInfo(sal_uInt16 nId) const -{ - sal_uInt16 nCount = pImp->aArr.Count(); - for (sal_uInt16 i=0; i<nCount; i++) - if ((pImp->aArr)[i]->nSlotId == nId) - return (pImp->aArr)[i]; - - return 0; -} - -//========================================================================== - -const SfxMacroInfo* SfxMacroConfig::GetMacroInfo_Impl( const SvxMacro *pMacro ) const -{ - sal_uInt16 nCount = pImp->aArr.Count(); - for (sal_uInt16 i=0; i<nCount; i++) - if ((pImp->aArr)[i]->Compare(*pMacro) ) - return (pImp->aArr)[i]; - return 0; -} - -//========================================================================== - -sal_Bool SfxMacroConfig::ExecuteMacro( sal_uInt16 nId, const String& rArgs ) const -{ - const SfxMacroInfo* pInfo = GetMacroInfo( nId ); - if ( !pInfo ) - return sal_False; - - SfxObjectShell* pSh = SfxObjectShell::Current(); - - SvxMacro aMacro( pInfo->GetQualifiedName(), pInfo->GetBasicName(), STARBASIC ); - sal_Bool bRet = ExecuteMacro( pSh, &aMacro, rArgs ); - - // Release, da im Dispatcher-Execute ein Register gemacht wurde - ((SfxMacroConfig*)this)->ReleaseSlotId( nId ); - return bRet; -} - -sal_Bool SfxMacroConfig::ExecuteMacro( SfxObjectShell *pSh, const SvxMacro* pMacro, const String& /*rArgs*/ ) const -{ - SfxApplication *pApp = SFX_APP(); - - // Name des Macros oder Scripts bzw. ScriptCode - String aCode( pMacro->GetMacName() ); - ErrCode nErr = ERRCODE_NONE; - - // Ist es ein Basic-Macro ? - ScriptType eSType = pMacro->GetScriptType(); - sal_Bool bIsBasic = eSType == STARBASIC; - sal_Bool bIsStarScript = ( eSType == EXTENDED_STYPE && pMacro->GetLibName().SearchAscii( "StarScript" ) != STRING_NOTFOUND ); - sal_Bool bIsBasicLibBased = bIsBasic || bIsStarScript || !pSh; - - if ( bIsBasicLibBased ) - { - pApp->EnterBasicCall(); - BasicManager *pAppMgr = SFX_APP()->GetBasicManager(); - if( bIsBasic ) - { - // BasicManager von Document? - BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL; - - // Da leider der Name zwischendurch h"aufig gewechselt hat ... - if( SFX_APP()->GetName() == pMacro->GetLibName() || - pMacro->GetLibName().EqualsAscii("StarDesktop") ) - pMgr = pAppMgr; - else if ( pMgr == pAppMgr ) - pMgr = NULL; - - if ( pSh && pMgr && pMgr != pAppMgr ) - { - if ( !pSh->AdjustMacroMode( String() ) ) - return sal_False; - } - - if ( pSh && pMgr && pMgr == pAppMgr ) - { - ::com::sun::star::uno::Any aOldThisComponent = pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( pSh->GetModel() ) ); - nErr = Call( 0, aCode, pMgr ); - pAppMgr->SetGlobalUNOConstant( "ThisComponent", aOldThisComponent ); - } - else if ( pMgr ) - nErr = Call( 0, aCode, pMgr ); - else - nErr = SbxERR_NO_METHOD; - - } - - pApp->LeaveBasicCall(); - } - else - { - nErr = SbxERR_NO_METHOD; - } - - return ( nErr == ERRCODE_NONE ); -} - -sal_Bool SfxMacroConfig::CheckMacro( SfxObjectShell *pSh, const SvxMacro* pMacro ) const -{ - SfxApplication *pApp = SFX_APP(); - - // Name des Macros oder Scripts bzw. ScriptCode - String aCode( pMacro->GetMacName() ); - ErrCode nErr = ERRCODE_NONE; - - // BasicManager von Document oder Application - pApp->EnterBasicCall(); - BasicManager *pAppMgr = SFX_APP()->GetBasicManager(); - BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL; - - // Da leider der Name zwischendurch h"aufig gewechselt hat ... - if( SFX_APP()->GetName() == pMacro->GetLibName() || - pMacro->GetLibName().EqualsAscii("StarDesktop") ) - pMgr = pAppMgr; - else if ( pMgr == pAppMgr ) - pMgr = NULL; - - if ( !pMgr || !SfxQueryMacro( pMgr, aCode ) ) - nErr = SbxERR_NO_METHOD; - pApp->LeaveBasicCall(); - return ( nErr == ERRCODE_NONE ); -} - -//========================================================================== - -sal_Bool SfxMacroConfig::CheckMacro( sal_uInt16 nId ) const -{ - const SfxMacroInfo* pInfo = GetMacroInfo( nId ); - if ( !pInfo ) - return sal_False; - - // Basic nur initialisieren, wenn default nicht ::com::sun::star::script::JavaScript; dann mu\s - // in IsBasic() sowieso das Basic angelegt werden - SfxObjectShell* pSh = SfxObjectShell::Current(); - - SfxApplication *pApp = SFX_APP(); - pApp->EnterBasicCall(); - - // BasicManager von Document oder Application - BasicManager *pAppMgr = SFX_APP()->GetBasicManager(); - BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL; - - if( SFX_APP()->GetName() == pInfo->GetBasicName() ) - pMgr = SFX_APP()->GetBasicManager(); - else if ( pMgr == pAppMgr ) - pMgr = NULL; - - String aFull( pInfo->GetQualifiedName() ); - sal_Bool bIsBasic = pMgr ? IsBasic( 0, aFull, pMgr ) : sal_False; - pApp->LeaveBasicCall(); - return bIsBasic; -} - -//========================================================================== - -IMPL_LINK( SfxMacroConfig, CallbackHdl_Impl, SfxMacroConfig*, pConfig ) -{ - (void)pConfig; // unused - pImp->bWaitingForCallback = sal_False; - return 0; -} - -IMPL_LINK( SfxMacroConfig, EventHdl_Impl, SfxMacroInfo*, pInfo ) -{ - delete pInfo; - pImp->nEventId = 0; - return 0; -} - -sal_Bool SfxMacroConfig::IsBasic( - SbxObject* /*pVCtrl*/, - const String& rCode, - BasicManager* pMgr ) -{ - sal_Bool bFound; - SFX_APP()->EnterBasicCall(); - bFound = SfxQueryMacro( pMgr, rCode ) != 0; - SFX_APP()->LeaveBasicCall(); - return bFound; -} - -ErrCode SfxMacroConfig::Call( - SbxObject* /*pVCtrl*/, - const String& rCode, - BasicManager* pMgr, - SbxArray *pArgs, - SbxValue *pRet ) -{ - SfxApplication *pApp = SFX_APP(); - pApp->EnterBasicCall(); - SbMethod* pMethod = SfxQueryMacro( pMgr, rCode ); - ErrCode nErr = 0; - if( pMethod ) - { - if ( pArgs ) - pMethod->SetParameters( pArgs ); - nErr = pMethod->Call( pRet ); - } - else - nErr = ERRCODE_BASIC_PROC_UNDEFINED; - - pApp->LeaveBasicCall(); - return nErr; -} - - -sal_Bool SfxMacroConfig::IsMacroSlot( sal_uInt16 nId ) -{ - return ( nId >= SID_MACRO_START && nId <= SID_MACRO_END ); -} - - diff --git a/sfx2/source/control/macro.cxx b/sfx2/source/control/macro.cxx index 04a820d8e0ac..87879656021e 100644 --- a/sfx2/source/control/macro.cxx +++ b/sfx2/source/control/macro.cxx @@ -62,9 +62,9 @@ SfxMacroStatement::SfxMacroStatement ( const SfxShell& /*rShell*/, // <SfxShell>, die den Request ausf"uhrte const String& /*rTarget*/, // Name des Zielobjektes vor der Ausf"urhung - BOOL /*bAbsolute*/, // obsolet + sal_Bool /*bAbsolute*/, // obsolet const SfxSlot& rSlot, // der <SfxSlot>, der das Statement abspielen kann - BOOL bRequestDone, // wurde der Request tats"achlich ausgef"uhrt + sal_Bool bRequestDone, // wurde der Request tats"achlich ausgef"uhrt ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& rArgs ) @@ -91,7 +91,7 @@ SfxMacroStatement::SfxMacroStatement die Selektion auch deskriptiv z.B. als 'CellSelection("A5-D8")') angesprochen werden, dazu mu\ jedoch vom Anwendungsprogrammierer der Konstruktor <SfxMacroStatement::SfxMacroStatement(const String&, - const SfxSlot&,BOOL,SfxArguments*)> verwendet werden. + const SfxSlot&,sal_Bool,SfxArguments*)> verwendet werden. F"ur das so bezeichnete Objekt wird dann je nach Typ des Slots eine Zuweisung an eines seiner Properties oder der Aufruf einer seiner @@ -112,7 +112,7 @@ SfxMacroStatement::SfxMacroStatement [Querverweise] - <SfxMacroStatement::SfxMacroStatement(const String&,const SfxSlot&,BOOL,SfxArguments*)> + <SfxMacroStatement::SfxMacroStatement(const String&,const SfxSlot&,sal_Bool,SfxArguments*)> <SfxMacroStatement::SfxMacroStatement(const String&)> */ @@ -126,11 +126,11 @@ SfxMacroStatement::SfxMacroStatement return; /* // Objekt-Typ bestimmen - FASTBOOL bIsApp = rShell.ISA(SfxApplication); - FASTBOOL bIsDoc = rShell.ISA(SfxObjectShell); - FASTBOOL bIsWin = !bIsApp && !bIsDoc && + bool bIsApp = rShell.ISA(SfxApplication); + bool bIsDoc = rShell.ISA(SfxObjectShell); + bool bIsWin = !bIsApp && !bIsDoc && ( rShell.ISA(SfxViewShell) || rShell.ISA(SfxViewFrame) ); - FASTBOOL bIsSel = !bIsApp && !bIsDoc && !bIsWin; + bool bIsSel = !bIsApp && !bIsDoc && !bIsWin; // Objekt nicht schon im Slot-Namen enthalten? if ( bIsSel || rSlot.pName[0] == '.' ) @@ -229,7 +229,7 @@ SfxMacroStatement::SfxMacroStatement ( const String& rTarget, // Objekt, was beim Playing angesprochen wird const SfxSlot& rSlot, // der <SfxSlot>, der das Statement abspielen kann - BOOL bRequestDone, // wurde der Request tats"achlich ausgef"uhrt + sal_Bool bRequestDone, // wurde der Request tats"achlich ausgef"uhrt ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& rArgs ) @@ -239,7 +239,7 @@ SfxMacroStatement::SfxMacroStatement [Querverweise] <SfxMacroStatement::SfxMacroStatement(const String&)> - <SfxMacroStatement::SfxMacroStatement(const SfxShell&,BOOL,const SfxSlot&,BOOL,SfxArguments*)> + <SfxMacroStatement::SfxMacroStatement(const SfxShell&,sal_Bool,const SfxSlot&,sal_Bool,SfxArguments*)> */ : nSlotId( rSlot.GetSlotId() ), @@ -270,13 +270,13 @@ SfxMacroStatement::SfxMacroStatement [Querverweise] - <SfxMacroStatement::SfxMacroStatement(const String&,const SfxSlot&,BOOL,SfxArguments*)> - <SfxMacroStatement::SfxMacroStatement(const SfxShell&,BOOL,const SfxSlot&,BOOL,SfxArguments*)> + <SfxMacroStatement::SfxMacroStatement(const String&,const SfxSlot&,sal_Bool,SfxArguments*)> + <SfxMacroStatement::SfxMacroStatement(const SfxShell&,sal_Bool,const SfxSlot&,sal_Bool,SfxArguments*)> */ : nSlotId( 0 ), aStatement( rStatement ), - bDone( TRUE ), + bDone( sal_True ), pDummy( 0 ) { } @@ -320,7 +320,7 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl ( SfxMacro* /*pMacro*/, // darin wird aufgezeichnet const SfxSlot& rSlot, // der Slot, der das Statement abspielen kann - BOOL bRequestDone, // TRUE=wurde ausgef"uhrt, FALSE=abgebrochen + sal_Bool bRequestDone, // sal_True=wurde ausgef"uhrt, sal_False=abgebrochen ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& /*rArgs*/ ) @@ -346,7 +346,7 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl // alle zusammengesuchten Parameter rausschreiben if ( aArgs.getLength() ) - for ( USHORT nArg = 0; nArg < aArgs.getLength(); ++nArg ) + for ( sal_uInt16 nArg = 0; nArg < aArgs.getLength(); ++nArg ) { // den Parameter textuell darstellen String aArg; @@ -377,8 +377,8 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl // Anf"uhrungszeichen werden verdoppelt XubString aRecordable( sTemp ); - USHORT nPos = 0; - while ( TRUE ) + sal_uInt16 nPos = 0; + while ( sal_True ) { nPos = aRecordable.SearchAndReplace( DEFINE_CONST_UNICODE('"'), DEFINE_CONST_UNICODE("\"\""), nPos ); if ( STRING_NOTFOUND == nPos ) @@ -387,8 +387,8 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl } // nicht druckbare Zeichen werden als chr$(...) geschrieben - FASTBOOL bPrevReplaced = FALSE; - for ( USHORT n = 0; n < aRecordable.Len(); ++n ) + bool bPrevReplaced = sal_False; + for ( sal_uInt16 n = 0; n < aRecordable.Len(); ++n ) { sal_Unicode cChar = aRecordable.GetChar(n); if ( !( cChar>=32 && cChar!=127 ) ) // ALS ERSATZ FUER String::IsPrintable()! @@ -411,10 +411,10 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl aRecordable.Insert( aReplacement, n + 1 ); n = n + aReplacement.Len(); } - bPrevReplaced = TRUE; + bPrevReplaced = sal_True; } else - bPrevReplaced = FALSE; + bPrevReplaced = sal_False; // Argument in Anf"uhrungszeichen aArg = '"'; @@ -425,7 +425,7 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl case SbxBYTE: { // als Zahl darstellen - aArg = (USHORT) rVar.GetByte(); + aArg = (sal_uInt16) rVar.GetByte(); break; } */ @@ -696,7 +696,7 @@ String SfxMacro::GenerateSource() const { DBG_ASSERT( pImp->eMode != SFX_MACRO_EXISTING, "invalid call to non-recording SfxMacro" ); String aSource; - for ( USHORT n = 0; n < pImp->aList.Count(); ++n ) + for ( sal_uInt16 n = 0; n < pImp->aList.Count(); ++n ) { aSource += pImp->aList.GetObject(n)->GetStatement(); if ( (n+1) < pImp->aList.Count() ) diff --git a/sfx2/source/control/minfitem.cxx b/sfx2/source/control/minfitem.cxx index b0cdd58d2645..c5e46620a908 100644 --- a/sfx2/source/control/minfitem.cxx +++ b/sfx2/source/control/minfitem.cxx @@ -39,7 +39,7 @@ TYPEINIT1(SfxMacroInfoItem, SfxPoolItem); // ----------------------------------------------------------------------- SfxMacroInfoItem::SfxMacroInfoItem( - USHORT nWhichId, // Slot-ID + sal_uInt16 nWhichId, // Slot-ID const BasicManager* pMgr, const String &rLibName, const String &rModuleName, diff --git a/sfx2/source/control/msg.cxx b/sfx2/source/control/msg.cxx index 6b05c03160ff..ffedd2632770 100644 --- a/sfx2/source/control/msg.cxx +++ b/sfx2/source/control/msg.cxx @@ -53,7 +53,7 @@ SfxSlotKind SfxSlot::GetKind() const //-------------------------------------------------------------------- -USHORT SfxSlot::GetWhich( const SfxItemPool &rPool ) const +sal_uInt16 SfxSlot::GetWhich( const SfxItemPool &rPool ) const { if ( !nMasterSlotId || nMasterSlotId == USHRT_MAX ) ((SfxSlot*) this) -> nMasterSlotId = rPool.GetWhich(nSlotId); diff --git a/sfx2/source/control/msgpool.cxx b/sfx2/source/control/msgpool.cxx index 10359ba20f73..9cda943c8509 100644 --- a/sfx2/source/control/msgpool.cxx +++ b/sfx2/source/control/msgpool.cxx @@ -40,7 +40,6 @@ #include <sfx2/app.hxx> #include <sfx2/objface.hxx> #include "sfxtypes.hxx" -#include <sfx2/macrconf.hxx> #include "sfx2/sfxresid.hxx" #include "arrdecl.hxx" #include <sfx2/module.hxx> @@ -53,20 +52,20 @@ struct SfxSIDRegistration_Impl { String _aGroup; String _aName; - USHORT _nSID; + sal_uInt16 _nSID; }; 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) @@ -99,7 +98,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; } @@ -132,14 +131,14 @@ void SfxSlotPool::RegisterInterface( SfxInterface& rInterface ) { // Die Groups im parent Slotpool sind auch hier bekannt 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 && */ @@ -154,7 +153,7 @@ void SfxSlotPool::RegisterInterface( SfxInterface& rInterface ) const TypeId &rTypeId = pDef->GetType()->Type(); if ( /*rTypeId != TYPE(SfxVoidItem) &&*/ rTypeId != 0 ) { - USHORT nPos; + sal_uInt16 nPos; for ( nPos = 0; nPos < _pTypes->Count(); ++nPos ) { if ( _pTypes->GetObject(nPos)->nId == pDef->GetSlotId() ) @@ -175,12 +174,12 @@ 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; /* - for ( USHORT nPos = 0; nPos < _pTypes->Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < _pTypes->Count(); ++nPos ) { if ( _pTypes->GetObject(nPos)->nId == nId ) return _pTypes->GetObject(nPos)->nType; @@ -205,13 +204,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" ); // Zun"achst die eigenen Interfaces absuchen - 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 ) @@ -226,7 +225,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" ); @@ -238,7 +237,7 @@ String SfxSlotPool::SeekGroup( USHORT nNo ) if ( _pParentPool ) { // Meistens stimmt die Reihenfolge der Ids "uberein - USHORT nParentCount = _pParentPool->_pGroups->Count(); + sal_uInt16 nParentCount = _pParentPool->_pGroups->Count(); if ( nNo < nParentCount && (*_pGroups)[nNo] == (*_pParentPool->_pGroups)[nNo] ) _pParentPool->_nCurGroup = nNo; else @@ -246,7 +245,7 @@ String SfxSlotPool::SeekGroup( USHORT nNo ) // Ansonsten mu\s gesucht werden // Wenn die Gruppe im parent pool nicht gefunden wird, wird // _nCurGroup au\serhalb des g"ultigen Bereiches gesetzt - USHORT i; + sal_uInt16 i; for ( i=1; i<nParentCount; i++ ) if ( (*_pGroups)[nNo] == (*_pParentPool->_pGroups)[i] ) break; @@ -271,7 +270,7 @@ String SfxSlotPool::SeekGroup( USHORT nNo ) //-------------------------------------------------------------------- -USHORT SfxSlotPool::GetGroupCount() +sal_uInt16 SfxSlotPool::GetGroupCount() { return _pGroups->Count(); } @@ -281,13 +280,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" ); // Die Numerierung der interfaces startet beim parent pool - USHORT nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0; + sal_uInt16 nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0; // sind wir am Ende des Parent-Pools angekommen? if ( nStartInterface < nFirstInterface && @@ -303,7 +302,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 ) @@ -332,7 +331,7 @@ const SfxSlot* SfxSlotPool::NextSlot() DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" ); // Die Numerierung der interfaces startet beim 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; @@ -349,7 +348,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; @@ -387,17 +386,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 ) diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx index d0ce2abae773..f73a7f4acf4b 100644 --- a/sfx2/source/control/objface.cxx +++ b/sfx2/source/control/objface.cxx @@ -69,18 +69,18 @@ SfxCompareSlots_Impl( const void* pSmaller, const void* pBigger ) struct SfxObjectUI_Impl { - USHORT nPos; + sal_uInt16 nPos; ResId aResId; - BOOL bVisible; - BOOL bContext; + sal_Bool bVisible; + sal_Bool bContext; String* pName; sal_uInt32 nFeature; - SfxObjectUI_Impl(USHORT n, const ResId& rResId, BOOL bVis, sal_uInt32 nFeat) : + SfxObjectUI_Impl(sal_uInt16 n, const ResId& rResId, sal_Bool bVis, sal_uInt32 nFeat) : nPos(n), aResId(rResId.GetId(), *rResId.GetResMgr()), bVisible(bVis), - bContext(FALSE), + bContext(sal_False), pName(0), nFeature(nFeat) { @@ -102,12 +102,12 @@ struct SfxInterface_Impl ResId aPopupRes; // registered PopupMenu ResId aStatBarRes; // registered StatusBar SfxModule* pModule; - BOOL bRegistered; + sal_Bool bRegistered; SfxInterface_Impl() : aPopupRes(0,*SfxApplication::GetOrCreate()->GetSfxResManager()), aStatBarRes(0,*SfxApplication::GetOrCreate()->GetSfxResManager()) - , bRegistered(FALSE) + , bRegistered(sal_False) { pObjectBars = new SfxObjectUIArr_Impl; pChildWindows = new SfxObjectUIArr_Impl; @@ -115,7 +115,7 @@ struct SfxInterface_Impl ~SfxInterface_Impl() { - USHORT n; + sal_uInt16 n; for (n=0; n<pObjectBars->Count(); n++) delete (*pObjectBars)[n]; delete pObjectBars; @@ -126,7 +126,7 @@ struct SfxInterface_Impl } }; -static SfxObjectUI_Impl* CreateObjectBarUI_Impl( USHORT nPos, const ResId& rResId, sal_uInt32 nFeature, const String *pStr ); +static SfxObjectUI_Impl* CreateObjectBarUI_Impl( sal_uInt16 nPos, const ResId& rResId, sal_uInt32 nFeature, const String *pStr ); //==================================================================== @@ -137,7 +137,7 @@ SfxInterface::SfxInterface( const char *pClassName, const ResId& rNameResId, SfxInterfaceId nId, const SfxInterface* pParent, - SfxSlot &rSlotMap, USHORT nSlotCount ): + SfxSlot &rSlotMap, sal_uInt16 nSlotCount ): pName(pClassName), pGenoType(pParent), nClassId(nId), @@ -150,7 +150,7 @@ SfxInterface::SfxInterface( const char *pClassName, void SfxInterface::Register( SfxModule* pMod ) { - pImpData->bRegistered = TRUE; + pImpData->bRegistered = sal_True; pImpData->pModule = pMod; if ( pMod ) pMod->GetSlotPool()->RegisterInterface(*this); @@ -158,7 +158,7 @@ void SfxInterface::Register( SfxModule* pMod ) SFX_APP()->GetAppSlotPool_Impl().RegisterInterface(*this); } -void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) +void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount ) { pSlots = &rSlotMap; nCount = nSlotCount; @@ -172,7 +172,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) qsort( pSlots, nCount, sizeof(SfxSlot), SfxCompareSlots_Impl ); // link masters and slaves - USHORT nIter = 1; + sal_uInt16 nIter = 1; for ( pIter = pSlots; nIter <= nCount; ++pIter, ++nIter ) { //! hier bitte sinnvoll pruefen @@ -196,7 +196,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) if ( 0 == pIter->GetNextSlot() ) { SfxSlot *pLastSlot = pIter; - for ( USHORT n = nIter; n < Count(); ++n ) + for ( sal_uInt16 n = nIter; n < Count(); ++n ) { SfxSlot *pCurSlot = (pSlots+n); if ( pCurSlot->nMasterSlotId == pIter->nMasterSlotId ) @@ -212,7 +212,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) { // Slots verweisen im Ring auf den n"achten mit derselben Statusmethode SfxSlot *pLastSlot = pIter; - for ( USHORT n = nIter; n < Count(); ++n ) + for ( sal_uInt16 n = nIter; n < Count(); ++n ) { SfxSlot *pCurSlot = (pSlots+n); if ( pCurSlot->GetStateFnc() == pIter->GetStateFnc() ) @@ -228,7 +228,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) #ifdef DBG_UTIL else { - USHORT nIter = 1; + sal_uInt16 nIter = 1; for ( SfxSlot *pNext = pIter+1; nIter < nCount; ++pNext, ++nIter ) { @@ -308,7 +308,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) SfxInterface::~SfxInterface() { SfxModule *pMod = pImpData->pModule; - BOOL bRegistered = pImpData->bRegistered; + sal_Bool bRegistered = pImpData->bRegistered; delete pImpData; DBG_ASSERT( bRegistered, "Interface not registered!" ); if ( bRegistered ) @@ -325,7 +325,7 @@ SfxInterface::~SfxInterface() // searches for the specified func -const SfxSlot* SfxInterface::GetSlot( USHORT nFuncId ) const +const SfxSlot* SfxInterface::GetSlot( sal_uInt16 nFuncId ) const { DBG_MEMTEST(); DBG_CHKTHIS(SfxInterface, 0); @@ -348,7 +348,7 @@ const SfxSlot* SfxInterface::GetSlot( const String& rCommand ) const if ( aCommand.SearchAscii( UNO_COMMAND ) == 0 ) aCommand.Erase( 0, sizeof( UNO_COMMAND )-1 ); - for ( USHORT n=0; n<nCount; n++ ) + for ( sal_uInt16 n=0; n<nCount; n++ ) { if ( (pSlots+n)->pUnoName && aCommand.CompareIgnoreCaseToAscii( (pSlots+n)->GetUnoName() ) == COMPARE_EQUAL ) @@ -381,7 +381,7 @@ const SfxSlot* SfxInterface::GetRealSlot( const SfxSlot *pSlot ) const //-------------------------------------------------------------------- -const SfxSlot* SfxInterface::GetRealSlot( USHORT nSlotId ) const +const SfxSlot* SfxInterface::GetRealSlot( sal_uInt16 nSlotId ) const { DBG_MEMTEST(); DBG_CHKTHIS(SfxInterface, 0); @@ -410,26 +410,26 @@ void SfxInterface::RegisterPopupMenu( const ResId& rResId ) //-------------------------------------------------------------------- -void SfxInterface::RegisterObjectBar( USHORT nPos, const ResId& rResId, +void SfxInterface::RegisterObjectBar( sal_uInt16 nPos, const ResId& rResId, const String *pStr ) { RegisterObjectBar( nPos, rResId, 0UL, pStr ); } -void SfxInterface::RegisterObjectBar( USHORT nPos, const ResId& rResId, sal_uInt32 nFeature, const String *pStr ) +void SfxInterface::RegisterObjectBar( sal_uInt16 nPos, const ResId& rResId, sal_uInt32 nFeature, const String *pStr ) { SfxObjectUI_Impl* pUI = CreateObjectBarUI_Impl( nPos, rResId, nFeature, pStr ); if ( pUI ) pImpData->pObjectBars->Append(pUI); } -SfxObjectUI_Impl* CreateObjectBarUI_Impl( USHORT nPos, const ResId& rResId, sal_uInt32 nFeature, const String *pStr ) +SfxObjectUI_Impl* CreateObjectBarUI_Impl( sal_uInt16 nPos, const ResId& rResId, sal_uInt32 nFeature, const String *pStr ) { if ((nPos & SFX_VISIBILITY_MASK) == 0) nPos |= SFX_VISIBILITY_STANDARD; - SfxObjectUI_Impl* pUI = new SfxObjectUI_Impl(nPos, rResId, TRUE, nFeature); + SfxObjectUI_Impl* pUI = new SfxObjectUI_Impl(nPos, rResId, sal_True, nFeature); if (pStr == 0) { @@ -449,13 +449,13 @@ SfxObjectUI_Impl* CreateObjectBarUI_Impl( USHORT nPos, const ResId& rResId, sal_ return pUI; } -const ResId& SfxInterface::GetObjectBarResId( USHORT nNo ) const +const ResId& SfxInterface::GetObjectBarResId( sal_uInt16 nNo ) const { - BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName()); + sal_Bool bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { // Gibt es Toolbars in der Superklasse ? - USHORT nBaseCount = pGenoType->GetObjectBarCount(); + sal_uInt16 nBaseCount = pGenoType->GetObjectBarCount(); if ( nNo < nBaseCount ) // Die der Superklasse kommen zuerst return pGenoType->GetObjectBarResId( nNo ); @@ -464,7 +464,7 @@ const ResId& SfxInterface::GetObjectBarResId( USHORT nNo ) const } #ifdef DBG_UTIL - USHORT nObjBarCount = pImpData->pObjectBars->Count(); + sal_uInt16 nObjBarCount = pImpData->pObjectBars->Count(); DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unbekannt!" ); #endif return (*pImpData->pObjectBars)[nNo]->aResId; @@ -473,13 +473,13 @@ const ResId& SfxInterface::GetObjectBarResId( USHORT nNo ) const //-------------------------------------------------------------------- -USHORT SfxInterface::GetObjectBarPos( USHORT nNo ) const +sal_uInt16 SfxInterface::GetObjectBarPos( sal_uInt16 nNo ) const { - BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName()); + sal_Bool bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { // Gibt es Toolbars in der Superklasse ? - USHORT nBaseCount = pGenoType->GetObjectBarCount(); + sal_uInt16 nBaseCount = pGenoType->GetObjectBarCount(); if ( nNo < nBaseCount ) // Die der Superklasse kommen zuerst return pGenoType->GetObjectBarPos( nNo ); @@ -488,7 +488,7 @@ USHORT SfxInterface::GetObjectBarPos( USHORT nNo ) const } #ifdef DBG_UTIL - USHORT nObjBarCount = pImpData->pObjectBars->Count(); + sal_uInt16 nObjBarCount = pImpData->pObjectBars->Count(); DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unbekannt!" ); #endif return (*pImpData->pObjectBars)[nNo]->nPos; @@ -497,7 +497,7 @@ USHORT SfxInterface::GetObjectBarPos( USHORT nNo ) const //-------------------------------------------------------------------- -USHORT SfxInterface::GetObjectBarCount() const +sal_uInt16 SfxInterface::GetObjectBarCount() const { if (pGenoType && ! pGenoType->HasName()) return pImpData->pObjectBars->Count() + pGenoType->GetObjectBarCount(); @@ -506,14 +506,14 @@ USHORT SfxInterface::GetObjectBarCount() const } //-------------------------------------------------------------------- -void SfxInterface::RegisterChildWindow(USHORT nId, BOOL bContext, const String* pChildWinName) +void SfxInterface::RegisterChildWindow(sal_uInt16 nId, sal_Bool bContext, const String* pChildWinName) { RegisterChildWindow( nId, bContext, 0UL, pChildWinName ); } -void SfxInterface::RegisterChildWindow(USHORT nId, BOOL bContext, sal_uInt32 nFeature, const String*) +void SfxInterface::RegisterChildWindow(sal_uInt16 nId, sal_Bool bContext, sal_uInt32 nFeature, const String*) { - SfxObjectUI_Impl* pUI = new SfxObjectUI_Impl(0, ResId(nId, *SfxApplication::GetOrCreate()->GetOffResManager_Impl()), TRUE, nFeature); + SfxObjectUI_Impl* pUI = new SfxObjectUI_Impl(0, ResId(nId, *SfxApplication::GetOrCreate()->GetOffResManager_Impl()), sal_True, nFeature); pUI->bContext = bContext; pImpData->pChildWindows->Append(pUI); } @@ -524,12 +524,12 @@ void SfxInterface::RegisterStatusBar(const ResId& rResId) } -sal_uInt32 SfxInterface::GetChildWindowId (USHORT nNo) const +sal_uInt32 SfxInterface::GetChildWindowId (sal_uInt16 nNo) const { if ( pGenoType ) { // Gibt es ChildWindows in der Superklasse ? - USHORT nBaseCount = pGenoType->GetChildWindowCount(); + sal_uInt16 nBaseCount = pGenoType->GetChildWindowCount(); if ( nNo < nBaseCount ) // Die der Superklasse kommen zuerst return pGenoType->GetChildWindowId( nNo ); @@ -538,7 +538,7 @@ sal_uInt32 SfxInterface::GetChildWindowId (USHORT nNo) const } #ifdef DBG_UTIL - USHORT nCWCount = pImpData->pChildWindows->Count(); + sal_uInt16 nCWCount = pImpData->pChildWindows->Count(); DBG_ASSERT( nNo<nCWCount,"ChildWindow ist unbekannt!" ); #endif sal_uInt32 nRet = (*pImpData->pChildWindows)[nNo]->aResId.GetId(); @@ -547,12 +547,12 @@ sal_uInt32 SfxInterface::GetChildWindowId (USHORT nNo) const return nRet; } -sal_uInt32 SfxInterface::GetChildWindowFeature (USHORT nNo) const +sal_uInt32 SfxInterface::GetChildWindowFeature (sal_uInt16 nNo) const { if ( pGenoType ) { // Gibt es ChildWindows in der Superklasse ? - USHORT nBaseCount = pGenoType->GetChildWindowCount(); + sal_uInt16 nBaseCount = pGenoType->GetChildWindowCount(); if ( nNo < nBaseCount ) // Die der Superklasse kommen zuerst return pGenoType->GetChildWindowFeature( nNo ); @@ -561,7 +561,7 @@ sal_uInt32 SfxInterface::GetChildWindowFeature (USHORT nNo) const } #ifdef DBG_UTIL - USHORT nCWCount = pImpData->pChildWindows->Count(); + sal_uInt16 nCWCount = pImpData->pChildWindows->Count(); DBG_ASSERT( nNo<nCWCount,"ChildWindow ist unbekannt!" ); #endif return (*pImpData->pChildWindows)[nNo]->nFeature; @@ -570,7 +570,7 @@ sal_uInt32 SfxInterface::GetChildWindowFeature (USHORT nNo) const //-------------------------------------------------------------------- -USHORT SfxInterface::GetChildWindowCount() const +sal_uInt16 SfxInterface::GetChildWindowCount() const { if (pGenoType) return pImpData->pChildWindows->Count() + pGenoType->GetChildWindowCount(); @@ -595,13 +595,13 @@ const ResId& SfxInterface::GetStatusBarResId() const -const String* SfxInterface::GetObjectBarName ( USHORT nNo ) const +const String* SfxInterface::GetObjectBarName ( sal_uInt16 nNo ) const { - BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName()); + sal_Bool bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { // Gibt es Toolbars in der Superklasse ? - USHORT nBaseCount = pGenoType->GetObjectBarCount(); + sal_uInt16 nBaseCount = pGenoType->GetObjectBarCount(); if ( nNo < nBaseCount ) // Die der Superklasse kommen zuerst return pGenoType->GetObjectBarName( nNo ); @@ -610,19 +610,19 @@ const String* SfxInterface::GetObjectBarName ( USHORT nNo ) const } #ifdef DBG_UTIL - USHORT nObjBarCount = pImpData->pObjectBars->Count(); + sal_uInt16 nObjBarCount = pImpData->pObjectBars->Count(); DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unbekannt!" ); #endif return (*pImpData->pObjectBars)[nNo]->pName; } -sal_uInt32 SfxInterface::GetObjectBarFeature ( USHORT nNo ) const +sal_uInt32 SfxInterface::GetObjectBarFeature ( sal_uInt16 nNo ) const { - BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName()); + sal_Bool bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { // Gibt es Toolbars in der Superklasse ? - USHORT nBaseCount = pGenoType->GetObjectBarCount(); + sal_uInt16 nBaseCount = pGenoType->GetObjectBarCount(); if ( nNo < nBaseCount ) // Die der Superklasse kommen zuerst return pGenoType->GetObjectBarFeature( nNo ); @@ -631,19 +631,19 @@ sal_uInt32 SfxInterface::GetObjectBarFeature ( USHORT nNo ) const } #ifdef DBG_UTIL - USHORT nObjBarCount = pImpData->pObjectBars->Count(); + sal_uInt16 nObjBarCount = pImpData->pObjectBars->Count(); DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unbekannt!" ); #endif return (*pImpData->pObjectBars)[nNo]->nFeature; } -BOOL SfxInterface::IsObjectBarVisible(USHORT nNo) const +sal_Bool SfxInterface::IsObjectBarVisible(sal_uInt16 nNo) const { - BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName()); + sal_Bool bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { // Gibt es Toolbars in der Superklasse ? - USHORT nBaseCount = pGenoType->GetObjectBarCount(); + sal_uInt16 nBaseCount = pGenoType->GetObjectBarCount(); if ( nNo < nBaseCount ) // Die der Superklasse kommen zuerst return pGenoType->IsObjectBarVisible( nNo ); @@ -652,7 +652,7 @@ BOOL SfxInterface::IsObjectBarVisible(USHORT nNo) const } #ifdef DBG_UTIL - USHORT nObjBarCount = pImpData->pObjectBars->Count(); + sal_uInt16 nObjBarCount = pImpData->pObjectBars->Count(); DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unbekannt!" ); #endif return (*pImpData->pObjectBars)[nNo]->bVisible; diff --git a/sfx2/source/control/querystatus.cxx b/sfx2/source/control/querystatus.cxx index bee4a5c87675..9fb17332c27d 100644 --- a/sfx2/source/control/querystatus.cxx +++ b/sfx2/source/control/querystatus.cxx @@ -59,7 +59,7 @@ class SfxQueryStatus_Impl : public ::com::sun::star::frame::XStatusListener , public: SFX_DECL_XINTERFACE_XTYPEPROVIDER - SfxQueryStatus_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& rDispatchProvider, USHORT nSlotId, const rtl::OUString& aCommand ); + SfxQueryStatus_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const rtl::OUString& aCommand ); virtual ~SfxQueryStatus_Impl(); // Query method @@ -79,7 +79,7 @@ class SfxQueryStatus_Impl : public ::com::sun::star::frame::XStatusListener , sal_Bool m_bQueryInProgress; SfxItemState m_eState; SfxPoolItem* m_pItem; - USHORT m_nSlotID; + sal_uInt16 m_nSlotID; osl::Condition m_aCondition; ::com::sun::star::util::URL m_aCommand; com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > m_xDispatch; @@ -88,7 +88,7 @@ class SfxQueryStatus_Impl : public ::com::sun::star::frame::XStatusListener , SFX_IMPL_XINTERFACE_2( SfxQueryStatus_Impl, OWeakObject, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener ) SFX_IMPL_XTYPEPROVIDER_2( SfxQueryStatus_Impl, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener ) -SfxQueryStatus_Impl::SfxQueryStatus_Impl( const Reference< XDispatchProvider >& rDispatchProvider, USHORT nSlotId, const OUString& rCommand ) : +SfxQueryStatus_Impl::SfxQueryStatus_Impl( const Reference< XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const OUString& rCommand ) : cppu::OWeakObject(), m_bQueryInProgress( sal_False ), m_eState( SFX_ITEM_DISABLED ), @@ -222,7 +222,7 @@ SfxItemState SfxQueryStatus_Impl::QueryState( SfxPoolItem*& rpPoolItem ) //************************************************************************* -SfxQueryStatus::SfxQueryStatus( const Reference< XDispatchProvider >& rDispatchProvider, USHORT nSlotId, const OUString& rCommand ) +SfxQueryStatus::SfxQueryStatus( const Reference< XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const OUString& rCommand ) { m_pSfxQueryStatusImpl = new SfxQueryStatus_Impl( rDispatchProvider, nSlotId, rCommand ); m_xStatusListener = Reference< XStatusListener >( diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx index 88a52d0ad0bf..ec6f9a7428e9 100644 --- a/sfx2/source/control/request.cxx +++ b/sfx2/source/control/request.cxx @@ -76,13 +76,13 @@ struct SfxRequest_Impl: public SfxListener SfxPoolItem* pRetVal; // R"uckgabewert geh"ort sich selbst SfxShell* pShell; // ausgef"uhrt an dieser Shell const SfxSlot* pSlot; // ausgef"uhrter Slot - USHORT nModifier; // welche Modifier waren gedrueckt? - BOOL bDone; // "uberhaupt ausgef"uhrt - BOOL bIgnored; // vom User abgebrochen - BOOL bCancelled; // nicht mehr zustellen - BOOL bUseTarget; // aTarget wurde von Applikation gesetzt - USHORT nCallMode; // Synch/Asynch/API/Record - BOOL bAllowRecording; + sal_uInt16 nModifier; // welche Modifier waren gedrueckt? + sal_Bool bDone; // "uberhaupt ausgef"uhrt + sal_Bool bIgnored; // vom User abgebrochen + sal_Bool bCancelled; // nicht mehr zustellen + sal_Bool bUseTarget; // aTarget wurde von Applikation gesetzt + sal_uInt16 nCallMode; // Synch/Asynch/API/Record + sal_Bool bAllowRecording; SfxAllItemSet* pInternalArgs; SfxViewFrame* pViewFrame; @@ -92,9 +92,9 @@ struct SfxRequest_Impl: public SfxListener : pAnti( pOwner) , pPool(0) , nModifier(0) - , bCancelled(FALSE) + , bCancelled(sal_False) , nCallMode( SFX_CALLMODE_SYNCHRON ) - , bAllowRecording( FALSE ) + , bAllowRecording( sal_False ) , pInternalArgs( 0 ) , pViewFrame(0) {} @@ -162,8 +162,8 @@ SfxRequest::SfxRequest DBG_MEMTEST(); pImp->bAllowRecording = rOrig.pImp->bAllowRecording; - pImp->bDone = FALSE; - pImp->bIgnored = FALSE; + pImp->bDone = sal_False; + pImp->bIgnored = sal_False; pImp->pRetVal = 0; pImp->pShell = 0; pImp->pSlot = 0; @@ -186,7 +186,7 @@ SfxRequest::SfxRequest SfxRequest::SfxRequest ( SfxViewFrame* pViewFrame, - USHORT nSlotId + sal_uInt16 nSlotId ) @@ -205,16 +205,16 @@ SfxRequest::SfxRequest { DBG_MEMTEST(); - pImp->bDone = FALSE; - pImp->bIgnored = FALSE; + pImp->bDone = sal_False; + pImp->bIgnored = sal_False; pImp->SetPool( &pViewFrame->GetPool() ); pImp->pRetVal = 0; pImp->pShell = 0; pImp->pSlot = 0; pImp->nCallMode = SFX_CALLMODE_SYNCHRON; - pImp->bUseTarget = FALSE; + pImp->bUseTarget = sal_False; pImp->pViewFrame = pViewFrame; - if( pImp->pViewFrame->GetDispatcher()->GetShellAndSlot_Impl( nSlotId, &pImp->pShell, &pImp->pSlot, TRUE, TRUE ) ) + if( pImp->pViewFrame->GetDispatcher()->GetShellAndSlot_Impl( nSlotId, &pImp->pShell, &pImp->pSlot, sal_True, sal_True ) ) { pImp->SetPool( &pImp->pShell->GetPool() ); pImp->xRecorder = SfxRequest::GetMacroRecorder( pViewFrame ); @@ -235,7 +235,7 @@ SfxRequest::SfxRequest SfxRequest::SfxRequest ( - USHORT nSlotId, // auszuf"uhrende <Slot-Id> + sal_uInt16 nSlotId, // auszuf"uhrende <Slot-Id> SfxCallMode nMode, // Synch/API/... SfxItemPool& rPool // ggf. f"ur das SfxItemSet f"ur Parameter ) @@ -248,14 +248,14 @@ SfxRequest::SfxRequest { DBG_MEMTEST(); - pImp->bDone = FALSE; - pImp->bIgnored = FALSE; + pImp->bDone = sal_False; + pImp->bIgnored = sal_False; pImp->SetPool( &rPool ); pImp->pRetVal = 0; pImp->pShell = 0; pImp->pSlot = 0; pImp->nCallMode = nMode; - pImp->bUseTarget = FALSE; + pImp->bUseTarget = sal_False; } SfxRequest::SfxRequest @@ -271,14 +271,14 @@ SfxRequest::SfxRequest { DBG_MEMTEST(); - pImp->bDone = FALSE; - pImp->bIgnored = FALSE; + pImp->bDone = sal_False; + pImp->bIgnored = sal_False; pImp->SetPool( &rPool ); pImp->pRetVal = 0; pImp->pShell = 0; pImp->pSlot = 0; pImp->nCallMode = nMode; - pImp->bUseTarget = FALSE; + pImp->bUseTarget = sal_False; TransformParameters( nSlot, rArgs, *pArgs, pSlot ); } @@ -286,8 +286,8 @@ SfxRequest::SfxRequest SfxRequest::SfxRequest ( - USHORT nSlotId, - USHORT nMode, + sal_uInt16 nSlotId, + sal_uInt16 nMode, const SfxAllItemSet& rSfxArgs ) @@ -299,37 +299,37 @@ SfxRequest::SfxRequest { DBG_MEMTEST(); - pImp->bDone = FALSE; - pImp->bIgnored = FALSE; + pImp->bDone = sal_False; + pImp->bIgnored = sal_False; pImp->SetPool( rSfxArgs.GetPool() ); pImp->pRetVal = 0; pImp->pShell = 0; pImp->pSlot = 0; pImp->nCallMode = nMode; - pImp->bUseTarget = FALSE; + pImp->bUseTarget = sal_False; } //-------------------------------------------------------------------- -USHORT SfxRequest::GetCallMode() const +sal_uInt16 SfxRequest::GetCallMode() const { return pImp->nCallMode; } //-------------------------------------------------------------------- -BOOL SfxRequest::IsSynchronCall() const +sal_Bool SfxRequest::IsSynchronCall() const { return SFX_CALLMODE_SYNCHRON == ( SFX_CALLMODE_SYNCHRON & pImp->nCallMode ); } //-------------------------------------------------------------------- -void SfxRequest::SetSynchronCall( BOOL bSynchron ) +void SfxRequest::SetSynchronCall( sal_Bool bSynchron ) { if ( bSynchron ) pImp->nCallMode |= SFX_CALLMODE_SYNCHRON; else - pImp->nCallMode &= ~(USHORT) SFX_CALLMODE_SYNCHRON; + pImp->nCallMode &= ~(sal_uInt16) SFX_CALLMODE_SYNCHRON; } void SfxRequest::SetInternalArgs_Impl( const SfxAllItemSet& rArgs ) @@ -456,7 +456,7 @@ void SfxRequest::AppendItem(const SfxPoolItem &rItem) //-------------------------------------------------------------------- -void SfxRequest::RemoveItem( USHORT nID ) +void SfxRequest::RemoveItem( sal_uInt16 nID ) { if (pArgs) { @@ -470,8 +470,8 @@ void SfxRequest::RemoveItem( USHORT nID ) const SfxPoolItem* SfxRequest::GetArg ( - USHORT nSlotId, // Slot-Id oder Which-Id des Parameters - FASTBOOL bDeep, // FALSE: nicht in Parent-ItemSets suchen + sal_uInt16 nSlotId, // Slot-Id oder Which-Id des Parameters + bool bDeep, // false: nicht in Parent-ItemSets suchen TypeId aType // != 0: RTTI Pruefung mit Assertion ) const { @@ -483,7 +483,7 @@ const SfxPoolItem* SfxRequest::GetArg const SfxPoolItem* SfxRequest::GetItem ( const SfxItemSet* pArgs, - USHORT nSlotId, // Slot-Id oder Which-Id des Parameters + sal_uInt16 nSlotId, // Slot-Id oder Which-Id des Parameters bool bDeep, // false: nicht in Parent-ItemSets suchen TypeId aType // != 0: RTTI Pruefung mit Assertion ) @@ -509,12 +509,12 @@ const SfxPoolItem* SfxRequest::GetItem ... // ein Beispiel ohne Verwendung des Makros const SfxInt32Item *pPosItem = (const SfxUInt32Item*) - rReq.GetArg( SID_POS, FALSE, TYPE(SfxInt32Item) ); - USHORT nPos = pPosItem ? pPosItem->GetValue() : 0; + rReq.GetArg( SID_POS, sal_False, TYPE(SfxInt32Item) ); + sal_uInt16 nPos = pPosItem ? pPosItem->GetValue() : 0; // ein Beispiel mit Verwendung des Makros - SFX_REQUEST_ARG(rReq, pSizeItem, SfxInt32Item, SID_SIZE, FALSE); - USHORT nSize = pSizeItem ? pPosItem->GetValue() : 0; + SFX_REQUEST_ARG(rReq, pSizeItem, SfxInt32Item, SID_SIZE, sal_False); + sal_uInt16 nSize = pSizeItem ? pPosItem->GetValue() : 0; ... } @@ -528,7 +528,7 @@ const SfxPoolItem* SfxRequest::GetItem if ( pArgs ) { // ggf. in Which-Id umrechnen - USHORT nWhich = pArgs->GetPool()->GetWhich(nSlotId); + sal_uInt16 nWhich = pArgs->GetPool()->GetWhich(nSlotId); // ist das Item gesetzt oder bei bDeep==TRUE verf"ugbar? const SfxPoolItem *pItem = 0; @@ -574,11 +574,11 @@ void SfxRequest::Done erfragt wurden, ggf. 0 falls keine Parameter gesetzt wurden */ - FASTBOOL bKeep /* TRUE (default) + bool bKeep /* true (default) 'rSet' wird gepeichert und ist "uber GetArgs() abfragbar - FALSE + false 'rSet' wird nicht kopiert (schneller) */ ) @@ -634,7 +634,7 @@ void SfxRequest::Done //-------------------------------------------------------------------- -void SfxRequest::Done( BOOL bRelease ) +void SfxRequest::Done( sal_Bool bRelease ) // [<SfxRequest::Done(SfxItemSet&)>] { Done_Impl( pArgs ); @@ -652,7 +652,7 @@ void SfxRequest::ForgetAllArgs() //-------------------------------------------------------------------- -BOOL SfxRequest::IsCancelled() const +sal_Bool SfxRequest::IsCancelled() const { return pImp->bCancelled; } @@ -668,7 +668,7 @@ void SfxRequest::Cancel() */ { - pImp->bCancelled = TRUE; + pImp->bCancelled = sal_True; pImp->SetPool( 0 ); DELETEZ( pArgs ); } @@ -694,7 +694,7 @@ void SfxRequest::Ignore() { // als tats"achlich ausgef"uhrt markieren - pImp->bIgnored = TRUE; + pImp->bIgnored = sal_True; } //-------------------------------------------------------------------- @@ -715,7 +715,7 @@ void SfxRequest::Done_Impl { // als tats"achlich ausgef"uhrt markieren - pImp->bDone = TRUE; + pImp->bDone = sal_True; // nicht Recorden if ( !pImp->xRecorder.is() ) @@ -751,8 +751,8 @@ void SfxRequest::Done_Impl { // des Property als SfxPoolItem besorgen const SfxPoolItem *pItem; - USHORT nWhich = rPool.GetWhich(pImp->pSlot->GetSlotId()); - SfxItemState eState = pSet ? pSet->GetItemState( nWhich, FALSE, &pItem ) : SFX_ITEM_UNKNOWN; + sal_uInt16 nWhich = rPool.GetWhich(pImp->pSlot->GetSlotId()); + SfxItemState eState = pSet ? pSet->GetItemState( nWhich, sal_False, &pItem ) : SFX_ITEM_UNKNOWN; #ifdef DBG_UTIL if ( SFX_ITEM_SET != eState ) { @@ -786,13 +786,13 @@ void SfxRequest::Done_Impl for ( const SfxPoolItem* pItem = aIter.FirstItem(); pItem; pItem = aIter.NextItem() ) { // die Slot-Id f"ur das einzelne Item ermitteln - USHORT nSlotId = rPool.GetSlotId( pItem->Which() ); + sal_uInt16 nSlotId = rPool.GetSlotId( pItem->Which() ); if ( nSlotId == nSlot ) { // mit Hosentr"ager und G"urtel reparieren des falschen Flags DBG_ERROR( "recursion RecordPerItem - use RecordPerSet!" ); SfxSlot *pSlot = (SfxSlot*) pImp->pSlot; - pSlot->nFlags &= ~((ULONG)SFX_SLOT_RECORDPERITEM); + pSlot->nFlags &= ~((sal_uIntPtr)SFX_SLOT_RECORDPERITEM); pSlot->nFlags &= SFX_SLOT_RECORDPERSET; } @@ -813,7 +813,7 @@ void SfxRequest::Done_Impl //-------------------------------------------------------------------- -BOOL SfxRequest::IsDone() const +sal_Bool SfxRequest::IsDone() const /* [Beschreibung] @@ -823,7 +823,7 @@ BOOL SfxRequest::IsDone() const der Kontext f"ur diesen Request falsch war, dieses aber nicht "uber eine separate <SfxShell> realisiert wurde. - SfxRequest-Instanzen, die hier FALSE liefern, werden nicht recorded. + SfxRequest-Instanzen, die hier sal_False liefern, werden nicht recorded. [Querverweise] @@ -881,7 +881,7 @@ com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > SfxRe return xRecorder; } -BOOL SfxRequest::HasMacroRecorder( SfxViewFrame* pView ) +sal_Bool SfxRequest::HasMacroRecorder( SfxViewFrame* pView ) { return GetMacroRecorder( pView ).is(); } @@ -889,12 +889,12 @@ BOOL SfxRequest::HasMacroRecorder( SfxViewFrame* pView ) //-------------------------------------------------------------------- -BOOL SfxRequest::IsAPI() const +sal_Bool SfxRequest::IsAPI() const /* [Beschreibung] - Liefert TRUE, wenn dieser SfxRequest von einer API (z.B. BASIC) - erzeugt wurde, sonst FALSE. + Liefert sal_True, wenn dieser SfxRequest von einer API (z.B. BASIC) + erzeugt wurde, sonst sal_False. */ { @@ -904,15 +904,15 @@ BOOL SfxRequest::IsAPI() const //-------------------------------------------------------------------- -FASTBOOL SfxRequest::IsRecording() const +bool SfxRequest::IsRecording() const /* [Beschreibung] - Liefert TRUE, wenn dieser SfxRequest recorded werden soll, d.h. + Liefert sal_True, wenn dieser SfxRequest recorded werden soll, d.h. 1. zu Zeit ein Makro aufgezeichnet wird 2. dieser Request "uberhaupt aufgezeichnet wird 3. der Request nicht von reiner API (z.B. BASIC) ausgeht, - sonst FALSE. + sonst sal_False. */ { @@ -920,13 +920,13 @@ FASTBOOL SfxRequest::IsRecording() const } //-------------------------------------------------------------------- -void SfxRequest::SetModifier( USHORT nModi ) +void SfxRequest::SetModifier( sal_uInt16 nModi ) { pImp->nModifier = nModi; } //-------------------------------------------------------------------- -USHORT SfxRequest::GetModifier() const +sal_uInt16 SfxRequest::GetModifier() const { return pImp->nModifier; } @@ -954,17 +954,17 @@ void SfxRequest::SetTarget( const String &rTarget ) { pImp->aTarget = rTarget; - pImp->bUseTarget = TRUE; + pImp->bUseTarget = sal_True; } -void SfxRequest::AllowRecording( BOOL bSet ) +void SfxRequest::AllowRecording( sal_Bool bSet ) { pImp->bAllowRecording = bSet; } -BOOL SfxRequest::AllowsRecording() const +sal_Bool SfxRequest::AllowsRecording() const { - BOOL bAllow = pImp->bAllowRecording; + sal_Bool bAllow = pImp->bAllowRecording; if( !bAllow ) bAllow = ( SFX_CALLMODE_API != ( SFX_CALLMODE_API & pImp->nCallMode ) ) && ( SFX_CALLMODE_RECORD == ( SFX_CALLMODE_RECORD & pImp->nCallMode ) ); diff --git a/sfx2/source/control/sfxstatuslistener.cxx b/sfx2/source/control/sfxstatuslistener.cxx index c2cf5f164e7c..96f305f58389 100644 --- a/sfx2/source/control/sfxstatuslistener.cxx +++ b/sfx2/source/control/sfxstatuslistener.cxx @@ -61,7 +61,7 @@ using namespace ::com::sun::star::util; SFX_IMPL_XINTERFACE_3( SfxStatusListener, OWeakObject, ::com::sun::star::lang::XComponent, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener ) SFX_IMPL_XTYPEPROVIDER_3( SfxStatusListener, ::com::sun::star::lang::XComponent, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener ) -SfxStatusListener::SfxStatusListener( const Reference< XDispatchProvider >& rDispatchProvider, USHORT nSlotId, const OUString& rCommand ) : +SfxStatusListener::SfxStatusListener( const Reference< XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const OUString& rCommand ) : cppu::OWeakObject(), m_nSlotID( nSlotId ), m_xDispatchProvider( rDispatchProvider ) @@ -79,7 +79,7 @@ SfxStatusListener::~SfxStatusListener() } // old sfx controller item C++ API -void SfxStatusListener::StateChanged( USHORT, SfxItemState, const SfxPoolItem* ) +void SfxStatusListener::StateChanged( sal_uInt16, SfxItemState, const SfxPoolItem* ) { // must be implemented by sub class } @@ -100,7 +100,7 @@ void SfxStatusListener::Bind() } } -void SfxStatusListener::Bind( USHORT nSlotId, const rtl::OUString& rNewCommand ) +void SfxStatusListener::Bind( sal_uInt16 nSlotId, const rtl::OUString& rNewCommand ) { // first remove old listener, if we have a dispatch object Reference< XStatusListener > aStatusListener( static_cast< OWeakObject* >( this ), UNO_QUERY ); diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx index f3df5dc36d0c..be365349888f 100644 --- a/sfx2/source/control/shell.cxx +++ b/sfx2/source/control/shell.cxx @@ -46,7 +46,6 @@ #include <sfx2/bindings.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/viewfrm.hxx> -#include "sfxbasic.hxx" #include <sfx2/objface.hxx> #include <sfx2/objsh.hxx> #include <sfx2/viewsh.hxx> @@ -55,7 +54,6 @@ #include <sfx2/request.hxx> #include <sfx2/mnumgr.hxx> #include "statcach.hxx" -#include <sfx2/macrconf.hxx> #include <sfx2/msgpool.hxx> //==================================================================== @@ -84,10 +82,10 @@ struct SfxShell_Impl: public SfxBroadcaster SfxViewFrame* pFrame; // Frame, falls <UI-aktiv> SfxRepeatTarget* pRepeatTarget; // SbxObjectRef xParent; - BOOL bInAppBASIC; - BOOL bActive; - ULONG nDisableFlags; - ULONG nHelpId; + sal_Bool bInAppBASIC; + sal_Bool bActive; + sal_uIntPtr nDisableFlags; + sal_uIntPtr nHelpId; svtools::AsynchronLink* pExecuter; svtools::AsynchronLink* pUpdater; SfxVerbSlotArr_Impl aSlotArr; @@ -151,9 +149,9 @@ SfxShell::SfxShell() pImp->pViewSh = 0; pImp->pFrame = 0; pImp->pRepeatTarget = 0; - pImp->bInAppBASIC = FALSE; + pImp->bInAppBASIC = sal_False; pImp->nHelpId = 0L; - pImp->bActive = FALSE; + pImp->bActive = sal_False; pImp->nDisableFlags = 0; } @@ -177,9 +175,9 @@ SfxShell::SfxShell( SfxViewShell *pViewSh ) pImp->pViewSh = pViewSh; pImp->pFrame = 0; pImp->pRepeatTarget = 0; - pImp->bInAppBASIC = FALSE; + pImp->bInAppBASIC = sal_False; pImp->nHelpId = 0L; - pImp->bActive = FALSE; + pImp->bActive = sal_False; } //-------------------------------------------------------------------- @@ -312,7 +310,7 @@ SfxViewFrame* SfxShell::GetFrame() const const SfxPoolItem* SfxShell::GetItem ( - USHORT nSlotId // Slot-Id des zu erfragenden <SfxPoolItem>s + sal_uInt16 nSlotId // Slot-Id des zu erfragenden <SfxPoolItem>s ) const /* [Beschreibung] @@ -329,11 +327,11 @@ const SfxPoolItem* SfxShell::GetItem [Querverweise] <SfxShell::PutItem(const SfxPoolItem&)> - <SfxShell::RemoveItem(USHORT)> + <SfxShell::RemoveItem(sal_uInt16)> */ { - for ( USHORT nPos = 0; nPos < pImp->aItems.Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < pImp->aItems.Count(); ++nPos ) if ( pImp->aItems.GetObject(nPos)->Which() == nSlotId ) return pImp->aItems.GetObject(nPos); return 0; @@ -343,7 +341,7 @@ const SfxPoolItem* SfxShell::GetItem void SfxShell::RemoveItem ( - USHORT nSlotId // Slot-Id des zu l"oschenden <SfxPoolItem>s + sal_uInt16 nSlotId // Slot-Id des zu l"oschenden <SfxPoolItem>s ) /* [Beschreibung] @@ -358,11 +356,11 @@ void SfxShell::RemoveItem [Querverweise] <SfxShell::PutItem(const SfxPoolItem&)> - <SfxShell::GetItem(USHORT)> + <SfxShell::GetItem(sal_uInt16)> */ { - for ( USHORT nPos = 0; nPos < pImp->aItems.Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < pImp->aItems.Count(); ++nPos ) if ( pImp->aItems.GetObject(nPos)->Which() == nSlotId ) { // Item entfernen und l"oschen @@ -402,8 +400,8 @@ void SfxShell::PutItem [Querverweise] - <SfxShell::RemoveItem(USHORT)> - <SfxShell::GetItem(USHORT)> + <SfxShell::RemoveItem(sal_uInt16)> + <SfxShell::GetItem(sal_uInt16)> */ { @@ -414,9 +412,9 @@ void SfxShell::PutItem // MSC auf WNT/W95 machte hier Mist, Vorsicht bei Umstellungen const SfxPoolItem *pItem = rItem.Clone(); SfxPoolItemHint aItemHint( (SfxPoolItem*) pItem ); - const USHORT nWhich = rItem.Which(); + const sal_uInt16 nWhich = rItem.Which(); SfxPoolItem **ppLoopItem = (SfxPoolItem**) pImp->aItems.GetData(); - USHORT nPos; + sal_uInt16 nPos; for ( nPos = 0; nPos < pImp->aItems.Count(); ++nPos, ++ppLoopItem ) { if ( (*ppLoopItem)->Which() == nWhich ) @@ -432,12 +430,12 @@ void SfxShell::PutItem { SfxBindings* pBindings = pDispat->GetBindings(); pBindings->Broadcast( aItemHint ); - USHORT nSlotId = nWhich; //pItem->GetSlotId(); + sal_uInt16 nSlotId = nWhich; //pItem->GetSlotId(); SfxStateCache* pCache = pBindings->GetStateCache( nSlotId ); if ( pCache ) { - pCache->SetState( SFX_ITEM_AVAILABLE, pItem->Clone(), TRUE ); - pCache->SetCachedState( TRUE ); + pCache->SetState( SFX_ITEM_AVAILABLE, pItem->Clone(), sal_True ); + pCache->SetCachedState( sal_True ); } } return; @@ -483,7 +481,7 @@ SfxBroadcaster* SfxShell::GetBroadcaster() //-------------------------------------------------------------------- -SfxUndoManager* SfxShell::GetUndoManager() +::svl::IUndoManager* SfxShell::GetUndoManager() /* [Beschreibung] @@ -501,7 +499,7 @@ SfxUndoManager* SfxShell::GetUndoManager() //-------------------------------------------------------------------- -void SfxShell::SetUndoManager( SfxUndoManager *pNewUndoMgr ) +void SfxShell::SetUndoManager( ::svl::IUndoManager *pNewUndoMgr ) /* [Beschreibung] @@ -517,9 +515,15 @@ void SfxShell::SetUndoManager( SfxUndoManager *pNewUndoMgr ) */ { + OSL_ENSURE( ( pUndoMgr == NULL ) || ( pNewUndoMgr == NULL ) || ( pUndoMgr == pNewUndoMgr ), + "SfxShell::SetUndoManager: exchanging one non-NULL manager with another non-NULL manager? Suspicious!" ); + // there's at least one client of our UndoManager - the DocumentUndoManager at the SfxBaseModel - which + // caches the UndoManager, and registers itself as listener. If exchanging non-NULL UndoManagers is really + // a supported scenario (/me thinks it is not), then we would need to notify all such clients instances. + pUndoMgr = pNewUndoMgr; if ( pUndoMgr ) - pUndoMgr->SetMaxUndoActionCount( (USHORT) SvtUndoOptions().GetUndoCount() ); + pUndoMgr->SetMaxUndoActionCount( (sal_uInt16) SvtUndoOptions().GetUndoCount() ); } //-------------------------------------------------------------------- @@ -575,7 +579,7 @@ void SfxShell::SetRepeatTarget( SfxRepeatTarget *pTarget ) void SfxShell::Invalidate ( - USHORT nId /* Zu invalidierende Slot-Id oder Which-Id. + sal_uInt16 nId /* Zu invalidierende Slot-Id oder Which-Id. Falls diese 0 ist (default), werden alle z.Zt. von dieser Shell bedienten Slot-Ids invalidiert. */ @@ -588,8 +592,8 @@ void SfxShell::Invalidate die von der Subclass ererbt sind, werden ebenfalls invalidert. [Querverweise] - <SfxBindings::Invalidate(USHORT)> - <SfxBindings::InvalidateAll(BOOL)> + <SfxBindings::Invalidate(sal_uInt16)> + <SfxBindings::InvalidateAll(sal_Bool)> */ { @@ -602,11 +606,11 @@ void SfxShell::Invalidate Invalidate_Impl( GetViewShell()->GetViewFrame()->GetBindings(), nId ); } -void SfxShell::Invalidate_Impl( SfxBindings& rBindings, USHORT nId ) +void SfxShell::Invalidate_Impl( SfxBindings& rBindings, sal_uInt16 nId ) { if ( nId == 0 ) { - rBindings.InvalidateShell( *this, FALSE ); + rBindings.InvalidateShell( *this, sal_False ); } else { @@ -642,12 +646,12 @@ void SfxShell::Invalidate_Impl( SfxBindings& rBindings, USHORT nId ) //-------------------------------------------------------------------- -void SfxShell::DoActivate_Impl( SfxViewFrame *pFrame, BOOL bMDI ) +void SfxShell::DoActivate_Impl( SfxViewFrame *pFrame, sal_Bool bMDI ) /* [Beschreibung] Diese Methode steuert die Aktivierung der SfxShell-Instanz. Zun"achst - wird durch Aufruf der virtuellen Methode <SfxShell::Activate(BOOL)> + wird durch Aufruf der virtuellen Methode <SfxShell::Activate(sal_Bool)> der Subclass die M"oglichkeit gegeben, auf das Event zu reagieren. Bei bMDI == TRUE wird das zugeh"orige SbxObject 'scharfgeschaltet', @@ -675,7 +679,7 @@ void SfxShell::DoActivate_Impl( SfxViewFrame *pFrame, BOOL bMDI ) { // Frame merken, in dem aktiviert wird pImp->pFrame = pFrame; - pImp->bActive = TRUE; + pImp->bActive = sal_True; } // Subklasse benachrichtigen @@ -684,7 +688,7 @@ void SfxShell::DoActivate_Impl( SfxViewFrame *pFrame, BOOL bMDI ) //-------------------------------------------------------------------- -void SfxShell::DoDeactivate_Impl( SfxViewFrame *pFrame, BOOL bMDI ) +void SfxShell::DoDeactivate_Impl( SfxViewFrame *pFrame, sal_Bool bMDI ) /* [Beschreibung] @@ -694,7 +698,7 @@ void SfxShell::DoDeactivate_Impl( SfxViewFrame *pFrame, BOOL bMDI ) k"onnen. Dann erh"alt in jedem Fall die Subclass durch Aufruf der virtuellen - Methode <SfxShell::Deactivate(BOOL)> die M"oglichkeit auf das Event + Methode <SfxShell::Deactivate(sal_Bool)> die M"oglichkeit auf das Event zu reagieren. */ @@ -719,7 +723,7 @@ void SfxShell::DoDeactivate_Impl( SfxViewFrame *pFrame, BOOL bMDI ) { // austragen pImp->pFrame = 0; - pImp->bActive = FALSE; + pImp->bActive = sal_False; } // Subklasse benachrichtigen @@ -728,7 +732,7 @@ void SfxShell::DoDeactivate_Impl( SfxViewFrame *pFrame, BOOL bMDI ) //-------------------------------------------------------------------- -BOOL SfxShell::IsActive() const +sal_Bool SfxShell::IsActive() const { return pImp->bActive; } @@ -737,7 +741,7 @@ BOOL SfxShell::IsActive() const void SfxShell::Activate ( - BOOL /*bMDI*/ /* TRUE + sal_Bool /*bMDI*/ /* TRUE der <SfxDispatcher>, auf dem die SfxShell sich befindet, ist aktiv geworden oder die SfxShell Instanz wurde auf einen aktiven SfxDispatcher @@ -760,7 +764,7 @@ void SfxShell::Activate [Querverweise] - StarView SystemWindow::Activate(BOOL) + StarView SystemWindow::Activate(sal_Bool) */ { @@ -770,7 +774,7 @@ void SfxShell::Activate void SfxShell::Deactivate ( - BOOL /*bMDI*/ /* TRUE + sal_Bool /*bMDI*/ /* TRUE der <SfxDispatcher>, auf dem die SfxShell sich befindet, ist inaktiv geworden oder die SfxShell Instanz wurde auf einen aktiven SfxDispatcher @@ -793,7 +797,7 @@ void SfxShell::Deactivate [Querverweise] - StarView SystemWindow::Dectivate(BOOL) + StarView SystemWindow::Dectivate(sal_Bool) */ { @@ -853,7 +857,7 @@ ResMgr* SfxShell::GetResMgr() const //-------------------------------------------------------------------- -FASTBOOL SfxShell::CanExecuteSlot_Impl( const SfxSlot &rSlot ) +bool SfxShell::CanExecuteSlot_Impl( const SfxSlot &rSlot ) /* [Beschreibung] @@ -863,7 +867,7 @@ FASTBOOL SfxShell::CanExecuteSlot_Impl( const SfxSlot &rSlot ) { // Slot-Status holen SfxItemPool &rPool = GetPool(); - const USHORT nId = rSlot.GetWhich( rPool ); + const sal_uInt16 nId = rSlot.GetWhich( rPool ); SfxItemSet aSet(rPool, nId, nId); SfxStateFunc pFunc = rSlot.GetStateFnc(); CallState( pFunc, aSet ); @@ -883,7 +887,7 @@ long ShellCall_Impl( void* pObj, void* pArg ) */ //-------------------------------------------------------------------- -const SfxPoolItem* SfxShell::ExecuteSlot( SfxRequest& rReq, BOOL bAsync ) +const SfxPoolItem* SfxShell::ExecuteSlot( SfxRequest& rReq, sal_Bool bAsync ) { if( !bAsync ) return ExecuteSlot( rReq, (SfxInterface*)0L ); @@ -934,26 +938,19 @@ const SfxPoolItem* SfxShell::ExecuteSlot [Querverweise] - <SfxShell::GetSlotState(USHORT,const SfxInterface*,SfxItemSet*)> + <SfxShell::GetSlotState(sal_uInt16,const SfxInterface*,SfxItemSet*)> */ { if ( !pIF ) pIF = GetInterface(); - USHORT nSlot = rReq.GetSlot(); + sal_uInt16 nSlot = rReq.GetSlot(); const SfxSlot* pSlot = NULL; if ( nSlot >= SID_VERB_START && nSlot <= SID_VERB_END ) pSlot = GetVerbSlot_Impl(nSlot); if ( !pSlot ) pSlot = pIF->GetSlot(nSlot); - if ( !pSlot && SfxMacroConfig::IsMacroSlot( nSlot ) ) - { - SfxMacroInfo* pInfo = SFX_APP()->GetMacroConfig()->GetMacroInfo(nSlot); - if ( pInfo ) - pSlot = pInfo->GetSlot(); - } - DBG_ASSERT( pSlot, "slot not supported" ); SfxExecFunc pFunc = pSlot->GetExecFnc(); @@ -967,7 +964,7 @@ const SfxPoolItem* SfxShell::ExecuteSlot const SfxPoolItem* SfxShell::GetSlotState ( - USHORT nSlotId, // Slot-Id des zu befragenden Slots + sal_uInt16 nSlotId, // Slot-Id des zu befragenden Slots const SfxInterface* pIF, // default = 0 bedeutet virtuell besorgen SfxItemSet* pStateSet // SfxItemSet der Slot-State-Methode ) @@ -1022,13 +1019,6 @@ const SfxPoolItem* SfxShell::GetSlotState pSlot = GetVerbSlot_Impl(nSlotId); if ( !pSlot ) pSlot = pIF->GetSlot(nSlotId); - if ( !pSlot && SfxMacroConfig::IsMacroSlot( nSlotId ) ) - { - SfxMacroInfo* pInfo = SFX_APP()->GetMacroConfig()->GetMacroInfo(nSlotId); - if ( pInfo ) - pSlot = pInfo->GetSlot(); - } - if ( pSlot ) // ggf. auf Which-Id mappen nSlotId = pSlot->GetWhich( rPool ); @@ -1042,7 +1032,7 @@ const SfxPoolItem* SfxShell::GetSlotState SfxStateFunc pFunc = pSlot->GetStateFnc(); if ( pFunc ) CallState( pFunc, aSet ); - eState = aSet.GetItemState( nSlotId, TRUE, &pItem ); + eState = aSet.GetItemState( nSlotId, sal_True, &pItem ); // ggf. Default-Item besorgen if ( eState == SFX_ITEM_DEFAULT ) @@ -1099,18 +1089,18 @@ void SfxShell::SetVerbs(const com::sun::star::uno::Sequence < com::sun::star::em { SfxBindings *pBindings = pViewSh->GetViewFrame()->GetDispatcher()->GetBindings(); - USHORT nCount = pImp->aSlotArr.Count(); - for (USHORT n1=0; n1<nCount ; n1++) + sal_uInt16 nCount = pImp->aSlotArr.Count(); + for (sal_uInt16 n1=0; n1<nCount ; n1++) { - USHORT nId = SID_VERB_START + n1; - pBindings->Invalidate(nId, FALSE, TRUE); + sal_uInt16 nId = SID_VERB_START + n1; + pBindings->Invalidate(nId, sal_False, sal_True); } } - USHORT nr=0; + sal_uInt16 nr=0; for (sal_Int32 n=0; n<aVerbs.getLength(); n++) { - USHORT nSlotId = SID_VERB_START + nr++; + sal_uInt16 nSlotId = SID_VERB_START + nr++; DBG_ASSERT(nSlotId <= SID_VERB_END, "Zuviele Verben!"); if (nSlotId > SID_VERB_END) break; @@ -1142,7 +1132,7 @@ void SfxShell::SetVerbs(const com::sun::star::uno::Sequence < com::sun::star::em else pNewSlot->pNextSlot = pNewSlot; - pImp->aSlotArr.Insert(pNewSlot, (USHORT) n); + pImp->aSlotArr.Insert(pNewSlot, (sal_uInt16) n); } pImp->aVerbList = aVerbs; @@ -1153,7 +1143,7 @@ void SfxShell::SetVerbs(const com::sun::star::uno::Sequence < com::sun::star::em // abgeholt, es reicht also, ein neues StatusUpdate anzuregen SfxBindings *pBindings = pViewSh->GetViewFrame()->GetDispatcher()-> GetBindings(); - pBindings->Invalidate( SID_OBJECT, TRUE, TRUE ); + pBindings->Invalidate( SID_OBJECT, sal_True, sal_True ); } } @@ -1168,11 +1158,11 @@ const com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor >& S void SfxShell::VerbExec(SfxRequest& rReq) { - USHORT nId = rReq.GetSlot(); + sal_uInt16 nId = rReq.GetSlot(); SfxViewShell *pViewShell = GetViewShell(); if ( pViewShell ) { - BOOL bReadOnly = pViewShell->GetObjectShell()->IsReadOnly(); + sal_Bool bReadOnly = pViewShell->GetObjectShell()->IsReadOnly(); com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor > aList = pViewShell->GetVerbs(); for (sal_Int32 n=0, nVerb=0; n<aList.getLength(); n++) { @@ -1202,12 +1192,12 @@ void SfxShell::VerbState(SfxItemSet& ) //-------------------------------------------------------------------- -const SfxSlot* SfxShell::GetVerbSlot_Impl(USHORT nId) const +const SfxSlot* SfxShell::GetVerbSlot_Impl(sal_uInt16 nId) const { com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor > rList = pImp->aVerbList; DBG_ASSERT(nId >= SID_VERB_START && nId <= SID_VERB_END,"Falsche VerbId!"); - USHORT nIndex = nId - SID_VERB_START; + sal_uInt16 nIndex = nId - SID_VERB_START; DBG_ASSERT(nIndex < rList.getLength(),"Falsche VerbId!"); if (nIndex < rList.getLength()) @@ -1218,14 +1208,14 @@ const SfxSlot* SfxShell::GetVerbSlot_Impl(USHORT nId) const //-------------------------------------------------------------------- -void SfxShell::SetHelpId(ULONG nId) +void SfxShell::SetHelpId(sal_uIntPtr nId) { pImp->nHelpId = nId; } //-------------------------------------------------------------------- -ULONG SfxShell::GetHelpId() const +sal_uIntPtr SfxShell::GetHelpId() const { return pImp->nHelpId; } @@ -1249,8 +1239,8 @@ sal_Bool SfxShell::HasUIFeature( sal_uInt32 ) long DispatcherUpdate_Impl( void*, void* pArg ) { - ((SfxDispatcher*) pArg)->Update_Impl( TRUE ); - ((SfxDispatcher*) pArg)->GetBindings()->InvalidateAll(FALSE); + ((SfxDispatcher*) pArg)->Update_Impl( sal_True ); + ((SfxDispatcher*) pArg)->GetBindings()->InvalidateAll(sal_False); return 0; } @@ -1266,26 +1256,26 @@ void SfxShell::UIFeatureChanged() pImp->pUpdater = new svtools::AsynchronLink( Link( this, DispatcherUpdate_Impl ) ); // Mehrfachaufrufe gestattet - pImp->pUpdater->Call( pFrame->GetDispatcher(), TRUE ); + pImp->pUpdater->Call( pFrame->GetDispatcher(), sal_True ); } } -void SfxShell::SetDisableFlags( ULONG nFlags ) +void SfxShell::SetDisableFlags( sal_uIntPtr nFlags ) { pImp->nDisableFlags = nFlags; } -ULONG SfxShell::GetDisableFlags() const +sal_uIntPtr SfxShell::GetDisableFlags() const { return pImp->nDisableFlags; } -SfxItemSet* SfxShell::CreateItemSet( USHORT ) +SfxItemSet* SfxShell::CreateItemSet( sal_uInt16 ) { return NULL; } -void SfxShell::ApplyItemSet( USHORT, const SfxItemSet& ) +void SfxShell::ApplyItemSet( sal_uInt16, const SfxItemSet& ) { } diff --git a/sfx2/source/control/sorgitm.cxx b/sfx2/source/control/sorgitm.cxx index cb24fe34e9b6..df627a19e6fb 100644 --- a/sfx2/source/control/sorgitm.cxx +++ b/sfx2/source/control/sorgitm.cxx @@ -88,17 +88,17 @@ int SfxScriptOrganizerItem::operator==( const SfxPoolItem& rItem) const } -sal_Bool SfxScriptOrganizerItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId ) const +sal_Bool SfxScriptOrganizerItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const { String aValue; - BOOL bIsString = FALSE; + sal_Bool bIsString = sal_False; sal_Bool bValue = sal_False; nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) { case 0: case MID_SCRIPT_ORGANIZER_LANGUAGE: - bIsString = TRUE; + bIsString = sal_True; aValue = aLanguage; break; default: @@ -113,7 +113,7 @@ sal_Bool SfxScriptOrganizerItem::QueryValue( com::sun::star::uno::Any& rVal, BYT return sal_True; } -sal_Bool SfxScriptOrganizerItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId ) +sal_Bool SfxScriptOrganizerItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) { ::rtl::OUString aValue; sal_Bool bRet = sal_False; diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx index 3fdd14369856..889cf97b1b6c 100644 --- a/sfx2/source/control/statcach.cxx +++ b/sfx2/source/control/statcach.cxx @@ -366,7 +366,7 @@ void SfxStateCache::SetState ( SfxItemState eState, // <SfxItemState> von 'pState' const SfxPoolItem* pState, // Status des Slots, ggf. 0 oder -1 - BOOL bMaybeDirty + sal_Bool bMaybeDirty ) /* [Beschreibung] @@ -386,7 +386,7 @@ void SfxStateCache::SetState //-------------------------------------------------------------------- -void SfxStateCache::SetVisibleState( BOOL bShow ) +void SfxStateCache::SetVisibleState( sal_Bool bShow ) { SfxItemState eState( SFX_ITEM_AVAILABLE ); const SfxPoolItem* pState( NULL ); @@ -411,7 +411,7 @@ void SfxStateCache::SetVisibleState( BOOL bShow ) } else { - pState = new SfxVisibilityItem( nId, FALSE ); + pState = new SfxVisibilityItem( nId, sal_False ); bDeleteItem = sal_True; } @@ -438,7 +438,7 @@ void SfxStateCache::SetState_Impl ( SfxItemState eState, // <SfxItemState> von 'pState' const SfxPoolItem* pState, // Status des Slots, ggf. 0 oder -1 - BOOL bMaybeDirty + sal_Bool bMaybeDirty ) { (void)bMaybeDirty; //unused @@ -457,10 +457,10 @@ void SfxStateCache::SetState_Impl DBG_PROFSTART(SfxStateCacheSetState); // m"ussen die Controller "uberhaupt benachrichtigt werden? - FASTBOOL bNotify = bItemDirty; + bool bNotify = bItemDirty; if ( !bItemDirty ) { - FASTBOOL bBothAvailable = pLastItem && pState && + bool bBothAvailable = pLastItem && pState && !IsInvalidItem(pState) && !IsInvalidItem(pLastItem); DBG_ASSERT( !bBothAvailable || pState != pLastItem, "setting state with own item" ); if ( bBothAvailable ) @@ -504,7 +504,7 @@ void SfxStateCache::SetState_Impl // alten Status in allen Controllern nochmal setzen -void SfxStateCache::SetCachedState( BOOL bAlways ) +void SfxStateCache::SetCachedState( sal_Bool bAlways ) { DBG_MEMTEST(); DBG_CHKTHIS(SfxStateCache, 0); diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index f85d0d8e9e49..2a54e5b1c638 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -605,12 +605,12 @@ void SfxDispatchController_Impl::addParametersToArgs( const com::sun::star::util } else if ( aParamType.equalsAsciiL( URLTypeNames[URLType_BOOL], 4 )) { - // BOOL support + // sal_Bool support rArgs[nLen].Value <<= aValue.toBoolean(); } else if ( aParamType.equalsAsciiL( URLTypeNames[URLType_BYTE], 4 )) { - // BYTE support + // sal_uInt8 support rArgs[nLen].Value <<= sal_Int8( aValue.toInt32() ); } else if ( aParamType.equalsAsciiL( URLTypeNames[URLType_LONG], 4 )) @@ -650,7 +650,7 @@ void SfxDispatchController_Impl::addParametersToArgs( const com::sun::star::util SfxMapUnit SfxDispatchController_Impl::GetCoreMetric( SfxItemPool& rPool, sal_uInt16 nSlotId ) { - USHORT nWhich = rPool.GetWhich( nSlotId ); + sal_uInt16 nWhich = rPool.GetWhich( nSlotId ); return rPool.GetMetric( nWhich ); } @@ -770,7 +770,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util { const SfxSlot *pSlot = 0; if ( pDispatcher->GetShellAndSlot_Impl( GetId(), &pShell, &pSlot, sal_False, - SFX_CALLMODE_MODAL==(nCall&SFX_CALLMODE_MODAL), FALSE ) ) + SFX_CALLMODE_MODAL==(nCall&SFX_CALLMODE_MODAL), sal_False ) ) { if ( bMasterSlave ) { @@ -851,10 +851,10 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch; if ( bSuccess && pItem && !pItem->ISA(SfxVoidItem) ) { - USHORT nSubId( 0 ); + sal_uInt16 nSubId( 0 ); if ( eMapUnit == SFX_MAPUNIT_TWIP ) nSubId |= CONVERT_TWIPS; - pItem->QueryValue( aEvent.Result, (BYTE)nSubId ); + pItem->QueryValue( aEvent.Result, (sal_uInt8)nSubId ); } rListener->dispatchFinished( aEvent ); @@ -957,7 +957,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt if ( ( eState >= SFX_ITEM_AVAILABLE ) && pState && !IsInvalidItem( pState ) && !pState->ISA(SfxVoidItem) ) { // Retrieve metric from pool to have correct sub ID when calling QueryValue - USHORT nSubId( 0 ); + sal_uInt16 nSubId( 0 ); SfxMapUnit eMapUnit( SFX_MAPUNIT_100TH_MM ); // retrieve the core metric @@ -975,7 +975,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt if ( eMapUnit == SFX_MAPUNIT_TWIP ) nSubId |= CONVERT_TWIPS; - pState->QueryValue( aState, (BYTE)nSubId ); + pState->QueryValue( aState, (sal_uInt8)nSubId ); } else if ( eState == SFX_ITEM_DONTCARE ) { |