diff options
Diffstat (limited to 'sfx2/source/control/dispatch.cxx')
-rwxr-xr-x | sfx2/source/control/dispatch.cxx | 129 |
1 files changed, 31 insertions, 98 deletions
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; |