diff options
author | Albert Thuswaldner <albert.thuswaldner@gmail.com> | 2011-01-26 21:04:40 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-01-26 21:04:40 +0000 |
commit | 0fb93815ffb45273e2f44455f2065e6ed3bb8fd2 (patch) | |
tree | 517023db22d035b3b93ae6365078f48dcb7e635a /sfx2 | |
parent | 998e7286f7dd8424b6185c72c52a0b9540e53a09 (diff) |
Translations of German comments in sfx
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/bindings.cxx | 366 | ||||
-rw-r--r-- | sfx2/source/control/ctrlitem.cxx | 158 | ||||
-rw-r--r-- | sfx2/source/control/dispatch.cxx | 835 | ||||
-rw-r--r-- | sfx2/source/control/macrconf.cxx | 74 | ||||
-rw-r--r-- | sfx2/source/control/macro.cxx | 307 | ||||
-rw-r--r-- | sfx2/source/control/makefile.mk | 2 | ||||
-rw-r--r-- | sfx2/source/control/minfitem.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/control/msgpool.cxx | 42 | ||||
-rw-r--r-- | sfx2/source/control/objface.cxx | 80 |
9 files changed, 899 insertions, 969 deletions
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 906b9fb6212e..0cf096e5fc98 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -50,7 +50,7 @@ #include <comphelper/processfactory.hxx> #include <svtools/itemdel.hxx> -// wg. nInReschedule +//Includes below due to nInReschedule #include "appdata.hxx" #include <sfx2/bindings.hxx> #include <sfx2/msg.hxx> @@ -149,33 +149,33 @@ public: SfxWorkWindow* pWorkWin; SfxBindings* pSubBindings; SfxBindings* pSuperBindings; - SfxStateCacheArr_Impl* pCaches; // je ein cache fuer jede gebundene - sal_uInt16 nCachedFunc1; // index der zuletzt gerufenen - sal_uInt16 nCachedFunc2; // index der vorletzt gerufenen - sal_uInt16 nMsgPos; // Message-Position, ab der zu aktualisieren ist - SfxPopupAction ePopupAction; // in DeleteFloatinWindow() abgefragt - sal_Bool bContextChanged; - sal_Bool bMsgDirty; // wurde ein MessageServer invalidiert? - sal_Bool bAllMsgDirty; // wurden die MessageServer invalidiert? - sal_Bool bAllDirty; // nach InvalidateAll - sal_Bool bCtrlReleased; // waehrend EnterRegistrations - AutoTimer aTimer; // fuer volatile Slots - sal_Bool bInUpdate; // fuer Assertions - sal_Bool bInNextJob; // fuer Assertions - sal_Bool bFirstRound; // Erste Runde im Update - sal_uInt16 nFirstShell; // Shell, die in erster Runde bevorzugt wird - sal_uInt16 nOwnRegLevel; // z"ahlt die echten Locks, ohne die der SuperBindings - InvalidateSlotMap m_aInvalidateSlots; // store slots which are invalidated while in update + SfxStateCacheArr_Impl* pCaches; // One chache for each binding + sal_uInt16 nCachedFunc1; // index for the last one called + sal_uInt16 nCachedFunc2; // index for the second last called + sal_uInt16 nMsgPos; // Message-Position relative the one to be updated + SfxPopupAction ePopupAction; // Checked in DeleteFloatinWindow() + sal_Bool bContextChanged; + sal_Bool bMsgDirty; // Has a MessageServer been invalidated? + sal_Bool bAllMsgDirty; // Has a MessageServer been invalidated? + sal_Bool bAllDirty; // After InvalidateAll + sal_Bool bCtrlReleased; // while EnterRegistrations + AutoTimer aTimer; // for volatile Slots + sal_Bool bInUpdate; // for Assertions + sal_Bool bInNextJob; // for Assertions + sal_Bool bFirstRound; // First round in Update + sal_uInt16 nFirstShell; // Shell, the first round is prefered + sal_uInt16 nOwnRegLevel; // Counts the real Locks, exept those of the Super Bindings + InvalidateSlotMap m_aInvalidateSlots; // store slots which are invalidated while in update }; //-------------------------------------------------------------------- struct SfxFoundCache_Impl { - sal_uInt16 nSlotId; // die Slot-Id - sal_uInt16 nWhichId; // falls verf"ugbar die Which-Id, sonst nSlotId - const SfxSlot* pSlot; // Pointer auf den <Master-Slot> - SfxStateCache* pCache; // Pointer auf den StatusCache, ggf. 0 + sal_uInt16 nSlotId; // the Slot-Id + sal_uInt16 nWhichId; // If available: Which-Id, else: nSlotId + const SfxSlot* pSlot; // Pointer to <Master-Slot> + SfxStateCache* pCache; // Pointer to StatusCache, if possible NULL SfxFoundCache_Impl(): nSlotId(0), @@ -215,7 +215,7 @@ SV_IMPL_OP_PTRARR_SORT(SfxFoundCacheArr_Impl, SfxFoundCache_Impl*); SfxBindings::SfxBindings() : pImp(new SfxBindings_Impl), pDispatcher(0), - nRegLevel(1) // geht erst auf 0, wenn Dispatcher gesetzt + nRegLevel(1) // first becomes 0, when the Dispatcher is set { pImp->nMsgPos = 0; pImp->bAllMsgDirty = sal_True; @@ -245,21 +245,20 @@ SfxBindings::SfxBindings() SfxBindings::~SfxBindings() -/* [Beschreibung] +/* [Description] - Destruktor der Klasse SfxBindings. Die eine, f"ur jede <SfxApplication> - existierende Instanz wird von der <SfxApplication> nach Ausf"urhung - von <SfxApplication::Exit()> automatisch zerst"ort. + Destructor of the SfxBindings class. The one, for each <SfxApplication> + existing Instance is automaticaölly destroyed by the <SfxApplication> + after the execution of <SfxApplication::Exit()>. - Noch existierende <SfxControllerItem> Instanzen, die bei dieser - SfxBindings Instanz angemeldet sind, werden im Destruktor - automatisch zerst"ort. Dies sind i.d.R. Floating-Toolboxen, Value-Sets - etc. Arrays von SfxControllerItems d"urfen zu diesem Zeitpunkt nicht - mehr exisitieren. + The still existing <SfxControllerItem> instances, which are registered + by the SfxBindings instance, are automatically destroyed in the Destructor. + These are usually the Floating-Toolboxen, Value-Sets + etc. Arrays of SfxControllerItems may at this time no longer exist. */ { - // Die SubBindings sollen ja nicht gelocked werden ! + // The SubBindings should not be locked! pImp->pSubBindings = NULL; ENTERREGISTRATIONS(); @@ -267,7 +266,7 @@ SfxBindings::~SfxBindings() pImp->aTimer.Stop(); DeleteControllers_Impl(); - // Caches selbst l"oschen + // Delete Caches sal_uInt16 nCount = pImp->pCaches->Count(); for ( sal_uInt16 nCache = 0; nCache < nCount; ++nCache ) delete pImp->pCaches->GetObject(nCache); @@ -282,19 +281,19 @@ SfxBindings::~SfxBindings() void SfxBindings::DeleteControllers_Impl() { - // in der ersten Runde den SfxPopupWindows l"oschen + // in the first round delete SfxPopupWindows sal_uInt16 nCount = pImp->pCaches->Count(); sal_uInt16 nCache; for ( nCache = 0; nCache < nCount; ++nCache ) { - // merken wo man ist + // Remember were you are SfxStateCache *pCache = pImp->pCaches->GetObject(nCache); sal_uInt16 nSlotId = pCache->GetId(); - // SfxPopupWindow l"oschen lassen + // Delete SfxPopupWindow pCache->DeleteFloatingWindows(); - // da der Cache verkleinert worden sein kann, wiederaufsetzen + // Re-align, because the cache may have been reduced sal_uInt16 nNewCount = pImp->pCaches->Count(); if ( nNewCount < nCount ) { @@ -306,13 +305,13 @@ void SfxBindings::DeleteControllers_Impl() } } - // alle Caches l"oschen + // Delete all Caches for ( nCache = pImp->pCaches->Count(); nCache > 0; --nCache ) { - // Cache via ::com::sun::star::sdbcx::Index besorgen + // Get Cache via ::com::sun::star::sdbcx::Index SfxStateCache *pCache = pImp->pCaches->GetObject(nCache-1); - // alle Controller in dem Cache unbinden + // unbind all controllers in the cache SfxControllerItem *pNext; for ( SfxControllerItem *pCtrl = pCache->GetItemLink(); pCtrl; pCtrl = pNext ) @@ -324,7 +323,7 @@ void SfxBindings::DeleteControllers_Impl() if ( pCache->GetInternalController() ) pCache->GetInternalController()->UnBind(); - // Cache l"oschen + // Delete Cache if( nCache-1 < pImp->pCaches->Count() ) delete (*pImp->pCaches)[nCache-1]; pImp->pCaches->Remove(nCache-1, 1); @@ -339,7 +338,7 @@ void SfxBindings::DeleteControllers_Impl() pCtrl->ReleaseBindings(); } - DBG_ASSERT( !pImp->pUnoCtrlArr->Count(), "UnoControllerItems nicht entfernt!" ); + DBG_ASSERT( !pImp->pUnoCtrlArr->Count(), "Do not remove UnoControllerItems!" ); DELETEZ( pImp->pUnoCtrlArr ); } } @@ -356,7 +355,7 @@ SfxPopupAction SfxBindings::GetPopupAction_Impl() const void SfxBindings::HidePopups( bool bHide ) { - // SfxPopupWindows hiden + // Hide SfxPopupWindows HidePopupCtrls_Impl( bHide ); SfxBindings *pSub = pImp->pSubBindings; while ( pSub ) @@ -365,7 +364,7 @@ void SfxBindings::HidePopups( bool bHide ) pSub = pSub->pImp->pSubBindings; } - // SfxChildWindows hiden + // Hide SfxChildWindows DBG_ASSERT( pDispatcher, "HidePopups not allowed without dispatcher" ); if ( pImp->pWorkWin ) pImp->pWorkWin->HidePopups_Impl( bHide, sal_True ); @@ -375,12 +374,12 @@ void SfxBindings::HidePopupCtrls_Impl( bool bHide ) { if ( bHide ) { - // SfxPopupWindows hiden + // Hide SfxPopupWindows pImp->ePopupAction = SFX_POPUP_HIDE; } else { - // SfxPopupWindows showen + // Show SfxPopupWindows pImp->ePopupAction = SFX_POPUP_SHOW; } @@ -393,7 +392,7 @@ void SfxBindings::HidePopupCtrls_Impl( bool bHide ) void SfxBindings::Update_Impl ( - SfxStateCache* pCache // der upzudatende SfxStatusCache + SfxStateCache* pCache // The up to date SfxStatusCache ) { if( pCache->GetDispatch().is() && pCache->GetItemLink() ) @@ -407,7 +406,7 @@ void SfxBindings::Update_Impl return; DBG_PROFSTART(SfxBindingsUpdate_Impl); - // alle mit derselben Statusmethode zusammensammeln, die dirty sind + // gather together all with the same status method which are dirty SfxDispatcher &rDispat = *pDispatcher; const SfxSlot *pRealSlot = 0; const SfxSlotServer* pMsgServer = 0; @@ -416,10 +415,10 @@ void SfxBindings::Update_Impl sal_Bool bUpdated = sal_False; if ( pSet ) { - // Status erfragen + // Query Status if ( rDispat._FillState( *pMsgServer, *pSet, pRealSlot ) ) { - // Status posten + // Post Status const SfxInterface *pInterface = rDispat.GetShell(pMsgServer->GetShellLevel())->GetInterface(); for ( sal_uInt16 nPos = 0; nPos < aFound.Count(); ++nPos ) @@ -440,8 +439,9 @@ void SfxBindings::Update_Impl if ( !bUpdated && pCache ) { - // Wenn pCache == NULL und kein SlotServer ( z.B. weil Dispatcher gelockt! ), - // darf nat"urlich kein Update versucht werden + // When pCache == NULL and no SlotServer + // (for example due to locked Dispatcher! ), + // obviously do not try to update SfxFoundCache_Impl aFoundCache( pCache->GetId(), 0, pRealSlot, pCache ); @@ -475,13 +475,13 @@ void SfxBindings::AddSlotToInvalidateSlotsMap_Impl( USHORT nId ) void SfxBindings::Update ( - sal_uInt16 nId // die gebundene und upzudatende Slot-Id + sal_uInt16 nId // the bound and up-to-date Slot-Id ) { DBG_MEMTEST(); DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" ); -//!!TLX: Fuehrte zu Vorlagenkatalogstillstand +//!!TLX: leads to Template Gallery freeze // if ( nRegLevel ) // return; @@ -512,7 +512,7 @@ void SfxBindings::Update if ( bInternalUpdate ) { - // Status erfragen + // Query Status const SfxSlotServer* pMsgServer = pCache->GetSlotServer(*pDispatcher, pImp->xProv); if ( !pCache->IsControllerDirty() && ( !pMsgServer || @@ -570,10 +570,10 @@ void SfxBindings::Update() void SfxBindings::SetState ( - const SfxItemSet& rSet // zu setzende Status-Werte + const SfxItemSet& rSet // status values to be set ) { - // wenn gelockt, dann nur invalidieren + // when locked then only invalidate if ( nRegLevel ) { SfxItemIter aIter(rSet); @@ -584,12 +584,12 @@ void SfxBindings::SetState } else { - // Status d"urfen nur angenommen werden, wenn alle Slot-Pointer gesetzt sind + // Status may be accepted only if all slot-pointers are set if ( pImp->bMsgDirty ) UpdateSlotServer_Impl(); - // "uber das ItemSet iterieren, falls Slot gebunden, updaten - //! Bug: WhichIter verwenden und ggf. VoidItems hochschicken + // Iterate over the itemset, update if the slot bound + //! Bug: Use WhichIter and possibly send VoidItems up SfxItemIter aIter(rSet); for ( const SfxPoolItem *pItem = aIter.FirstItem(); pItem; @@ -599,12 +599,12 @@ void SfxBindings::SetState GetStateCache( rSet.GetPool()->GetSlotId(pItem->Which()) ); if ( pCache ) { - // Status updaten + // Update status if ( !pCache->IsControllerDirty() ) pCache->Invalidate(sal_False); pCache->SetState( SFX_ITEM_AVAILABLE, pItem ); - //! nicht implementiert: Updates von EnumSlots via MasterSlots + //! Not implemented: Updates from EnumSlots via master slots } } } @@ -614,7 +614,7 @@ void SfxBindings::SetState void SfxBindings::SetState ( - const SfxPoolItem& rItem // zu setzender Status-Wert + const SfxPoolItem& rItem // Status value to be set ) { if ( nRegLevel ) @@ -623,22 +623,22 @@ void SfxBindings::SetState } else { - // Status d"urfen nur angenommen werden, wenn alle Slot-Pointer gesetzt sind + // Status may be accepted only if all slot-pointers are set if ( pImp->bMsgDirty ) UpdateSlotServer_Impl(); - // falls der Slot gebunden ist, updaten + //update if the slot bound DBG_ASSERT( SfxItemPool::IsSlot( rItem.Which() ), "cannot set items with which-id" ); SfxStateCache* pCache = GetStateCache( rItem.Which() ); if ( pCache ) { - // Status updaten + // Update Status if ( !pCache->IsControllerDirty() ) pCache->Invalidate(sal_False); pCache->SetState( SFX_ITEM_AVAILABLE, &rItem ); - //! nicht implementiert: Updates von EnumSlots via MasterSlots + //! Not implemented: Updates from EnumSlots via master slots } } } @@ -656,13 +656,11 @@ SfxStateCache* SfxBindings::GetAnyStateCache_Impl( sal_uInt16 nId ) SfxStateCache* SfxBindings::GetStateCache ( - sal_uInt16 nId /* Slot-Id, deren SfxStatusCache gefunden - werden soll */, - sal_uInt16* pPos /* 0 bzw. Position, ab der die Bindings - bin"ar durchsucht werden sollen. Liefert - die Position zur"uck, an der nId gefunden - wurde, bzw. an der es einfef"ugt werden - w"urde. */ + sal_uInt16 nId, /* Slot-Id, which SfxStatusCache is to be found */ + sal_uInt16* pPos /* NULL for instance the position from which the + bindings are to be searched binary. Returns the + position back for where the nId was found, + or where it was inserted. */ ) { DBG_MEMTEST(); @@ -685,11 +683,8 @@ SfxStateCache* SfxBindings::GetStateCache void SfxBindings::InvalidateAll ( - sal_Bool bWithMsg /* sal_True - Slot-Server als ung"ultig markieren - - sal_False - Slot-Server bleiben g"ultig */ + sal_Bool bWithMsg /* sal_True Mark Slot Server as invalid + sal_False Slot Server remains valid */ ) { DBG_PROFSTART(SfxBindingsInvalidateAll); @@ -700,7 +695,7 @@ void SfxBindings::InvalidateAll if ( pImp->pSubBindings ) pImp->pSubBindings->InvalidateAll( bWithMsg ); - // ist schon alles dirty gesetzt oder downing => nicht zu tun + // everything is already set dirty or downing => nothing to do if ( !pDispatcher || ( pImp->bAllDirty && ( !bWithMsg || pImp->bAllMsgDirty ) ) || SFX_APP()->IsDowning() ) @@ -739,8 +734,8 @@ void SfxBindings::InvalidateAll void SfxBindings::Invalidate ( - const sal_uInt16* pIds /* numerisch sortiertes 0-terminiertes Array - von Slot-Ids (einzel, nicht als Paare!) */ + const sal_uInt16* pIds /* numerically sorted NULL-terminated array of + slot IDs (individual, not as a couple!) */ ) { DBG_PROFSTART(SfxBindingsInvalidateAll); @@ -762,27 +757,27 @@ void SfxBindings::Invalidate if ( pImp->pSubBindings ) pImp->pSubBindings->Invalidate( pIds ); - // ist schon alles dirty gesetzt oder downing => nicht zu tun + // everything is already set dirty or downing => nothing to do if ( !pDispatcher || pImp->bAllDirty || SFX_APP()->IsDowning() ) return; - // in immer kleiner werdenden Berichen bin"ar suchen + // Search binary in always smaller areas for ( sal_uInt16 n = GetSlotPos(*pIds); *pIds && n < pImp->pCaches->Count(); n = GetSlotPos(*pIds, n) ) { - // falls SID "uberhaupt gebunden ist, den Cache invalidieren + // If SID is ever bound, then invalidate the cache SfxStateCache *pCache = pImp->pCaches->GetObject(n); if ( pCache->GetId() == *pIds ) pCache->Invalidate(sal_False); - // n"achste SID + // Next SID if ( !*++pIds ) break; DBG_ASSERT( *pIds > *(pIds-1), "pIds unsorted" ); } - // falls nicht gelockt, Update-Timer starten + // if not enticed to start update timer pImp->nMsgPos = 0; if ( !nRegLevel ) { @@ -800,17 +795,15 @@ void SfxBindings::Invalidate void SfxBindings::InvalidateShell ( - const SfxShell& rSh /* Die <SfxShell>, deren Slot-Ids - invalidiert werden sollen. */, - - sal_Bool bDeep /* sal_True - auch die, von der SfxShell - ererbten Slot-Ids werden invalidert - - sal_False - die ererbten und nicht "uberladenen - Slot-Ids werden invalidiert */ - //! MI: z. Zt. immer bDeep + const SfxShell& rSh, /* <SfxShell>, which Slot-Ids should be + invalidated */ + sal_Bool bDeep /* sal_True + also inherited slot IDs of SfxShell are invalidert + + sal_False + the inherited and not overloaded Slot-Ids were + invalidiert */ + //! MI: for now alwayds bDeep ) { DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" ); @@ -832,11 +825,11 @@ void SfxBindings::InvalidateShell ( pImp->bAllDirty && pImp->bAllMsgDirty ) || SFX_APP()->IsDowning() ) { - // Wenn sowieso demn"achst alle Server geholt werden + // if the next one is anyway, then all the servers are collected return; } - // Level finden + // Find Level sal_uInt16 nLevel = pDispatcher->GetShellLevel(rSh); if ( nLevel != USHRT_MAX ) { @@ -866,7 +859,7 @@ void SfxBindings::InvalidateShell void SfxBindings::Invalidate ( - sal_uInt16 nId // zu invalidierende Slot-Id + sal_uInt16 nId // Status value to be set ) { DBG_MEMTEST(); @@ -904,9 +897,9 @@ void SfxBindings::Invalidate void SfxBindings::Invalidate ( - sal_uInt16 nId, // zu invalidierende Slot-Id - sal_Bool bWithItem, // StateCache clearen ? - sal_Bool bWithMsg // SlotServer neu holen ? + sal_uInt16 nId, // Status value to be set + sal_Bool bWithItem, // Clear StateCache? + sal_Bool bWithMsg // Get new SlotServer? ) { DBG_MEMTEST(); @@ -995,7 +988,7 @@ sal_uInt16 SfxBindings::GetSlotPos( sal_uInt16 nId, sal_uInt16 nStartSearchAt ) while ( !bFound && nLow <= nHigh ) { nMid = (nLow + nHigh) >> 1; - DBG_ASSERT( nMid < pImp->pCaches->Count(), "bsearch ist buggy" ); + DBG_ASSERT( nMid < pImp->pCaches->Count(), "bsearch is buggy" ); int nDiff = (int) nId - (int) ( ((*pImp->pCaches)[nMid])->GetId() ); if ( nDiff < 0) { if ( nMid == 0 ) @@ -1271,7 +1264,8 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell if ( SFX_KIND_ENUM == pSlot->GetKind() ) { - // bei Enum-Slots muss der Master mit dem Wert des Enums executet werden + // for Enum-Slots, the Master has to be excecuted with the value + // of the enums Wert const SfxSlot *pRealSlot = pShell->GetInterface()->GetRealSlot(pSlot); const sal_uInt16 nSlotId = pRealSlot->GetSlotId(); aReq.SetSlot( nSlotId ); @@ -1280,12 +1274,12 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell } else if ( SFX_KIND_ATTR == pSlot->GetKind() ) { - // bei Attr-Slots muss der Which-Wert gemapped werden + // Which value has to be mapped for Attribute slots const sal_uInt16 nSlotId = pSlot->GetSlotId(); aReq.SetSlot( nSlotId ); if ( pSlot->IsMode(SFX_SLOT_TOGGLE) ) { - // an togglebare-Attribs (Bools) wird der Wert angeheangt + // The value is attached to a toggleable attribute (Bools) sal_uInt16 nWhich = pSlot->GetWhich(rPool); SfxItemSet aSet(rPool, nWhich, nWhich, 0); SfxStateFunc aFunc = pSlot->GetStateFnc(); @@ -1305,7 +1299,7 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell { if ( pOldItem->ISA(SfxBoolItem) ) { - // wir koennen Bools toggeln + // we can toggle Bools sal_Bool bOldValue = ((const SfxBoolItem *)pOldItem)->GetValue(); SfxBoolItem *pNewItem = (SfxBoolItem*) (pOldItem->Clone()); pNewItem->SetValue( !bOldValue ); @@ -1315,7 +1309,7 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell else if ( pOldItem->ISA(SfxEnumItemInterface) && ((SfxEnumItemInterface *)pOldItem)->HasBoolValue()) { - // und Enums mit Bool-Interface + // and Enums with Bool-Interface SfxEnumItemInterface *pNewItem = (SfxEnumItemInterface*) (pOldItem->Clone()); pNewItem->SetBoolValue(!((SfxEnumItemInterface *)pOldItem)->GetBoolValue()); @@ -1328,21 +1322,21 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell } else if ( SFX_ITEM_DONTCARE == eState ) { - // ein Status-Item per Factory erzeugen + // Create one Status-Item for each Factory SfxPoolItem *pNewItem = pSlot->GetType()->CreateItem(); DBG_ASSERT( pNewItem, "Toggle an Slot ohne ItemFactory" ); pNewItem->SetWhich( nWhich ); if ( pNewItem->ISA(SfxBoolItem) ) { - // wir koennen Bools toggeln + // we can toggle Bools ((SfxBoolItem*)pNewItem)->SetValue( sal_True ); aReq.AppendItem( *pNewItem ); } else if ( pNewItem->ISA(SfxEnumItemInterface) && ((SfxEnumItemInterface *)pNewItem)->HasBoolValue()) { - // und Enums mit Bool-Interface + // and Enums with Bool-Interface ((SfxEnumItemInterface*)pNewItem)->SetBoolValue(sal_True); aReq.AppendItem( *pNewItem ); } @@ -1370,7 +1364,7 @@ void SfxBindings::UpdateSlotServer_Impl() DBG_MEMTEST(); DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" ); - // synchronisieren + // synchronize pDispatcher->Flush(); // pDispatcher->Update_Impl(); @@ -1409,9 +1403,9 @@ int __cdecl CmpUS_Impl(const void *p1, const void *p2) int CmpUS_Impl(const void *p1, const void *p2) #endif -/* [Beschreibung] +/* [Description] - Interne Vergleichsfunktion fuer qsort. + Internal Comparison function for qsort. */ { @@ -1422,10 +1416,10 @@ int CmpUS_Impl(const void *p1, const void *p2) SfxItemSet* SfxBindings::CreateSet_Impl ( - SfxStateCache*& pCache, // in: Status-Cache von nId - const SfxSlot*& pRealSlot, // out: RealSlot zu nId - const SfxSlotServer** pMsgServer, // out: Slot-Server zu nId - SfxFoundCacheArr_Impl& rFound // out: Liste der Caches der Siblings + SfxStateCache*& pCache, // in: Status-Cache from nId + const SfxSlot*& pRealSlot, // out: RealSlot to nId + const SfxSlotServer** pMsgServer, // out: Slot-Server to nId + SfxFoundCacheArr_Impl& rFound // out: List of Caches for Siblings ) { DBG_MEMTEST(); @@ -1443,30 +1437,30 @@ SfxItemSet* SfxBindings::CreateSet_Impl sal_uInt16 nShellLevel = pMsgSvr->GetShellLevel(); SfxShell *pShell = pDispatcher->GetShell( nShellLevel ); - if ( !pShell ) // seltener GPF beim Browsen durch Update aus Inet-Notify + if ( !pShell ) // rare GPF when browsing through update from Inet-Notify return 0; SfxItemPool &rPool = pShell->GetPool(); - // hole die Status-Methode, von der pCache bedient wird + // get the status method, which is served by the pCache SfxStateFunc pFnc = 0; const SfxInterface *pInterface = pShell->GetInterface(); if ( SFX_KIND_ENUM == pMsgSvr->GetSlot()->GetKind() ) { pRealSlot = pInterface->GetRealSlot(pMsgSvr->GetSlot()); pCache = GetStateCache( pRealSlot->GetSlotId() ); -// DBG_ASSERT( pCache, "Kein Slotcache fuer den Masterslot gefunden!" ); +// DBG_ASSERT( pCache, "No slot cache found for the master slot!" ); } else pRealSlot = pMsgSvr->GetSlot(); // - // Achtung: pCache darf auch NULL sein !!! + // Note: pCache can be NULL! // pFnc = pRealSlot->GetStateFnc(); - // der RealSlot ist immer drin + // the RealSlot is always on const SfxFoundCache_Impl *pFound = new SfxFoundCache_Impl( pRealSlot->GetSlotId(), pRealSlot->GetWhich(rPool), pRealSlot, pCache ); rFound.Insert( pFound ); @@ -1475,24 +1469,23 @@ SfxItemSet* SfxBindings::CreateSet_Impl if ( !SfxMacroConfig::IsMacroSlot( nSlot ) && !(nSlot >= SID_VERB_START && nSlot <= SID_VERB_END) ) { pInterface = pInterface->GetRealInterfaceForSlot( pRealSlot ); - DBG_ASSERT (pInterface,"Slot in angegebener Shell nicht gefunden!"); + DBG_ASSERT (pInterface,"Slot in the given shell is not found"); } - // Durchsuche die Bindings nach den von derselben Funktion bedienten Slots. - // Daf"ur kommen nur Slots in Frage, die es im gefundenen Interface gibt. + // Search through the bindings for slots served by the same function. This , // will only affect slots which are present in the found interface. - // Die Position des Statecaches im StateCache-Array + // The position of the Statecaches in StateCache-Array sal_uInt16 nCachePos = pImp->nMsgPos; const SfxSlot *pSibling = pRealSlot->GetNextSlot(); - // Die Slots eines Interfaces sind im Kreis verkettet + // the Slots odf a interfaces ar linked in a circle while ( pSibling > pRealSlot ) { SfxStateFunc pSiblingFnc=0; SfxStateCache *pSiblingCache = GetStateCache( pSibling->GetSlotId(), &nCachePos ); - // Ist der Slot "uberhaupt gecached ? + // Is the slot cached ? if ( pSiblingCache ) { const SfxSlotServer *pServ = pSiblingCache->GetSlotServer(*pDispatcher, pImp->xProv); @@ -1500,34 +1493,34 @@ SfxItemSet* SfxBindings::CreateSet_Impl pSiblingFnc = pServ->GetSlot()->GetStateFnc(); } - // Mu\s der Slot "uberhaupt upgedatet werden ? + // Does the slot have to be updated at all? bool bInsert = pSiblingCache && pSiblingCache->IsControllerDirty(); - // Bugfix #26161#: Es reicht nicht, nach der selben Shell zu fragen !! + // Bugfix #26161#: It is not enough to ask for the same shell!! 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. + // If the slot is a non-dirty master slot, then maybe one of his slaves + // is dirty? Then the master slot is still inserted. if ( !bInsert && bSameMethod && pSibling->GetLinkedSlot() ) { - // auch Slave-Slots auf Binding pru"fen + // Also check slave slots for Binding const SfxSlot* pFirstSlave = pSibling->GetLinkedSlot(); for ( const SfxSlot *pSlaveSlot = pFirstSlave; !bInsert; pSlaveSlot = pSlaveSlot->GetNextSlot()) { - // Die Slaves zeigen auf ihren Master + // the slaves points to its master DBG_ASSERT(pSlaveSlot->GetLinkedSlot() == pSibling, - "Falsche Master/Slave-Beziehung!"); + "Wrong Master/Slave relationship!"); sal_uInt16 nCurMsgPos = pImp->nMsgPos; const SfxStateCache *pSlaveCache = GetStateCache( pSlaveSlot->GetSlotId(), &nCurMsgPos ); - // Ist der Slave-Slot gecached und dirty ? + // Is the slave slot chached and dirty ? bInsert = pSlaveCache && pSlaveCache->IsControllerDirty(); - // Slaves sind untereinander im Kreis verkettet + // Slaves are chained together in a circle if (pSlaveSlot->GetNextSlot() == pFirstSlave) break; } @@ -1545,20 +1538,20 @@ SfxItemSet* SfxBindings::CreateSet_Impl pSibling = pSibling->GetNextSlot(); } - // aus den Ranges ein Set erzeugen + // Create a Set from the ranges sal_uInt16 *pRanges = new sal_uInt16[rFound.Count() * 2 + 1]; int j = 0; USHORT i = 0; while ( i < rFound.Count() ) { pRanges[j++] = rFound[i]->nWhichId; - // aufeinanderfolgende Zahlen + // consecutive numbers for ( ; i < rFound.Count()-1; ++i ) if ( rFound[i]->nWhichId+1 != rFound[i+1]->nWhichId ) break; pRanges[j++] = rFound[i++]->nWhichId; } - pRanges[j] = 0; // terminierende NULL + pRanges[j] = 0; // terminating NULL SfxItemSet *pSet = new SfxItemSet(rPool, pRanges); delete [] pRanges; DBG_PROFSTOP(SfxBindingsCreateSet); @@ -1569,7 +1562,7 @@ SfxItemSet* SfxBindings::CreateSet_Impl void SfxBindings::UpdateControllers_Impl ( - const SfxInterface* pIF, // das diese Id momentan bedienende Interface + const SfxInterface* pIF, // Id of the current serving Interface const SfxFoundCache_Impl* pFound, // Cache, Slot, Which etc. const SfxPoolItem* pItem, // item to send to controller SfxItemState eState // state of item @@ -1583,18 +1576,18 @@ void SfxBindings::UpdateControllers_Impl const SfxSlot* pSlot = pFound->pSlot; DBG_ASSERT( !pCache || !pSlot || pCache->GetId() == pSlot->GetSlotId(), "SID mismatch" ); - // insofern gebunden, die Controller f"uer den Slot selbst updaten + // bound until now, the Controller to update the Slot. if ( pCache && pCache->IsControllerDirty() ) { if ( SFX_ITEM_DONTCARE == eState ) { - // uneindeuting + // ambiguous pCache->SetState( SFX_ITEM_DONTCARE, (SfxPoolItem *)-1 ); } else if ( SFX_ITEM_DEFAULT == eState && pFound->nWhichId > SFX_WHICH_MAX ) { - // kein Status oder Default aber ohne Pool + // no Status or Default but without Pool SfxVoidItem aVoid(0); pCache->SetState( SFX_ITEM_UNKNOWN, &aVoid ); } @@ -1606,8 +1599,8 @@ void SfxBindings::UpdateControllers_Impl DBG_PROFSTOP(SfxBindingsUpdateCtrl1); - // insofern vorhanden und gebunden, die Controller f"uer Slave-Slots - // (Enum-Werte) des Slots updaten + // Update the slots for so far available and bound Controllers for + // Slave-Slots (Enum-value) DBG_PROFSTART(SfxBindingsUpdateCtrl2); DBG_ASSERT( !pSlot || 0 == pSlot->GetLinkedSlot() || !pItem || pItem->ISA(SfxEnumItemInterface), @@ -1615,7 +1608,7 @@ void SfxBindings::UpdateControllers_Impl const SfxSlot *pFirstSlave = pSlot ? pSlot->GetLinkedSlot() : 0; if ( pIF && pFirstSlave) { - // Items auf EnumItem casten + // Items cast on EnumItem const SfxEnumItemInterface *pEnumItem = PTR_CAST(SfxEnumItemInterface,pItem); if ( eState == SFX_ITEM_AVAILABLE && !pEnumItem ) @@ -1623,14 +1616,14 @@ void SfxBindings::UpdateControllers_Impl else eState = SfxControllerItem::GetItemState( pEnumItem ); - // "uber alle Slaves-Slots iterieren + // Iterate over all Slaves-Slots for ( const SfxSlot *pSlave = pFirstSlave; pSlave; pSlave = pSlave->GetNextSlot() ) { - DBG_ASSERT(pSlave, "Falsche SlaveSlot-Verkettung!"); + DBG_ASSERT(pSlave, "Wrong SlaveSlot binding!"); DBG_ASSERT(SFX_KIND_ENUM == pSlave->GetKind(),"non enum slaves aren't allowed"); DBG_ASSERT(pSlave->GetMasterSlotId() == pSlot->GetSlotId(),"falscher MasterSlot!"); - // ist die Funktion gebunden? + // Binding exist for function ? SfxStateCache *pEnumCache = GetStateCache( pSlave->GetSlotId() ); if ( pEnumCache ) { @@ -1655,14 +1648,14 @@ void SfxBindings::UpdateControllers_Impl } else if ( SFX_ITEM_AVAILABLE == eState ) { - // enum-Wert ermitteln + // Determine enum value sal_uInt16 nValue = pEnumItem->GetEnumValue(); SfxBoolItem aBool( pFound->nWhichId, pSlave->GetValue() == nValue ); pEnumCache->SetState(SFX_ITEM_AVAILABLE, &aBool); } else { - // uneindeuting + // ambiguous pEnumCache->SetState( SFX_ITEM_DONTCARE, (SfxPoolItem *)-1 ); } } @@ -1681,8 +1674,8 @@ void SfxBindings::UpdateControllers_Impl IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) { #ifdef DBG_UTIL - // on Windows very often C++ Exceptions (GPF etc.) are caught by MSVCRT or another MS library - // try to get them here + // on Windows very often C++ Exceptions (GPF etc.) are caught by MSVCRT + // or another MS library try to get them here try { #endif @@ -1720,7 +1713,7 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) return sal_True; } - // gfs. alle Server aktualisieren / geschieht in eigener Zeitscheibe + // if possible Update all server / happens in its own time slice if ( pImp->bMsgDirty ) { UpdateSlotServer_Impl(); @@ -1743,7 +1736,7 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) // iterate through the bound functions sal_Bool bJobDone = sal_False; while ( !bJobDone ) - { + { SfxStateCache* pCache = (*pImp->pCaches)[pImp->nMsgPos]; DBG_ASSERT( pCache, "invalid SfxStateCache-position in job queue" ); sal_Bool bWasDirty = pCache->IsControllerDirty(); @@ -1753,8 +1746,6 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) sal_Bool bSkip = sal_False; if ( pImp->bFirstRound ) { - // Falls beim Update eine Shell vorgezogen werden soll, - // kommt in einer ersten Update-Runde nur diese dran const SfxSlotServer *pMsgServer = pCache->GetSlotServer(*pDispatcher, pImp->xProv); if ( pMsgServer && @@ -1778,8 +1769,9 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) bJobDone = pImp->nMsgPos >= nCount; if ( bJobDone && pImp->bFirstRound ) { - // Update der bevorzugten Shell ist gelaufen, nun d"urfen - // auch die anderen + + // Update of the preferred shell has been done, now may + // also the others shells be updated bJobDone = sal_False; pImp->bFirstRound = sal_False; pImp->nMsgPos = 0; @@ -1814,7 +1806,7 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) else pImp->aTimer.Stop(); - // Update-Runde ist beendet + // Update round is finished pImp->bInNextJob = sal_False; Broadcast(SfxSimpleHint(SFX_HINT_UPDATEDONE)); DBG_PROFSTOP(SfxBindingsNextJob_Impl); @@ -1858,15 +1850,15 @@ sal_uInt16 SfxBindings::EnterRegistrations(const char *pFile, int nLine) DbgTrace( aMsg.GetBuffer() ); #endif - // Wenn Bindings gelockt werden, auch SubBindings locken + // When bindings are locked, also lock sub bindings. if ( pImp->pSubBindings ) { pImp->pSubBindings->ENTERREGISTRATIONS(); - // Dieses EnterRegistrations ist f"ur die SubBindings kein "echtes" + // These EnterRegistrations are not "real" for the SubBindings pImp->pSubBindings->pImp->nOwnRegLevel--; - // Bindings synchronisieren + // Synchronize Bindings pImp->pSubBindings->nRegLevel = nRegLevel + pImp->pSubBindings->pImp->nOwnRegLevel + 1; } @@ -1882,7 +1874,7 @@ sal_uInt16 SfxBindings::EnterRegistrations(const char *pFile, int nLine) pImp->nCachedFunc1 = 0; pImp->nCachedFunc2 = 0; - // merken, ob ganze Caches verschwunden sind + // Mark if the all of the Caches have dissapered. pImp->bCtrlReleased = sal_False; } @@ -1899,14 +1891,14 @@ void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int DBG_ASSERT( nRegLevel, "Leave without Enter" ); DBG_ASSERT( nLevel == USHRT_MAX || nLevel == nRegLevel, "wrong Leave" ); - // Nur wenn die SubBindings noch von den SuperBindings gelockt sind, diesen Lock entfernen - // ( d.h. wenn es mehr Locks als "echte" Locks dort gibt ) + // Only when the SubBindings are still locked by the Superbindings, + // remove this lock (i.e. if there are more locks than "real" ones) if ( pImp->pSubBindings && pImp->pSubBindings->nRegLevel > pImp->pSubBindings->pImp->nOwnRegLevel ) { - // Bindings synchronisieren + // Synchronize Bindings pImp->pSubBindings->nRegLevel = nRegLevel + pImp->pSubBindings->pImp->nOwnRegLevel; - // Dieses LeaveRegistrations ist f"ur die SubBindings kein "echtes" + // This LeaveRegistrations is not "real" for SubBindings pImp->pSubBindings->pImp->nOwnRegLevel++; pImp->pSubBindings->LEAVEREGISTRATIONS(); } @@ -1929,25 +1921,25 @@ void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int #ifndef slow SfxViewFrame* pFrame = pDispatcher->GetFrame(); - // ggf unbenutzte Caches entfernen bzw. PlugInInfo aufbereiten + // If possible remove unused Caches, for example prepare PlugInInfo if ( pImp->bCtrlReleased ) { for ( sal_uInt16 nCache = pImp->pCaches->Count(); nCache > 0; --nCache ) { - // Cache via ::com::sun::star::sdbcx::Index besorgen + // Get Cache via ::com::sun::star::sdbcx::Index SfxStateCache *pCache = pImp->pCaches->GetObject(nCache-1); - // kein Controller mehr interessiert + // No interested Controller present if ( pCache->GetItemLink() == 0 && !pCache->GetInternalController() ) { - // Cache entfernen. Safety: first remove and then delete + // Remove Cache. Safety: first remove and then delete SfxStateCache* pSfxStateCache = (*pImp->pCaches)[nCache-1]; pImp->pCaches->Remove(nCache-1, 1); delete pSfxStateCache; } else { - // neue Controller mit den alten Items benachrichtigen + // new controller to notify the old items //!pCache->SetCachedState(); } } @@ -1994,7 +1986,7 @@ const SfxSlot* SfxBindings::GetSlot(sal_uInt16 nSlotId) DBG_MEMTEST(); DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" ); - // syncronisieren + // synchronizing pDispatcher->Flush(); if ( pImp->bMsgDirty ) UpdateSlotServer_Impl(); @@ -2038,7 +2030,7 @@ void SfxBindings::SetDispatcher( SfxDispatcher *pDisp ) { if ( pImp->pSubBindings && pImp->pSubBindings->pDispatcher != pOldDispat ) { - DBG_ERROR( "SubBindings vor Aktivieren schon gesetzt!" ); + DBG_ERROR( "SubBindings already set before activating!" ); pImp->pSubBindings->ENTERREGISTRATIONS(); } LEAVEREGISTRATIONS(); @@ -2048,7 +2040,7 @@ void SfxBindings::SetDispatcher( SfxDispatcher *pDisp ) ENTERREGISTRATIONS(); if ( pImp->pSubBindings && pImp->pSubBindings->pDispatcher != pOldDispat ) { - DBG_ERROR( "SubBindings im Deaktivieren immer noch gesetzt!" ); + DBG_ERROR( "SubBindings still set even when deactivating!" ); pImp->pSubBindings->LEAVEREGISTRATIONS(); } } @@ -2086,10 +2078,10 @@ void SfxBindings::StartUpdate_Impl( sal_Bool bComplete ) pImp->pSubBindings->StartUpdate_Impl( bComplete ); if ( !bComplete ) - // Update darf unterbrochen werden + // Update may be interrupted NextJob_Impl(&pImp->aTimer); else - // alle Slots am St"uck updaten + // Update all slots in a row NextJob_Impl(0); } @@ -2190,14 +2182,14 @@ SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, SfxPoolItem* &rpState ) } } - // Dann am Dispatcher testen; da die von dort zur"uckgegebenen Items immer - // DELETE_ON_IDLE sind, mu\s eine Kopie davon gezogen werden, um einen - // Eigent"umer"ubergang zu erm"oglichen + // Then test at the dispatcher to check if the returned items from + // there are always DELETE_ON_IDLE, a copy of it has to be made in + // order to allow for transition of ownership. const SfxPoolItem *pItem = NULL; SfxItemState eState = pDispatcher->QueryState( nSlot, pItem ); if ( eState == SFX_ITEM_SET ) { - DBG_ASSERT( pItem, "SFX_ITEM_SET aber kein Item!" ); + DBG_ASSERT( pItem, "SFX_ITEM_SET but no item!" ); if ( pItem ) rpState = pItem->Clone(); } diff --git a/sfx2/source/control/ctrlitem.cxx b/sfx2/source/control/ctrlitem.cxx index 95af73c410d5..20aede76b4ed 100644 --- a/sfx2/source/control/ctrlitem.cxx +++ b/sfx2/source/control/ctrlitem.cxx @@ -46,11 +46,11 @@ DBG_NAME(SfxControllerItem); void SfxControllerItem::CheckConfigure_Impl( ULONG nType ) { - // echter Slot? (also kein Separator etc.) + // Real Slot? (i.e. no Separator etc.) if ( !nId ) return; - // ist die Id "uberhaupt in 'nType' konfigurierbar? + // is the ID configurable at all in 'nType'? const SfxSlot *pSlot = SFX_SLOTPOOL().GetSlot(nId); DBG_ASSERTWARNING( pSlot, "SfxControllerItem: binding not existing slot" ); if ( pSlot && !pSlot->IsMode(nType) ) @@ -64,7 +64,6 @@ void SfxControllerItem::CheckConfigure_Impl( ULONG nType ) #endif //-------------------------------------------------------------------- - // returns the next registered SfxControllerItem with the same id SfxControllerItem* SfxControllerItem::GetItemLink() @@ -75,7 +74,6 @@ SfxControllerItem* SfxControllerItem::GetItemLink() } //-------------------------------------------------------------------- - // returns TRUE if this binding is really bound to a function BOOL SfxControllerItem::IsBound() const @@ -86,23 +84,21 @@ BOOL SfxControllerItem::IsBound() const } //-------------------------------------------------------------------- - // returns the associated function-id or 0 if none // USHORT SfxControllerItem::GetId() const; //==================================================================== - // registeres with the id at the bindings void SfxControllerItem::Bind( USHORT nNewId, SfxBindings *pBindinx ) { DBG_MEMTEST(); DBG_CHKTHIS(SfxControllerItem, 0); - DBG_ASSERT(pBindings || pBindinx, "Keine Bindings"); + DBG_ASSERT(pBindings || pBindinx, "No Bindings"); if ( IsBound() ) { - DBG_ASSERT(pBindings, "Keine Bindings"); + DBG_ASSERT(pBindings, "No Bindings"); pBindings->Release(*this); } @@ -118,10 +114,10 @@ void SfxControllerItem::BindInternal_Impl( USHORT nNewId, SfxBindings *pBindinx { DBG_MEMTEST(); DBG_CHKTHIS(SfxControllerItem, 0); - DBG_ASSERT(pBindings || pBindinx, "Keine Bindings"); + DBG_ASSERT(pBindings || pBindinx, "No Bindings"); if ( IsBound() ) { - DBG_ASSERT(pBindings, "Keine Bindings"); + DBG_ASSERT(pBindings, "No Bindings"); pBindings->Release(*this); } @@ -138,14 +134,14 @@ void SfxControllerItem::BindInternal_Impl( USHORT nNewId, SfxBindings *pBindinx void SfxControllerItem::UnBind() -/* [Beschreibung] - - "ost die Verbindung dieses SfxControllerItems mit der SfxBindings-Instanz, - an der es zur Zeit gebunden ist. Ab diesem Zeitpunkt erh"alt es keine - Statusbenachrichtigungen (<SfxControllerItem::StateChented()>) mehr. +/* [Description] + Unbinds the connection of this SfxControllerItems with the SfxBindings + instance with which it to time is bound. From this time on it does not + receive any status notifications (<SfxControllerItem::StateChented()>) + anymore. - [Querverweise] + [Cross-reference] <SfxControllerItem::ReBind()> <SfxControllerItem::ClearCache()> @@ -153,7 +149,7 @@ void SfxControllerItem::UnBind() { DBG_MEMTEST(); DBG_CHKTHIS(SfxControllerItem, 0); - DBG_ASSERT(pBindings, "Keine Bindings"); + DBG_ASSERT(pBindings, "No Bindings"); DBG_ASSERT( IsBound(), "unbindings unbound SfxControllerItem" ); pBindings->Release(*this); @@ -164,14 +160,13 @@ void SfxControllerItem::UnBind() void SfxControllerItem::ReBind() -/* [Beschreibung] - - Binded dieses SfxControllerItem wieder an die SfxBindings-Instanz, - an der es zuletzt gebunden war. Ab diesem Zeitpunkt erh"alt es wieder - Statusbenachrichtigungen (<SfxControllerItem::StateChented()>). +/* [Description] + Binds this SfxControllerItem with the SfxBindings instance again, + with which it was last bound. From this time on it does receive status + notifications (<SfxControllerItem::StateChented()>) again. - [Querverweise] + [Cross-reference] <SfxControllerItem::UnBind()> <SfxControllerItem::ClearCache()> @@ -180,7 +175,7 @@ void SfxControllerItem::ReBind() { DBG_MEMTEST(); DBG_CHKTHIS(SfxControllerItem, 0); - DBG_ASSERT(pBindings, "Keine Bindings"); + DBG_ASSERT(pBindings, "No Bindings"); DBG_ASSERT( !IsBound(), "bindings rebound SfxControllerItem" ); pBindings->Register(*this); @@ -190,11 +185,11 @@ DBG_CHKTHIS(SfxControllerItem, 0); void SfxControllerItem::UpdateSlot() -/* [Beschreibung] +/* [Description] - Holt den Status 'hart' neu. + Get the Status again. - [Querverweise] + [Cross-reference] <SfxControllerItem::ClearCache()> */ @@ -211,24 +206,20 @@ void SfxControllerItem::UpdateSlot() void SfxControllerItem::ClearCache() -/* [Beschreibung] - - "oscht den Status-Cache f"ur dieses SfxControllerItem. D.h. beim - n"achsten Status-Update wird das <SfxPoolItem> auf jeden Fall geschickt, - auch wenn zuvor dasselbe geschickt wurde. Dies wird ben"otigt, wenn - ein Controller umgeschaltet werden kann und sich diesen Status - selbst merkt. +/* [Description] + Clears the cache status for this SfxControllerItem. That is by the next + status update is the <SfxPoolItem> sent in any case, even if the same was + sent before. This is needed if a controller can be switched on and note + that status themselves. - [Beispiel] + [Example] - Der Kombi-Controller f"ur das Einstellen des Fl"achentyps und der - konkreten Auspr"agung (Farbe blau oder Schraffur X) kann im Typ - umgestellt werden, wird jedoch dann bei der n"achsten Selektion - wieder benachrichtigt, auch wenn es dieselben Daten sind. + The combined controller for adjusting the surface type and the concrete + expression (blue color, or hatching X) can be changed in type, but is then + notified of the next selection again, even if it the same data. - - [Querverweise] + [Cross-reference] <SfxControllerItem::UnBind()> <SfxControllerItem::ReBind()> @@ -238,13 +229,12 @@ void SfxControllerItem::ClearCache() { DBG_MEMTEST(); DBG_CHKTHIS(SfxControllerItem, 0); - DBG_ASSERT(pBindings, "Keine Bindings"); + DBG_ASSERT(pBindings, "No Bindings"); pBindings->ClearCache_Impl( GetId() ); } //-------------------------------------------------------------------- - // replaces the successor in the list of bindings of the same id SfxControllerItem* SfxControllerItem::ChangeItemLink( SfxControllerItem* pNewLink ) @@ -257,7 +247,6 @@ SfxControllerItem* SfxControllerItem::ChangeItemLink( SfxControllerItem* pNewLin } //-------------------------------------------------------------------- - // changes the id of unbound functions (e.g. for sub-menu-ids) void SfxControllerItem::SetId( USHORT nItemId ) @@ -270,7 +259,7 @@ void SfxControllerItem::SetId( USHORT nItemId ) //-------------------------------------------------------------------- -// creates a atomic item for a controller without registration +// creates a atomic item for a controller without registration. SfxControllerItem::SfxControllerItem(): nId(0), @@ -282,7 +271,6 @@ SfxControllerItem::SfxControllerItem(): } //-------------------------------------------------------------------- - // creates a representation of the function nId and registeres it SfxControllerItem::SfxControllerItem( USHORT nID, SfxBindings &rBindings ): @@ -296,7 +284,6 @@ SfxControllerItem::SfxControllerItem( USHORT nID, SfxBindings &rBindings ): } //-------------------------------------------------------------------- - // unregisteres the item in the bindings SfxControllerItem::~SfxControllerItem() @@ -311,27 +298,29 @@ SfxControllerItem::~SfxControllerItem() void SfxControllerItem::StateChanged ( - USHORT , // <SID> des ausl"osenden Slot - SfxItemState , // <SfxItemState> von 'pState' - const SfxPoolItem* // Slot-Status, ggf. 0 oder IsInvalidItem() + USHORT, // <SID> of the triggering slot + SfxItemState, // <SfxItemState> of 'pState' + const SfxPoolItem* // Slot-Status, NULL or IsInvalidItem() ) -/* [Beschreibung] +/* [Description] - Diese virtuelle Methode wird vom SFx gerufen, um <SfxControllerItem>s - dar"uber zu benachrichtigen, da\s sich der Status des Slots 'nSID' - ge"andert hat. Der neue Wert sowie der von diesem Wert ermittelte - Status wird als 'pState' bzw. 'eState' mitgegeben. + This virtual method is called by the SFx to inform the <SfxControllerItem>s + is about that state of the slots 'NSID' has changed. The new value and the + value determined by this status is given as 'pState' or 'eState'. - Der Status eines Slots kann sich "andern, wenn z.B. das MDI-Fenster - gewechselt wird oder der Slot explizit mit <SfxBindings::Invalidate()> - invalidiert wurde. + The status of a slot may change, for example when the MDI window is + switched or when the slot was invalidated explicitly with + <SfxBindings::Invalidate()>. Achtung! Die Methode wird nicht gerufen, wenn der Slot ung"ultig wurde, danach jedoch wieder denselben Wert angenommen hat. - Diese Basisklasse braucht nicht gerufen zu werden, weitere Zwischenstufen - jedoch (z.B. <SfxToolboxControl>) sollten gerufen werden. + Beware! The method is not called when the slot is invalid, however + has again assumed the same value. + + This base class need not be called, further interim steps however + (eg <SfxToolboxControl> ) should be called. */ { @@ -351,9 +340,9 @@ void SfxControllerItem::DeleteFloatingWindow() void SfxStatusForwarder::StateChanged ( - USHORT nSID, // <SID> des ausl"osenden Slot - SfxItemState eState, // <SfxItemState> von 'pState' - const SfxPoolItem* pState // Slot-Status, ggf. 0 oder IsInvalidItem() + USHORT nSID, // <SID> of the triggering slot + SfxItemState eState, // <SfxItemState> of 'pState' + const SfxPoolItem* pState // Slot-Status, NULL or IsInvalidItem() ) { @@ -374,37 +363,35 @@ SfxStatusForwarder::SfxStatusForwarder( SfxItemState SfxControllerItem::GetItemState ( - const SfxPoolItem* pState /* Pointer auf das <SfxPoolItem>, dessen - Status erfragt werden soll. */ + const SfxPoolItem* pState /* Pointer to <SfxPoolItem>, which + Status should be queried. */ ) -/* [Beschreibung] +/* [Description] - Statische Methode zum Ermitteln des Status des SfxPoolItem-Pointers, - in der Methode <SfxControllerItem::StateChanged(const SfxPoolItem*)> - zu verwenden. + Static method to determine the status of the SfxPoolItem-Pointers, to be + used in the method <SfxControllerItem::StateChanged(const SfxPoolItem*)> - [R"uckgabewert] + [Return value] SfxItemState SFX_ITEM_UNKNOWN - Enabled, aber keine weitere Statusinformation - verf"ugbar. Typisch f"ur <Slot>s, die allenfalls - zeitweise disabled sind, aber ihre Darstellung sonst - nicht "andern. + Enabled, but no further status information available. + Typical for <Slot>s, which anyway are sometimes + disabled, but otherwise do not change their appearance. SFX_ITEM_DISABLED - Disabled und keine weiter Statusinformation - verf"ugbar. Alle anderen ggf. angezeigten Werte sollten - auf den Default zur"uckgesetzt werden. + Disabled and no further status information available. + All other values that may appear should be reset to + default. SFX_ITEM_DONTCARE - Enabled aber es waren nur uneindeutige Werte - verf"ugbar (also keine, die abgefragt werden k"onnen). + Enabled but there were only ambiguous values available + (i.e. non that can be queried). SFX_ITEM_AVAILABLE - Enabled und mit verf"ugbarem Wert, der von 'pState' - erfragbar ist. Der Typ ist dabei im gesamten - Programm eindeutig und durch den Slot festgelegt. + Enabled and with available values, which are queried + by 'pState'. The Type is thus clearly defined in the + entire Program and specified through the Slot. */ { @@ -421,10 +408,10 @@ SfxItemState SfxControllerItem::GetItemState SfxMapUnit SfxControllerItem::GetCoreMetric() const -/* [Beschreibung] +/* [Description] - Holt vom zust"andigen Pool die Ma\seinheit ab, in der das Status-Item - vorliegt. + Gets the measurement unit from the competent pool, in which the Status + item exist. */ { @@ -462,5 +449,4 @@ SfxMapUnit SfxControllerItem::GetCoreMetric() const #pragma optimize("g",off) #endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 68dffad969c0..7c6e1bcb5b70 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -41,7 +41,7 @@ #include <svtools/ttprops.hxx> #include <stdio.h> #include <stdarg.h> -#include <stdlib.h> // wg. bsearch +#include <stdlib.h> // due to bsearch #define _SVSTDARR_ULONGS #include <svl/svstdarr.hxx> @@ -49,7 +49,7 @@ #include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -// wg. nAutoPageID +// due to nAutoPageID #include "appdata.hxx" #include "sfxhelp.hxx" #include <sfx2/dispatch.hxx> @@ -93,10 +93,10 @@ DECL_PTRSTACK(SfxShellStack_Impl, SfxShell*, 8, 4 ); struct SfxToDo_Impl { - SfxShell* pCluster; - bool bPush; - bool bDelete; - bool bUntil; + SfxShell* pCluster; + bool bPush; + bool bDelete; + bool bUntil; SfxToDo_Impl() : pCluster(0) @@ -121,10 +121,10 @@ IMPL_OBJSTACK(SfxToDoStack_Impl, SfxToDo_Impl); struct SfxObjectBars_Impl { - sal_uInt32 nResId; // Resource - und ConfigId der Toolbox - sal_uInt16 nMode; // spezielle Sichtbarkeitsflags - String aName; - SfxInterface* pIFace; + sal_uInt32 nResId; // Resource - and ConfigId of the Toolbox + sal_uInt16 nMode; // special visibility flags + String aName; + SfxInterface* pIFace; SfxObjectBars_Impl() : nResId( 0 ) @@ -135,38 +135,39 @@ struct SfxObjectBars_Impl struct SfxDispatcher_Impl { - SfxRequestPtrArray aReqArr; - const SfxSlotServer* pCachedServ1; // zuletzt gerufene Message - const SfxSlotServer* pCachedServ2; // vorletzt gerufene Message - SfxShellStack_Impl aStack; // aktive Funktionalitaet - Timer aTimer; // fuers flushen - SfxToDoStack_Impl aToDoStack; // nicht abgearb. Push/Pop - SfxViewFrame* pFrame; // 0 oder zugeh"or. Frame - SfxDispatcher* pParent; // z.B. AppDispatcher, ggf. 0 - SfxHintPosterRef xPoster; // asynchrones Execute - sal_Bool bFlushing; // sal_True waehrend Flush //? - sal_Bool bUpdated; // Update_Impl gelaufen - sal_Bool bLocked; // kein Execute - sal_Bool bInvalidateOnUnlock;// da fragte jemand - sal_Bool bActive; // nicht verwechseln mit gesetzt! - sal_Bool* pInCallAliveFlag; // dem Stack den Dtor anzeigen - 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 - sal_Bool bReadOnly; // Dokument ist ReadOnly - sal_Bool bQuiet; // nur parent dispatcher verwenden - sal_Bool bModal; // nur Slots vom Parent-Dispatcher - - sal_Bool bFilterEnabling; // sal_True=filter enabled slots, 2==ReadOnlyDoc uebersteuert - sal_uInt16 nFilterCount; // Anzahl der SIDs in pFilterSIDs - const sal_uInt16* pFilterSIDs; // sortiertes Array von SIDs - sal_uInt16 nStandardMode; // ExecuteMode f. PlugInDispatcher - SvUShorts* pDisableList; - sal_uInt32 nDisableFlags; + SfxRequestPtrArray aReqArr; + const SfxSlotServer* pCachedServ1; // last called message + const SfxSlotServer* pCachedServ2; // penultimate called Message + SfxShellStack_Impl aStack; // active functionality + Timer aTimer; // for Flush + SfxToDoStack_Impl aToDoStack; // not processed Push/Pop + SfxViewFrame* pFrame; // NULL or associated Frame + SfxDispatcher* pParent; // AppDispatcher, NULL if possible + SfxHintPosterRef xPoster; // Execute asynchronous + sal_Bool bFlushing; // sal_True during Flush //? + sal_Bool bUpdated; // Update_Impl has run + sal_Bool bLocked; // No Execute + sal_Bool bInvalidateOnUnlock; // because someone asked + sal_Bool bActive; // not to be confused with set! + sal_Bool* pInCallAliveFlag; // view the Destructor Stack + 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 disconnected (no flicker) + sal_Bool bNoUI; // UI only from Parent Dispatcher + sal_Bool bReadOnly; // Document is ReadOnly + sal_Bool bQuiet; // Only use parent dispatcher + sal_Bool bModal; // Only slots from parent dispatcher + + sal_Bool bFilterEnabling; // sal_True=filter enabled slots, + // 2==ReadOnlyDoc overturned + sal_uInt16 nFilterCount; // Number of SIDs in pFilterSIDs + const sal_uInt16* pFilterSIDs; // sorted Array of SIDs + sal_uInt16 nStandardMode; // ExecuteMode from PlugInDispatcher + SvUShorts* pDisableList; + sal_uInt32 nDisableFlags; }; #define NO_OBJECTBAR 0 @@ -180,18 +181,17 @@ struct SfxDispatcher_Impl //==================================================================== sal_Bool SfxDispatcher::IsLocked( sal_uInt16 ) const -/* [Beschreibung] +/* [Description] - Mit dieser Methode kann festgestellt werden, ob der SfxDispatcher - gesperrt oder freigegeben ist. Ein gesperrter SfxDispatcher - f"uhrt keine <SfxRequest>s mehr aus und liefert keine - Status-Informationen mehr. Er verh"alt sich so als w"aren alle - Slots disabled. + With this method it can be determined whether the SfxDispatcher is + locked or unlocked. A locked SfxDispatcher does not perform <SfxRequest>s + and no longer provides any status information. It behaves as if all the + slots are disabled. - Der Dispatcher gilt auch als gesperrt, wenn alle Dispatcher - gelockt sind (<SfxApplication::LockDispatcher()>) oder der zugeh"orige - Top-Frame im modal-mode ist und der angegebene Slot Frame-spezifisch - (also nicht von der Application) bedient wird. + The dispatcher is also marked as blocked, if all Dispatcher are locked + (<SfxApplication::LockDispatcher()>) or the associated top frame is in the + modal-mode and if the specified slot are handled as frame-specific + (ie, not served by the application). */ { @@ -201,19 +201,15 @@ sal_Bool SfxDispatcher::IsLocked( sal_uInt16 ) const //-------------------------------------------------------------------- sal_Bool SfxDispatcher::IsAppDispatcher() const -/* [Beschreibung] +/* [Description] - Mit dieser Methode l"a\st sich festellen, ob der SfxDispacher der - Applikations-Dispatcher ist. + With this method it can be determined if the SfxDispacher is the + applications dispatcher. + [Return value] - [R"uckgabewert] - - sal_Bool sal_True - Es ist der Applikations-Dispatcher. - - sal_False - Es ist ein Dispatcher eines SfxViewFrame. + sal_Bool sal_True it is the application dispatcher. + sal_Fals it is a SfxViewFrame dispatcher. */ { @@ -223,21 +219,21 @@ sal_Bool SfxDispatcher::IsAppDispatcher() const //-------------------------------------------------------------------- int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest &rReq, sal_Bool bRecord ) -/* [Beschreibung] +/* [Description] - Hilfsfunktion zum pr"ufen, ob ein Slot executed werden darf und - der Execution selbst. + Helper function to check whether a slot can be executed and + check the execution itself */ { SFX_STACK(SfxDispatcher::Call_Impl); - // darf der Slot gerufen werden (i.S.v. enabled) + // The slot may be called (meaning enabled) if ( rSlot.IsMode(SFX_SLOT_FASTCALL) || rShell.CanExecuteSlot_Impl(rSlot) ) { if ( GetFrame() ) { - // ggf. Recording anwerfen + // Recording may start com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame( GetFrame()->GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); @@ -259,14 +255,13 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest rReq.Record_Impl( rShell, rSlot, xRecorder, GetFrame() ); } } - - // Alles holen, was gebraucht wird, da der Slot den Execute evtl. nicht - // "uberlebt, falls es ein 'Pseudoslot' f"ur Macros oder Verben ist + // Get all that is needed, because the slot may not have survived the + // Execute if it is a 'pseudo slot' for macros or verbs. sal_Bool bAutoUpdate = rSlot.IsMode(SFX_SLOT_AUTOUPDATE); - // API-Call-Klammerung und Document-Lock w"ahrend des Calls + // API-call parentheses and document-lock during the calls { - // 'this' mu\s im Dtor bescheid sagen + // 'this' must respond in the Destructor sal_Bool bThisDispatcherAlive = sal_True; sal_Bool *pOldInCallAliveFlag = pImp->pInCallAliveFlag; pImp->pInCallAliveFlag = &bThisDispatcherAlive; @@ -280,14 +275,14 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest SfxExecFunc pFunc = rSlot.GetExecFnc(); rShell.CallExec( pFunc, rReq ); - // falls 'this' noch lebt + // If 'this' is still alive if ( bThisDispatcherAlive ) pImp->pInCallAliveFlag = pOldInCallAliveFlag; else { if ( pOldInCallAliveFlag ) { - // auch verschachtelte Stack-Frames sch"utzen + // also protect nested stack frames *pOldInCallAliveFlag = sal_False; } @@ -300,14 +295,14 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest { SfxBindings *pBindings = GetBindings(); - // bei AutoUpdate sofort updaten; "Pseudoslots" d"urfen nicht - // Autoupdate sein! + // When AutoUpdate update immediately; "Pseudoslots" must not be + // Autoupdate! if ( bAutoUpdate && pBindings ) { const SfxSlot* pSlave = rSlot.GetLinkedSlot(); if (pSlave) { - // bei Enum-Slots irgendeinen gebundenen Slave-Slot nehmen + // When enum slots take any bound slave slot while (!pBindings->IsBound(pSlave->GetSlotId()) && pSlave != &rSlot ) pSlave = pSlave->GetLinkedSlot(); pBindings->Invalidate(pSlave->GetSlotId()); @@ -378,11 +373,10 @@ SfxDispatcher::SfxDispatcher( SfxDispatcher* pParent ) SfxDispatcher::SfxDispatcher( SfxViewFrame *pViewFrame ) -/* [Beschreibung] +/* [Description] - Der Konstruktor der Klasse SfxDispatcher legt einen leeren Stack - von <SfxShell>-Pointern an. Er ist initial nicht gelockt und gilt als - geflusht. + The constructor of the SfxDispatcher class places a stack of empty + <SfxShell> pointers. It is not initially locked and is considered flushed. */ { @@ -402,11 +396,11 @@ SfxDispatcher::SfxDispatcher( SfxViewFrame *pViewFrame ) //==================================================================== SfxDispatcher::~SfxDispatcher() -/* [Beschreibung] +/* [Description] - Der Destruktor der Klasse SfxDispatcher darf nicht gerufen werden, - wenn die SfxDispatcher-Instanz aktiv ist. Es d"urfen sich allerdings - noch <SfxShell>-Pointer auf dem Stack befinden. + The destructor of the SfxDispatcher class should not be called when the + SfxDispatcher instance is active. It may, however, still be a <SfxShell> + pointer on the stack. */ { @@ -417,27 +411,26 @@ SfxDispatcher::~SfxDispatcher() DBG_ASSERT( !pImp->bActive, "deleting active Dispatcher" ); #endif - // Damit in LeaveRegistrations kein Timer per Reschedule in PlugComm - // zuschlaegt + // So that no timer by Reschedule in PlugComm strikes the LeaveRegistrations pImp->aTimer.Stop(); pImp->xPoster->SetEventHdl( Link() ); - // die Stack-Varialblem in Call_Impl benachrichtigen + // Notify the stack varialbles in Call_Impl if ( pImp->pInCallAliveFlag ) *pImp->pInCallAliveFlag = sal_False; - // Bindings und App besorgen + // Get bindings and application SfxApplication *pSfxApp = SFX_APP(); SfxBindings* pBindings = GetBindings(); -// if (pImp->nEventId) -// pSfxApp->RemoveEventHdl(pImp->nEventId); +// if (pImp->nEventId) +// pSfxApp->RemoveEventHdl(pImp->nEventId); - // wenn noch nicht flushed, die Bindings wiederbeleben + // When not flushed, revive the bindings if ( pBindings && !pSfxApp->IsDowning() && !bFlushed ) pBindings->DLEAVEREGISTRATIONS(); - // ggf. bei den Bindings abmelden + // may unregister the bindings while ( pBindings ) { if ( pBindings->GetDispatcher_Impl() == this) @@ -451,27 +444,27 @@ SfxDispatcher::~SfxDispatcher() //==================================================================== void SfxDispatcher::Pop ( - SfxShell& rShell, /* Die vom Stack zu nehmende SfxShell-Instanz. */ + SfxShell& rShell, /* the stack to take the SfxShell instance. */ - sal_uInt16 nMode /* SFX_SHELL_POP_UNTIL - Es werden auch alle "uber 'rShell' liegenenden - SfxShell's vom Stack genommen. + sal_uInt16 nMode /* SFX_SHELL_POP_UNTIL + Also all 'rShell' of SfxShells are taken from the + stack. - SFX_SHELL_POP_DELETE - Alle tats"achlich vom Stack genommenen - SfxShells werden gel"oscht. + SFX_SHELL_POP_DELETE + All SfxShells actually taken from the stack + will be deleted. - SFX_SHELL_PUSH (InPlace use only) - Die Shell wird gepusht. */ + SFX_SHELL_PUSH (InPlace use only) + The Shell is pushed. */ ) -/* [Beschreibung] - - Mit dieser Methode wird eine oder mehrere <SfxShell> vom SfxDispatcher - gepoppt. Die SfxShell wird zun"achst zum poppen vermerkt und - es wird ein Timer aufgesetzt. Erst bei Ablauf des Timers wird - tats"achlich gepoppt (<SfxDispatcher::Flush()>) und die <SfxBindings> - werden invalidiert. W"ahrend der Timer l"auft gleichen sich - entgegengesetzte Push und Pop Befehle mit derselben SfxShell aus. +/* [Description] + + With this method, one or more <SfxShell> are poped from the SfxDispatcher. + The SfxShell is marked for popping and a timer is set up. Only when the + timer has reached the end, the pop is actually performed + ( <SfxDispatcher::Flush()> ) and the <SfxBindings> is invalidated. + While the timer is running the opposing push and pop commands on one + SfxShell cancel each other out. */ { @@ -479,8 +472,8 @@ void SfxDispatcher::Pop 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" ); +// 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; @@ -501,10 +494,10 @@ void SfxDispatcher::Pop DbgTrace( aMsg.GetBuffer() ); #endif - // gleiche Shell wie on-Top des ToDo-Stacks? + // same shell as on top of the to-do stack? if ( pImp->aToDoStack.Count() && pImp->aToDoStack.Top().pCluster == &rShell ) { - // inverse Actions heben sich auf + // cancel inverse actions if ( pImp->aToDoStack.Top().bPush != bPush ) pImp->aToDoStack.Pop(); else @@ -515,7 +508,7 @@ void SfxDispatcher::Pop } else { - // ::com::sun::star::chaos::Action merken + // Remember ::com::sun::star::chaos::Action pImp->aToDoStack.Push( SfxToDo_Impl(bPush, bDelete, bUntil, rShell) ); if ( bFlushed ) { @@ -523,7 +516,7 @@ void SfxDispatcher::Pop bFlushed = sal_False; pImp->bUpdated = sal_False; - // Bindings schlafen legen + // Put bindings to sleep SfxBindings* pBindings = GetBindings(); if ( pBindings ) pBindings->DENTERREGISTRATIONS(); @@ -533,29 +526,28 @@ void SfxDispatcher::Pop if ( !pSfxApp->IsDowning() && pImp->aToDoStack.Count() ) { //! if (SFX_APP()->AnyInput(INPUT_KEYBOARD | INPUT_MOUSE) ) - //! AnyInput haut nicht hin; hier muss noch ein Kriterium gefunden - //! werden. Solange wieder immer mit Timer. - + //! AnyInput does not work, here a criterion has yet to found. + //! As long as time after time with a timer. if (sal_True) { - // Kein sofortiges Update gewuenscht + // No immediate update is requested pImp->aTimer.SetTimeout(SFX_FLUSH_TIMEOUT); pImp->aTimer.SetTimeoutHdl( LINK(this, SfxDispatcher, EventHdl_Impl ) ); pImp->aTimer.Start(); } else { - // Schnellstmoegliches Update (sollte Normalfall sein) + // Upgrade as quickly as possible(should be the normal case) pImp->aTimer.Stop(); GetpApp()->PostUserEvent(pImp->nEventId, (void*)0); } } else { - // doch nichts zu tun + // but to do nothing pImp->aTimer.Stop(); - // ggf. Bindings wieder aufwecken + // Bindings may wake up again if ( !pImp->aToDoStack.Count() ) { SfxBindings* pBindings = GetBindings(); @@ -569,13 +561,13 @@ void SfxDispatcher::Pop IMPL_LINK_INLINE_START( SfxDispatcher, EventHdl_Impl, void *, pvoid ) -/* [Beschreibung] +/* [Description] - Dieser Handler wird nach <SfxDispatcher::Invalidate()> oder Bewegungen - auf dem Stack (<SfxDispatcher::Push()> und <SfxDispatcher::Pop()) gerufen. + This handler is called after <SfxDispatcher::Invalidate()> or after + changes on the stack (<SfxDispatcher::Push()> and <SfxDispatcher::Pop()) - Er flusht den Stack, falls er dirty ist, f"uhrt also die ausstehenden - Push und Pop Befehle tats"achlich aus. + It flushes the Stack, if it is dirty, thus it actually excecutes the + pending Push and Pop commands. */ { @@ -594,14 +586,14 @@ IMPL_LINK_INLINE_END( SfxDispatcher, EventHdl_Impl, void *, pvoid ) //-------------------------------------------------------------------- sal_Bool SfxDispatcher::CheckVirtualStack( const SfxShell& rShell, sal_Bool bDeep ) -/* [Beschreibung] +/* [Description] - Mit dieser Methode kann gepr"uft werden, ob sich die <SfxShell> rShell - auf dem Stack befindet, wenn er geflusht w"are. Dabei wird der - SfxDispatcher jedoch nicht tats"achlich geflusht. + With this method it can be tested whether the <SfxShell> rShell is on the + stack, when it was flushed. This way the SfxDispatcher is not actually + flushed. - Diese Methode ist u.a. dazu gedacht, Assertions zu erm"oglichen, ohne - als Seiteneffekt den SfxDispathcer flushen zu m"ussen. + This method is intended among other things to make assertions possible + without the side effect of having to flush the SfxDispathcer. */ { @@ -638,21 +630,19 @@ sal_Bool SfxDispatcher::CheckVirtualStack( const SfxShell& rShell, sal_Bool bDee //-------------------------------------------------------------------- sal_uInt16 SfxDispatcher::GetShellLevel( const SfxShell& rShell ) -/* [Beschreibung] +/* [Description] - Ermittelt die Position einer SfxShell im Stack des Dispatchers. - Dazu wird dieser ggf. zuvor geflusht. + Determines the position of a given SfxShell in the stack of the dispatcher. + If possible this is flushed before. + [Return value] - [Rueckgabewert] - - sal_uInt16 == USRT_MAX - Die SfxShell befindet sich nicht auf - diesem SfxDispatcher. + sal_uInt16 == USRT_MAX + The SfxShell is not on this SfxDispatcher. < USHRT_MAX - Position der SfxShell auf dem Dispatcher - von oben mit 0 beginnend gez"ahlt. + Position of the SfxShell on the Dispatcher + from the top count stating with 0. */ { @@ -677,14 +667,14 @@ sal_uInt16 SfxDispatcher::GetShellLevel( const SfxShell& rShell ) //-------------------------------------------------------------------- SfxShell *SfxDispatcher::GetShell(sal_uInt16 nIdx) const -/* [Beschreibung] +/* [Description] - Liefert einen Pointer auf die <SfxShell>, welche sich an der Position - nIdx (von oben, letzt-gepushte liegt bei 0) auf dem Stack befindet. + Returns a pointer to the <SfxShell> which is at the position nIdx + (from the top, last pushed is 0) on the stack. - Dabei wird der SfxDispatcher nicht geflusht. + Thus the SfxDispatcher is not flushed. - Ist der Stack nicht tief genug, wird ein 0-Pointer zur"uckgegeben. + Is the stack not deep enough a NULL-Pointer is returned. */ { @@ -701,15 +691,15 @@ SfxShell *SfxDispatcher::GetShell(sal_uInt16 nIdx) const //-------------------------------------------------------------------- SfxBindings* SfxDispatcher::GetBindings() const -/* [Beschreibung] +/* [Description] - Diese Methode liefert einen Pointer auf die <SfxBindings> Instanz - zur"uck, an die der SfxDispatcher gerade gebunden ist. Ein SfxDispatcher - ist nur dann an SfxBindings gebunden, wenn er <UI-aktiv> ist. Ist - er nicht UI-aktiv, wird ein 0-Pointer zur"uckgegeben. + This method returns a pointer to the <SfxBinding> Instance on which the + SfxDispatcher is curretly bound. A SfxDispatcher is only bound to + the SfxBindings when it is <UI-aktiv>. If it is not UI-active, + a NULL-pointer is returned. - Der zur"uckgegebene Pointer ist nur im <unmittelbaren Kontext> des - Methodenaufrufs g"ultig. + The returned pointer is only valid in the immediate context of the method + call. */ { @@ -722,11 +712,11 @@ SfxBindings* SfxDispatcher::GetBindings() const //-------------------------------------------------------------------- SfxViewFrame* SfxDispatcher::GetFrame() const -/* [Beschreibung] +/* [Description] - Liefert einen Pointer auf die <SfxViewFrame> Instanz, der dieser - SfxDispatcher geh"ort. Falls es sich um den Applikations-Dispatcher - handelt, wird ein 0-Pointer zur"uckgegeben. + Returns a pointer to the <SfxViewFrame> instance, which belongs to + this SfxDispatcher. If it is about the application dispatcher, + a NULL-pointer is returned. */ { @@ -737,18 +727,18 @@ SfxViewFrame* SfxDispatcher::GetFrame() const //-------------------------------------------------------------------- void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ ) -/* [Beschreibung] +/* [Description] - Diese Methode steuert das Aktivieren eines Dispatchers. + This method controls the activation of a dispatcher. - Da der Applikations-Dispatcher immer aktiv ist, entweder als - Unterdispatcher des <SfxViewFrame>-Dispatchers oder selbst, wird - er nie als ganzes Aktiviert, sondern nur seine einzelnen <SfxShell>s - bei <SfxDispatcher::Push(SfxShell&)>. + Since the application dispatcher is always active, either as a sub + dispatcher of the <SfxViewFrame> dispatcher or as itself, it is never + activated as a whole, instead only its individual <SfxShell>s at + <SfxDispatcher::Push(SfxShell&)>. - Beim Aktivieren eines SfxDispatchers wird an allen auf seinem - Stack befindlichen SfxShells, beginnend mit der untersten, der Handler - <SfxShell::Activate(sal_Bool)> gerufen. + When activating a SfxDispatcher all of the SfxShells located on its stack + are called with the handler <SfxShell::Activate(sal_Bool)>, starting with + the lowest. */ { @@ -760,7 +750,7 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ ) ByteString sTemp("Activate Dispatcher "); sTemp += ByteString::CreateFromInt64( (sal_uIntPtr) this ); DBG_TRACE(sTemp.GetBuffer()); - DBG_ASSERT( !pImp->bActive, "Activate-Fehler" ); + DBG_ASSERT( !pImp->bActive, "Activation error" ); #endif pImp->bActive = sal_True; pImp->bUpdated = sal_False; @@ -803,14 +793,14 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ ) { if (sal_True) { - // Kein sofortiges Update gewuenscht + // No immediate update is requested pImp->aTimer.SetTimeout(SFX_FLUSH_TIMEOUT); pImp->aTimer.SetTimeoutHdl( LINK(this, SfxDispatcher, EventHdl_Impl ) ); pImp->aTimer.Start(); } else { - // Schnellstmoegliches Update (sollte Normalfall sein) + // Upgrade as quickly as possible(should be the normal case) pImp->aTimer.Stop(); GetpApp()->PostUserEvent(pImp->nEventId, (void*)0); } @@ -826,18 +816,18 @@ void SfxDispatcher::DoParentActivate_Impl() //-------------------------------------------------------------------- void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew ) -/* [Beschreibung] +/* [Description] - Diese Methode steuert das Deaktivieren eines Dispatchers. + This method controls the deactivation of a dispatcher. - Da der Applikations-Dispatcher immer aktiv ist, entweder als - Unterdispatcher des <SfxViewFrame>-Dispatchers oder selbst, wird - er nie als ganzes Deaktiviert, sondern nur seine einzelnen <SfxShell>s - bei <SfxDispatcher::Pop(SfxShell&)>. + Since the application dispatcher is always active, either as a sub + dispatcher of the <SfxViewFrame> dispatcher or as itself, it is never + deactivated as a whole, instead only its individual <SfxShell>s at + <SfxDispatcher::Pop(SfxShell&)>. - Beim Deaktivieren eines SfxDispatchers wird an allen auf seinem - Stack befindlichen SfxShells, beginnend mit der obersten, der Handler - <SfxShell::Deactivate(sal_Bool)> gerufen. + When deactivating a SfxDispatcher all of the SfxShells located on its stack + are called with the handler <SfxShell::Deactivate(sal_Bool)>, starting with + the lowest. */ { @@ -849,7 +839,7 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew ) if ( bMDI ) { DBG_TRACE(ByteString("Deactivate Dispatcher ").Append(ByteString::CreateFromInt64( (sal_uIntPtr) this )).GetBuffer()); - DBG_ASSERT( pImp->bActive, "Deactivate-Fehler" ); + DBG_ASSERT( pImp->bActive, "Deactivate error" ); pImp->bActive = sal_False; if ( pImp->pFrame && !(pImp->pFrame->GetObjectShell()->IsInPlaceActive() ) ) @@ -916,30 +906,28 @@ void SfxDispatcher::DoParentDeactivate_Impl() //-------------------------------------------------------------------- int SfxDispatcher::GetShellAndSlot_Impl ( - sal_uInt16 nSlot, // die zu suchende Slot-Id - SfxShell** ppShell, // die SfxShell, welche nSlot z.Zt. bedient - const SfxSlot** ppSlot, // der SfxSlot, welcher nSlot z.Zt. bedient - sal_Bool bOwnShellsOnly, - sal_Bool bModal, // trotz ModalMode + sal_uInt16 nSlot, // the searchable Slot-Id + SfxShell** ppShell, // the SfxShell, which are currently handled + // the nSlot + const SfxSlot** ppSlot, // the SfxSlot, which are currently handled + // the nSlot + sal_Bool bOwnShellsOnly, + sal_Bool bModal, // ModalMode sal_Bool bRealSlot ) -/* [Beschreibung] - - Diese Methode sucht im SfxDispatcher nach der <SfxShell>, von der - die Slot-Id nSlot zur Zeit bedient wird. Dazu wird der Dispatcher - zuvor geflusht. +/* [Description] + This method searches in SfxDispatcher after <SfxShell> , from the Slot Id + nSlot currently being handled. For this, the dispatcher is first flushed. - [R"uckgabewert] + [Return value] - int sal_True - Die SfxShell wurde gefunden, ppShell und ppSlot - sind g"ultig. + int sal_True + The SfxShell was found, ppShell and ppSlot are valid. - sal_True - Die SfxShell wurde nicht gefunden, ppShell und ppSlot - sind ung"ultig. + sal_False + The SfxShell was not found, ppShell and ppSlot are invalid. */ { @@ -999,16 +987,17 @@ struct Executer : public SfxHint //-------------------------------------------------------------------- void SfxDispatcher::_Execute ( - SfxShell& rShell, // zu rufende <SfxShell> - const SfxSlot& rSlot, // zu rufender <SfxSlot> - SfxRequest& rReq, // auszuf"uhrende Funktion (Id und optional Parameter) - SfxCallMode eCallMode // synchron, asynchron oder wie beim Slot angegeben + SfxShell& rShell, // to the calling <SfxShell> + const SfxSlot& rSlot, // to the calling <SfxSlot> + SfxRequest& rReq, // function to be performed + // (Id and optional parameters) + SfxCallMode eCallMode // Synchronously, asynchronously or as shown in + // the slot ) -/* [Beschreibung] +/* [Description] - Diese Methode f"uhrt einen Request "uber einen gecachten <Slot-Server> - aus. + This method performs a request for a cached <Slot-Server>. */ { @@ -1053,14 +1042,14 @@ void SfxDispatcher::_Execute //-------------------------------------------------------------------- void MappedPut_Impl( SfxAllItemSet &rSet, const SfxPoolItem &rItem ) -/* [Beschreibung] +/* [Description] - Hilfsfunktion zum putten von rItem unter der im Pool des Item-Sets - rSet geltenden Which-Id. + Helper function to put from rItem below the Which-ID in the pool of the + Item Sets rSet. */ { - // mit ggf. gemappter Which-Id putten + // Put with mapped Which-Id if possible const SfxItemPool *pPool = rSet.GetPool(); sal_uInt16 nWhich = rItem.Which(); #ifdef TF_POOLABLE @@ -1084,7 +1073,7 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, SfxPoolItem **pArgs if ( !nMode ) nMode = pImp->nStandardMode; - // via Bindings/Interceptor? (dann ist der Returnwert nicht exakt) + // through Bindings/Interceptor? (then the return value is not exact) sal_Bool bViaBindings = SFX_USE_BINDINGS == ( nMode & SFX_USE_BINDINGS ); nMode &= ~sal_uInt16(SFX_USE_BINDINGS); if ( bViaBindings && GetBindings() ) @@ -1092,7 +1081,7 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, SfxPoolItem **pArgs ? EXECUTE_POSSIBLE : EXECUTE_NO; - // sonst via Dispatcher + // otherwise through the Dispatcher if ( IsLocked(nSlot) ) return 0; SfxShell *pShell = 0; @@ -1101,7 +1090,7 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, SfxPoolItem **pArgs const SfxSlot *pSlot = 0; if ( GetShellAndSlot_Impl( nSlot, &pShell, &pSlot, sal_False, sal_False ) ) { - // Ausf"uhrbarkeit vorher testen + // Feasibility test before if ( pSlot->IsMode( SFX_SLOT_FASTCALL ) || pShell->CanExecuteSlot_Impl( *pSlot ) ) nRet = EXECUTE_POSSIBLE; @@ -1138,7 +1127,7 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, const SfxItemSet& r /* // at the moment not implemented - // via Bindings/Interceptor? (dann ist der Returnwert nicht exakt) + // through Bindings/Interceptor? (then the return value is not exact) sal_Bool bViaBindings = SFX_USE_BINDINGS == ( nMode & SFX_USE_BINDINGS ); nMode &= ~sal_uInt16(SFX_USE_BINDINGS); if ( bViaBindings && GetBindings() ) @@ -1146,7 +1135,7 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, const SfxItemSet& r ? EXECUTE_POSSIBLE : EXECUTE_NO; */ - // sonst via Dispatcher + // otherwise through the Dispatcher if ( IsLocked(nSlot) ) return 0; SfxShell *pShell = 0; @@ -1155,7 +1144,7 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, const SfxItemSet& r const SfxSlot *pSlot = 0; if ( GetShellAndSlot_Impl( nSlot, &pShell, &pSlot, sal_False, sal_False ) ) { - // Ausf"uhrbarkeit vorher testen + // Feasibility test before if ( pSlot->IsMode( SFX_SLOT_FASTCALL ) || pShell->CanExecuteSlot_Impl( *pSlot ) ) nRet = EXECUTE_POSSIBLE; @@ -1183,7 +1172,7 @@ sal_uInt16 SfxDispatcher::GetSlotId( const String& rCommand ) const SfxSlot* SfxDispatcher::GetSlot( const String& rCommand ) { - // Anzahl der Shells auf den verkettenten Dispatchern z"ahlen + // Count the number of Shells on the linked Dispatcher Flush(); sal_uInt16 nTotCount = pImp->aStack.Count(); if ( pImp->pParent ) @@ -1315,27 +1304,26 @@ const SfxPoolItem* SfxDispatcher::Execute( //-------------------------------------------------------------------- const SfxPoolItem* SfxDispatcher::Execute ( - sal_uInt16 nSlot, // die Id der auszufuehrenden Funktion - SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON oder ..._SLOT - const SfxPoolItem **pArgs, // 0-terminiertes C-Array von Parametern + sal_uInt16 nSlot, // the Id of the executing function + SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON + // or ..._SLOT + const SfxPoolItem **pArgs, // Zero teminated C-Array of Parameters sal_uInt16 nModi, - const SfxPoolItem **pInternalArgs // 0-terminiertes C-Array von Parametern + const SfxPoolItem **pInternalArgs // Zero terminated C-Array of Parameters ) -/* [Beschreibung] +/* [Description] - Methode zum Ausf"uhren eines <SfxSlot>s "uber die Slot-Id. + Method to excecute a <SfxSlot>s over the Slot-Id. + [Return value] - [R"uckgabewert] + const SfxPoolItem* Pointer to the SfxPoolItem valid to the next run + though the Message-Loop, which contains the return + value. - const SfxPoolItem* Pointer auf ein bis zum n"achsten Durchlauf - der Message-Loop g"ultiges SfxPoolItem, - welches den R"uckgabewert enth"alt. - - Oder ein 0-Pointer, wenn die Funktion nicht - ausgef"uhrt wurde (z.B. Abbruch durch den - Benutzer). + Or a NULL-Pointer, when the function was not + executed (for example canceled by the user). */ { @@ -1375,25 +1363,23 @@ const SfxPoolItem* SfxDispatcher::Execute //-------------------------------------------------------------------- const SfxPoolItem* SfxDispatcher::Execute ( - sal_uInt16 nSlot, // die Id der auszufuehrenden Funktion - SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON oder ..._SLOT - const SfxItemSet &rArgs // <SfxItemSet> mit Parametern + sal_uInt16 nSlot, // the Id of the executing function + SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON or ..._SLOT + const SfxItemSet &rArgs // <SfxItemSet> with the parameters ) -/* [Beschreibung] - - Methode zum Ausf"uhren eines <SfxSlot>s "uber die Slot-Id. +/* [Description] + Method to excecute a <SfxSlot>s over the Slot-Id. - [R"uckgabewert] + [Return value] - const SfxPoolItem* Pointer auf ein bis zum n"achsten Durchlauf - der Message-Loop g"ultiges SfxPoolItem, - welches den R"uckgabewert enth"alt. + const SfxPoolItem* Pointer to the SfxPoolItem valid to the next run + though the Message-Loop, which contains the return + value. - Oder ein 0-Pointer, wenn die Funktion nicht - ausgef"uhrt wurde (z.B. Abbruch durch den - Benutzer). + Or a NULL-Pointer, when the function was not + executed (for example canceled by the user). */ { @@ -1434,26 +1420,25 @@ const SfxPoolItem* SfxDispatcher::Execute //-------------------------------------------------------------------- const SfxPoolItem* SfxDispatcher::_Execute ( - sal_uInt16 nSlot, // die Id der auszufuehrenden Funktion - SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON oder ..._SLOT - va_list pVarArgs, // Parameterliste ab 2. Parameter - const SfxPoolItem* pArg1 // erster Parameter + sal_uInt16 nSlot, // the Id of the executing function + SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON or + //..._SLOT + va_list pVarArgs, // Parameter list from the 2nd parameter + const SfxPoolItem* pArg1 // First parameter ) -/* [Beschreibung] +/* [Description] - Methode zum Ausf"uhren eines <SfxSlot>s "uber die Slot-Id. + Method to excecute a <SfxSlot>s over the Slot-Id. + [Return value] - [R"uckgabewert] + const SfxPoolItem* Pointer to the SfxPoolItem valid to the next run + though the Message-Loop, which contains the return + value. - const SfxPoolItem* Pointer auf ein bis zum n"achsten Durchlauf - der Message-Loop g"ultiges SfxPoolItem, - welches den R"uckgabewert enth"alt. - - Oder ein 0-Pointer, wenn die Funktion nicht - ausgef"uhrt wurde (z.B. Abbruch durch den - Benutzer). + Or a NULL-Pointer, when the function was not + executed (for example canceled by the user). */ { @@ -1482,35 +1467,32 @@ const SfxPoolItem* SfxDispatcher::_Execute //-------------------------------------------------------------------- const SfxPoolItem* SfxDispatcher::Execute ( - sal_uInt16 nSlot, // die Id der auszufuehrenden Funktion - SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON oder ..._SLOT - const SfxPoolItem* pArg1, // erster Parameter - ... // 0-terminiertes Liste Parametern + sal_uInt16 nSlot, // the Id of the executing function + SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON or + // ..._SLOT + const SfxPoolItem* pArg1, // First parameter + ... // Zero terminated list of parameters ) -/* [Beschreibung] - - Methode zum Ausf"uhren eines <SfxSlot>s "uber die Slot-Id. - - - [Anmerkung] +/* [Description] - Die Parameter werden kopiert, k"onnen daher als Adresse von - Stack-Objekten "ubergeben werden. + Method to excecute a <SfxSlot>s over the Slot-Id. + [Note] - [R"uckgabewert] + The parameters are copied, can therefore be passed on as the address + of stack objects. - const SfxPoolItem* Pointer auf ein bis zum n"achsten Durchlauf - der Message-Loop g"ultiges SfxPoolItem, - welches den R"uckgabewert enth"alt. + [Return value] - Oder ein 0-Pointer, wenn die Funktion nicht - ausgef"uhrt wurde (z.B. Abbruch durch den - Benutzer). + const SfxPoolItem* Pointer to the SfxPoolItem valid to the next run + though the Message-Loop, which contains the return + value. + Or a NULL-Pointer, when the function was not + executed (for example canceled by the user). - [Beispiel] + [Example] pDispatcher->Execute( SID_OPENDOCUMENT, SFX_CALLMODE_SYNCHRON, &SfxStringItem( SID_FILE_NAME, "\\tmp\\temp.sdd" ), @@ -1549,9 +1531,9 @@ const SfxPoolItem* SfxDispatcher::Execute IMPL_LINK( SfxDispatcher, PostMsgHandler, SfxRequest*, pReq ) -/* [Beschreibung] +/* [Description] - Hilfsmethode zum Empfangen der asynchron auszuf"uhrenden <SfxRequest>s. + Helper method to receive the asynchronously executed <SfxRequest>s. */ { @@ -1559,7 +1541,7 @@ IMPL_LINK( SfxDispatcher, PostMsgHandler, SfxRequest*, pReq ) DBG_ASSERT( !pImp->bFlushing, "recursive call to dispatcher" ); SFX_STACK(SfxDispatcher::PostMsgHandler); - // ist auch der Pool noch nicht gestorben? + // Has also the Pool not yet died? // SfxRequest* pReq = pExec->pRequest; if ( !pReq->IsCancelled() ) { @@ -1577,11 +1559,11 @@ IMPL_LINK( SfxDispatcher, PostMsgHandler, SfxRequest*, pReq ) DBG( SfxApplication *pSfxApp = SFX_APP() ); DBG( pSfxApp->EnterAsynchronCall_Impl() ); - // Wenn pSlot ein "Pseudoslot" f"ur Macros oder Verben ist, kann - // er im Call_Impl zerst"ort werden, also nicht mehr benutzen! + // When the pSlot is a "Pseudoslot" for macros or Verbs, it can + // be destroyed in the Call_Impl, thus do not use it anymore! pReq->SetSynchronCall( sal_False ); - Call_Impl( *pSh, *pSlot, *pReq, pReq->AllowsRecording() ); //! woher bRecord? -// Call_Impl( *pShell, *pExec->pSlot, *pReq, sal_True ); //! woher bRecord? + Call_Impl( *pSh, *pSlot, *pReq, pReq->AllowsRecording() ); //! why bRecord? +// Call_Impl( *pShell, *pExec->pSlot, *pReq, sal_True ); //! why bRecord? DBG( pSfxApp->LeaveAsynchronCall_Impl() ); } @@ -1819,7 +1801,7 @@ sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, if ( bReadOnlyShell && !( nPos & SFX_VISIBILITY_READONLYDOC ) ) continue; - // check wether toolbar needs activation of a special feature + // check weather toolbar needs activation of a special feature sal_uInt32 nFeature = pIFace->GetObjectBarFeature(nNo); if ( nFeature && !pShell->HasUIFeature( nFeature ) ) continue; @@ -1946,9 +1928,9 @@ sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, //-------------------------------------------------------------------- void SfxDispatcher::FlushImpl() -/* [Beschreibung] +/* [Description] - Hilfsmethode zum Ausf"uhren der ausstehenden Push- und Pop-Befehle. + Helper method to execute the outstanding push and pop commands. */ { @@ -1969,8 +1951,8 @@ void SfxDispatcher::FlushImpl() if ( pImp->pParent ) pImp->pParent->Flush(); -// if ( pImp->bQuiet ) -// return; +// if ( pImp->bQuiet ) +// return; pImp->bFlushing = !pImp->bFlushing; if ( !pImp->bFlushing ) @@ -1988,7 +1970,7 @@ void SfxDispatcher::FlushImpl() SfxApplication *pSfxApp = SFX_APP(); - // in der 1. Runde den echten Stack 'um'bauen + // Re-build the true stack in the first round SfxToDoStack_Impl aToDoCopy; sal_Bool bModify = sal_False; short nToDo; @@ -1999,18 +1981,18 @@ void SfxDispatcher::FlushImpl() SfxToDo_Impl aToDo( pImp->aToDoStack.Top(nToDo) ); if ( aToDo.bPush ) { - // tats"aechlich pushen + // Actually push DBG_ASSERT( !pImp->aStack.Contains( aToDo.pCluster ), "pushed SfxShell already on stack" ); pImp->aStack.Push( aToDo.pCluster ); aToDo.pCluster->SetDisableFlags( pImp->nDisableFlags ); - // die bewegte Shell merken + // Mark the moved shell aToDoCopy.Push( aToDo ); } else { - // tats"aechlich poppen + // Actually pop SfxShell* pPopped = 0; bool bFound = false; do @@ -2020,7 +2002,7 @@ void SfxDispatcher::FlushImpl() pPopped->SetDisableFlags( 0 ); bFound = pPopped == aToDo.pCluster; - // die bewegte Shell merken + // Mark the moved Shell aToDoCopy.Push( SfxToDo_Impl( sal_False, aToDo.bDelete, sal_False, *pPopped) ); } while ( aToDo.bUntil && !bFound ); @@ -2031,7 +2013,7 @@ void SfxDispatcher::FlushImpl() pImp->aToDoStack.Clear(); } - // ggf. Bindings invalidieren + // Invalidate bindings, if possible if ( !pSfxApp->IsDowning() ) { if ( bModify ) @@ -2044,11 +2026,11 @@ void SfxDispatcher::FlushImpl() } pImp->bFlushing = sal_False; - pImp->bUpdated = sal_False; // nicht nur bei bModify, falls Doc/Template-Config + pImp->bUpdated = sal_False; // not only when bModify, if Doc/Template-Config bFlushed = sal_True; DBG_TRACE("Successfully flushed dispatcher!"); - // in der 2. Runde die Shells aktivieren und ggf. l"oschen + // Activate the Shells and possible delete them in the 2nd round for ( nToDo = aToDoCopy.Count()-1; nToDo >= 0; --nToDo ) { SfxToDo_Impl aToDo( aToDoCopy.Top(nToDo) ); @@ -2070,9 +2052,10 @@ void SfxDispatcher::FlushImpl() if( bAwakeBindings ) aToDoCopy.Clear(); - // Wenn bei Activate/Deactivate/Delete weitere Stackbewegungen erfolgt sind : + // If more changes have occured on the stach when + // Activate/Deactivate/Delete: if (!bFlushed) - // falls jemand Push/Pop gerufen hat, wurde auch EnterReg gerufen! + // If Push/Pop hs been called by someone, theb also EnterReg was called! FlushImpl(); if( bAwakeBindings && GetBindings() ) @@ -2092,52 +2075,51 @@ void SfxDispatcher::FlushImpl() void SfxDispatcher::SetSlotFilter ( HACK(hier muss mal ein enum rein) - sal_Bool bEnable, /* sal_True: - nur angegebene Slots enablen, - alle anderen disablen + sal_Bool bEnable, /* sal_True: + only enable specified slots, + disable all other sal_False: - die angegebenen Slots disablen, - alle anderen zun"achst enablen - */ - sal_uInt16 nCount, // Anzahl der SIDs im folgenden Array - const sal_uInt16* pSIDs // sortiertes Array von 'nCount' SIDs + disable specified slots, + first enable all other + */ + sal_uInt16 nCount, // Number of SIDs in the following Array + const sal_uInt16* pSIDs // sorted Array of 'nCount' SIDs ) -/* [Beschreibung] +/* [Description] - Mit dieser Methode wird ein Filter gesetzt, mit dem gezielt Slots - enabled bzw. disabled werden k"onnen. Das "ubergebene Array mu\s - bis zum Dtor bzw. n"achsten <SetSlotFilter()> erhalten bleiben, es - wird nicht vom Dispatcher gel"oscht, es kann daher static sein. + With this method a filter set, the target slots can be enabled or disabled. + The passed array must be retained until the destructor or the next + <SetSlotFilter()>, it is not deleted from the dispatcher, so it can thus be + static. - In ReadOnly-Dokumenten kann man mit 'bEnable==2' quasi das ReadOnlyDoc - Flag von Slots "ubersteuern, dieser werden also wieder gefunden. Auf - andere Slots hat das dann keine Auswirkung. + In read-only documents the quasi ReadOnlyDoc Flag of slots can be + overturned by the use of 'bEnable == 2', so this will be displayed again. + On the other slots it has no effect. + [Example] - [Beispiel] - - gezieltes disablen der Slots 1, 2 und 3: + Targeted disabling of Slots 1, 2 and 3: static sal_uInt16 const pSIDs[] = { 1, 2, 3 }; pDisp->SetSlotFilter( sal_False, sizeof(pSIDs)/sizeof(sal_uInt16), pSIDs ); - nur die Slots 5, 6 und 7 zulassen: + only permit Slots 5, 6 and 7: static sal_uInt16 const pSIDs[] = { 5, 6, 7 }; pDisp->SetSlotFilter( sal_True, sizeof(pSIDs)/sizeof(sal_uInt16), pSIDs ); - Filter ausschalten: + Turn-off Filter: pDisp->SetSlotFilter(); */ { #ifdef DBG_UTIL - // Array "uberpr"ufen + // Check Array for ( sal_uInt16 n = 1; n < nCount; ++n ) - DBG_ASSERT( pSIDs[n] > pSIDs[n-1], "SetSlotFilter: SIDs not sortet" ); + DBG_ASSERT( pSIDs[n] > pSIDs[n-1], "SetSlotFilter: SIDs not sorted" ); #endif if ( pImp->pFilterSIDs ) @@ -2171,59 +2153,59 @@ SfxCompareSIDs_Impl( const void* pSmaller, const void* pBigger ) //-------------------------------------------------------------------- sal_Bool SfxDispatcher::IsSlotEnabledByFilter_Impl( sal_uInt16 nSID ) const -/* [Beschreibung] +/* [Description] - Sucht 'nSID' in dem mit <SetSlotFilter()> gesetzten Filter und - liefert sal_True, falls die SID erlaubt ist, bzw. sal_False, falls sie - durch den Filter disabled ist. + Searches for 'nSID' in the Filter set by <SetSlotFilter()> and + returns sal_True, if the SIDis allowed, or sal_False, if it is + disabled by the Filter. - [R"uckgabewert] - sal_Bool 0 => disabled - 1 => enabled - 2 => enabled even if ReadOnlyDoc + [Return value] + sal_Bool 0 => disabled + 1 => enabled + 2 => enabled even if ReadOnlyDoc */ { - // kein Filter? + // no filter? if ( 0 == pImp->nFilterCount ) - // => alle SIDs erlaubt + // => all SIDs allowed return sal_True; - // suchen + // search sal_Bool bFound = 0 != bsearch( &nSID, pImp->pFilterSIDs, pImp->nFilterCount, sizeof(sal_uInt16), SfxCompareSIDs_Impl ); // even if ReadOnlyDoc if ( 2 == pImp->bFilterEnabling ) return bFound ? 2 : 1; - // sonst je nach Negativ/Positiv Filter + // Otherwise after Negative/Positive Filter return pImp->bFilterEnabling ? bFound : !bFound; } //-------------------------------------------------------------------- sal_Bool SfxDispatcher::_TryIntercept_Impl ( - sal_uInt16 nSlot, // zu suchende Slot-Id - SfxSlotServer& rServer, // zu f"uellende <SfxSlotServer>-Instanz - sal_Bool bSelf + sal_uInt16 nSlot, // Slot-Id to search for + SfxSlotServer& rServer, // <SfxSlotServer>-Instance to fill + sal_Bool bSelf ) { - // Eventuell geh"ort der parent auch zu einer Komponente + // Maybe the parent is also belongs to a component SfxDispatcher *pParent = pImp->pParent; sal_uInt16 nLevels = pImp->aStack.Count(); while ( pParent && pParent->pImp->pFrame ) { if ( pParent->pImp->pFrame->GetFrame().HasComponent() ) { - // Components d"urfen intercepten + // Components may be intercepted if ( pParent->_TryIntercept_Impl( nSlot, rServer, sal_True ) ) { - // Die eigenen Shells zum Shelllevel hinzuz"ahlen + // The own shells are added to the Shell Level rServer.SetShellLevel( rServer.GetShellLevel() + nLevels ); return sal_True; } else - // Keine weitere Interception + // No further Interception break; } else @@ -2234,7 +2216,7 @@ sal_Bool SfxDispatcher::_TryIntercept_Impl if ( bSelf ) { - // Die ComponentViewShell befragen + // Query the ComponentViewShell Flush(); SfxShell *pObjShell = GetShell(0); SfxInterface *pIFace = pObjShell->GetInterface(); @@ -2258,36 +2240,35 @@ sal_Bool SfxDispatcher::_TryIntercept_Impl sal_Bool SfxDispatcher::_FindServer ( - sal_uInt16 nSlot, // zu suchende Slot-Id - SfxSlotServer& rServer, // zu f"uellnde <SfxSlotServer>-Instanz - sal_Bool bModal // trotz ModalMode + sal_uInt16 nSlot, // Slot-Id to search for + SfxSlotServer& rServer, // <SfxSlotServer>-Instance to fill + sal_Bool bModal // Dispite ModalMode ) -/* [Beschreibung] +/* [Description] - Diese Hilfsmethode sucht den <Slot-Server>, der nSlot zur Zeit bedient. - Als Ergebnis wird rServer entsprechend gef"ullt. + This helper method searches for the <Slot-Server> which currently serves + the nSlot. As the result, rServe is filled accordingly. - Falls bekannt, kann das SfxInterface mitgegeben werden, von welchem - nSlot momentan bedient wird. + If known the SfxInterface which is currently served by nSlot can be + passed along. - Vor der Suche nach nSlot wird der SfxDispatcher geflusht. + The SfxDispatcher is flushed while searching for nSlot. + [Return value] - [R"uckgabewert] - sal_Bool sal_True - Der Slot wurde gefunden, rServer ist g"ultig. + sal_Bool sal_True + The Slot was found, rServer is valid. sal_False - Der Slot wird momentan nicht bedient, rServer - ist ung"ultig. + The Slot is currently not served, rServer is invalid. */ { SFX_STACK(SfxDispatcher::_FindServer); - // Dispatcher gelockt? (SID_HELP_PI trotzdem durchlassen) + // Dispatcher locked? (nevertheless let SID_HELP_PI through) SfxApplication *pSfxApp = SFX_APP(); if ( IsLocked(nSlot) ) { @@ -2295,7 +2276,7 @@ sal_Bool SfxDispatcher::_FindServer return sal_False; } - // Anzahl der Shells auf den verkettenten Dispatchern z"ahlen + // Count the number of Shells in the linked dispatchers. Flush(); sal_uInt16 nTotCount = pImp->aStack.Count(); if ( pImp->pParent ) @@ -2308,7 +2289,7 @@ sal_Bool SfxDispatcher::_FindServer } } - // Makro-Slot? + // Macro-Slot? if ( SfxMacroConfig::IsMacroSlot( nSlot ) ) { const SfxMacroInfo* pInfo = pSfxApp->GetMacroConfig()->GetMacroInfo(nSlot); @@ -2346,7 +2327,7 @@ sal_Bool SfxDispatcher::_FindServer } } - // SID gegen gesetzten Filter pr"ufen + // SID check against set filter sal_uInt16 nSlotEnableMode=0; if ( pImp->pFrame ) { @@ -2355,7 +2336,7 @@ sal_Bool SfxDispatcher::_FindServer return sal_False; } - // im Quiet-Mode nur Parent-Dispatcher + // In Quiet-Mode only Parent-Dispatcher if ( pImp->bQuiet ) { if ( pImp->pParent ) @@ -2370,10 +2351,11 @@ sal_Bool SfxDispatcher::_FindServer } sal_Bool bReadOnly = ( 2 != nSlotEnableMode && pImp->bReadOnly ); -// ( pImp->pFrame && pImp->pFrame->GetObjectShell() ); -// pImp->pFrame->GetObjectShell()->IsLoading() ); +// ( pImp->pFrame && pImp->pFrame->GetObjectShell() ); +// pImp->pFrame->GetObjectShell()->IsLoading() ); - // durch alle Shells der verketteten Dispatchern von oben nach unten suchen + // search through all the shells of the chained dispatchers + // from top to bottom #ifdef DBG_UTILx String aStack( "Stack:" ); #endif @@ -2392,26 +2374,26 @@ sal_Bool SfxDispatcher::_FindServer if ( pSlot ) { - // Slot geh"ort zum Container? + // Slot belongs to Container? bool bIsContainerSlot = pSlot->IsMode(SFX_SLOT_CONTAINER); bool bIsInPlace = pImp->pFrame && pImp->pFrame->GetObjectShell()->IsInPlaceActive(); - // Shell geh"ort zum Server? - // AppDispatcher oder IPFrame-Dispatcher + // Shell belongs to Server? + // AppDispatcher or IPFrame-Dispatcher 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. + // Of course ShellServer-Slots are also executable even when it is + // excecuted on a container dispatcher without a IPClient. if ( !bIsServerShell ) { SfxViewShell *pViewSh = pImp->pFrame->GetViewShell(); bIsServerShell = !pViewSh || !pViewSh->GetUIActiveClient(); } - // Shell geh"ort zum Container? - // AppDispatcher oder kein IPFrameDispatcher + // Shell belongs to Container? + // AppDispatcher or no IPFrameDispatcher bool bIsContainerShell = !pImp->pFrame || !bIsInPlace; - // Shell und Slot passen zusammen + // Shell and Slot match if ( !( ( bIsContainerSlot && bIsContainerShell ) || ( !bIsContainerSlot && bIsServerShell ) ) ) pSlot = 0; @@ -2465,7 +2447,7 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot ) } if ( SfxMacroConfig::IsMacroSlot( nSlot ) ) - // Makro-Slot? + // Macro-Slot? return sal_True; else if (nSlot >= SID_VERB_START && nSlot <= SID_VERB_END) { @@ -2480,7 +2462,7 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot ) } } - // SID gegen gesetzten Filter pr"ufen + // SID check against set filter sal_uInt16 nSlotEnableMode=0; if ( pImp->pFrame ) { @@ -2489,13 +2471,13 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot ) return sal_False; } - // im Quiet-Mode nur Parent-Dispatcher + // In Quiet-Mode only Parent-Dispatcher if ( pImp->bQuiet ) return sal_False; sal_Bool bReadOnly = ( 2 != nSlotEnableMode && pImp->bReadOnly ); -// ( pImp->pFrame && pImp->pFrame->GetObjectShell()); -// pImp->pFrame->GetObjectShell()->IsLoading() ); +// ( pImp->pFrame && pImp->pFrame->GetObjectShell()); +// pImp->pFrame->GetObjectShell()->IsLoading() ); for ( sal_uInt16 i=0 ; i < nTotCount; ++i ) { @@ -2510,27 +2492,27 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot ) if ( pSlot ) { - // Slot geh"ort zum Container? + // Slot belongs to Container? bool bIsContainerSlot = pSlot->IsMode(SFX_SLOT_CONTAINER); bool bIsInPlace = pImp->pFrame && pImp->pFrame->GetObjectShell()->IsInPlaceActive(); - // Shell geh"ort zum Server? - // AppDispatcher oder IPFrame-Dispatcher + // Shell belongs to Server? + // AppDispatcher or IPFrame-Dispatcher 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. + // Of course ShellServer-Slots are also executable even when it is + // excecuted on a container dispatcher without a IPClient if ( !bIsServerShell ) { SfxViewShell *pViewSh = pImp->pFrame->GetViewShell(); bIsServerShell = !pViewSh || !pViewSh->GetUIActiveClient(); } - // Shell geh"ort zum Container? - // AppDispatcher oder kein IPFrameDispatcher + // Shell belongs to Container? + // AppDispatcher or no IPFrameDispatcher bool bIsContainerShell = !pImp->pFrame || !bIsInPlace; - // Shell und Slot passen zusammen + // Shell and Slot match if ( !( ( bIsContainerSlot && bIsContainerShell ) || ( !bIsContainerSlot && bIsServerShell ) ) ) pSlot = 0; @@ -2546,23 +2528,21 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot ) return sal_False; } - - //-------------------------------------------------------------------- sal_Bool SfxDispatcher::_FillState ( - const SfxSlotServer& rSvr, // abzufragende <Slot-Server> - SfxItemSet& rState, // zu f"ullendes <SfxItemSet> - const SfxSlot* pRealSlot // ggf. der tats"achliche Slot + const SfxSlotServer& rSvr, // <Slot-Server> to query + SfxItemSet& rState, // <SfxItemSet> to be filled + const SfxSlot* pRealSlot // The actual Slot if possible ) -/* [Beschreibung] +/* [Description] - Hilfsmethode zum Abfragen des Status des <Slot-Server>s rSvr. - In rState m"ussen die gew"unschten Slots-Ids (teilweise in Which-Ids - des betreffenden Pools umgewandelt) vorhanden sein. + Helper method to obtain the status of the <Slot-Server>s rSvr. + The required slots IDs (partly converted to Which-IDs of the pool) + must be present in rstate. - Der SfxDispatcher wird vor der Abfrage geflusht. + The SfxDispatcher is flushed before the query. */ { @@ -2585,9 +2565,9 @@ sal_Bool SfxDispatcher::_FillState return FALSE; // Flush(); - // Objekt ermitteln und Message an diesem Objekt aufrufen + // Determine the object and call the Message of this object SfxShell *pSh = GetShell(rSvr.GetShellLevel()); - DBG_ASSERT(pSh, "ObjektShell nicht gefunden"); + DBG_ASSERT(pSh, "ObjektShell not found"); SfxStateFunc pFunc; @@ -2598,7 +2578,7 @@ sal_Bool SfxDispatcher::_FillState pSh->CallState( pFunc, rState ); #ifdef DBG_UTIL - // pr"ufen, ob IDL (SlotMap) und aktuelle Items "ubereinstimmen + // To examine the conformity of IDL (SlotMap) and current Items if ( DbgIsAssertWarning() && rState.Count() ) { SfxInterface *pIF = pSh->GetInterface(); @@ -2633,10 +2613,9 @@ sal_Bool SfxDispatcher::_FillState //-------------------------------------------------------------------- const SfxPoolItem* SfxDispatcher::_Execute( const SfxSlotServer &rSvr ) -/* [Beschreibung] +/* [Description] - Diese Methode f"uhrt einen Request "uber einen gecachten <Slot-Server> - aus. + This method performs a request for a cached <Slot-Server>. */ { @@ -2653,7 +2632,7 @@ const SfxPoolItem* SfxDispatcher::_Execute( const SfxSlotServer &rSvr ) SFX_APP()->GetMacroConfig()->RegisterSlotId( nSlot ); if ( pSlot->IsMode(SFX_SLOT_ASYNCHRON) ) - //! ignoriert rSvr + //! ignore rSvr { SfxShell *pShell = GetShell( rSvr.GetShellLevel() ); SfxDispatcher *pDispat = this; @@ -2676,10 +2655,10 @@ const SfxPoolItem* SfxDispatcher::_Execute( const SfxSlotServer &rSvr ) } else { - // Objekt ermitteln und Message an diesem Objekt aufrufen + // Determine the object and call the Message of this object SfxShell *pSh = GetShell(rSvr.GetShellLevel()); SfxRequest aReq( pSlot->GetSlotId(), SFX_CALLMODE_RECORD, pSh->GetPool() ); - if ( Call_Impl( *pSh, *pSlot, aReq, sal_True ) ) // von Bindings immer recorden + if ( Call_Impl( *pSh, *pSlot, aReq, sal_True ) ) // Bindings always recording return aReq.GetReturnValue(); } } @@ -2784,12 +2763,11 @@ void SfxDispatcher::ExecutePopup( const ResId &rId, Window *pWin, const Point *p //-------------------------------------------------------------------- void SfxDispatcher::Lock( sal_Bool bLock ) -/* [Beschreibung] +/* [Description] - Mit dieser Methode kann der SfxDispatcher gesperrt und freigegeben - werden. Ein gesperrter SfxDispatcher f"uhrt keine <SfxRequest>s mehr - aus und liefert keine Status-Informationen mehr. Er verh"alt sich - so als w"aren alle Slots disabled. + With this method the SfxDispatcher can be locked and released. A locked + SfxDispatcher does not perform <SfxRequest>s and does no longer provide + status information. It behaves as if all the slots were disabled. */ { @@ -2820,10 +2798,10 @@ sal_uInt32 SfxDispatcher::GetObjectBarId( sal_uInt16 nPos ) const //-------------------------------------------------------------------- void SfxDispatcher::ResetObjectBars_Impl() -/* [Beschreibung] +/* [Description] - Mit dieser Methode werden alle Objectbar-Anforderungen, die dieser - Dispatcher an das AppWindow hat, beseitigt. + With this method all Objectbar requirements which this Dispatcher + imposes on the AppWindow are eliminated. */ { for (sal_uInt16 n=0; n<SFX_OBJECTBAR_MAX; n++) @@ -2911,10 +2889,10 @@ sal_Bool SfxDispatcher::GetReadOnly_Impl() const //------------------------------------------------------------------------- void SfxDispatcher::SetQuietMode_Impl( sal_Bool bOn ) -/* [Beschreibung] +/* [Description] - Bei 'bOn' stellt sich dieser Dispatcher quasi tot und leitet alles - an den Parent-Dispatcher weiter. + With 'bOn' the Dispatcher is quasi dead and transfers everything to the + Parent-Dispatcher. */ { @@ -2927,9 +2905,9 @@ void SfxDispatcher::SetQuietMode_Impl( sal_Bool bOn ) //------------------------------------------------------------------------- void SfxDispatcher::SetModalMode_Impl( sal_Bool bOn ) -/* [Beschreibung] +/* [Description] - Bei 'bOn' werden nur noch Slots des Parent-Dispatchers gefunden. + With 'Bon' only slots of the parent dispatcher are found. */ { @@ -3008,8 +2986,8 @@ sal_Bool SfxDispatcher::IsReadOnlyShell_Impl( sal_uInt16 nShell ) const return sal_True; } -// Ein dirty trick, um an die Methoden der private base class von -// SfxShellStack_Impl heranzukommen +// A dirty trick, to get hold of the methods of the private base class +// SfxShellStack_Impl class StackAccess_Impl : public SfxShellStack_Implarr_ {}; @@ -3017,7 +2995,7 @@ void SfxDispatcher::InsertShell_Impl( SfxShell& rShell, sal_uInt16 nPos ) { Flush(); - // Der cast geht, weil SfxShellStack_Impl keine eigenen member hat + // The cast is because SfxShellStack_Impl member has non of its own ((StackAccess_Impl*) (&pImp->aStack))->Insert( nPos, &rShell ); rShell.SetDisableFlags( pImp->nDisableFlags ); rShell.DoActivate_Impl(pImp->pFrame, sal_True); @@ -3035,7 +3013,7 @@ void SfxDispatcher::RemoveShell_Impl( SfxShell& rShell ) { Flush(); - // Der cast geht, weil SfxShellStack_Impl keine eigenen member hat + // The cast is because SfxShellStack_Impl member has non of its own StackAccess_Impl& rStack = *((StackAccess_Impl*) (&pImp->aStack)); sal_uInt16 nCount = rStack.Count(); for ( sal_uInt16 n=0; n<nCount; ++n ) @@ -3063,16 +3041,17 @@ sal_Bool SfxDispatcher::IsAllowed sal_uInt16 nSlot ) const /* - [Beschreibung] - Die Methode prueft, ob der Zugriff auf diese Schnittstelle erlaubt ist. - */ + [Description] + + The method checks whether the access is allowed on this interface. + */ { if ( !pImp->pDisableList ) { return sal_True; } - // BinSearch in der DisableListe + // BinSearch in the disable list SvUShorts& rList = *pImp->pDisableList; sal_uInt16 nCount = rList.Count(); sal_uInt16 nLow = 0, nMid = 0, nHigh; @@ -3082,7 +3061,7 @@ sal_Bool SfxDispatcher::IsAllowed while ( !bFound && nLow <= nHigh ) { nMid = (nLow + nHigh) >> 1; - DBG_ASSERT( nMid < nCount, "bsearch ist buggy" ); + DBG_ASSERT( nMid < nCount, "bsearch is buggy" ); int nDiff = (int) nSlot - (int) rList[nMid]; if ( nDiff < 0) @@ -3102,7 +3081,7 @@ sal_Bool SfxDispatcher::IsAllowed } #ifdef _DEBUG - // Slot in der Liste gefunden ? + // Slot found in the List? sal_uInt16 nPos = bFound ? nMid : nLow; DBG_ASSERT( nPos <= nCount, "" ); diff --git a/sfx2/source/control/macrconf.cxx b/sfx2/source/control/macrconf.cxx index b2e43759f736..9e4777437df9 100644 --- a/sfx2/source/control/macrconf.cxx +++ b/sfx2/source/control/macrconf.cxx @@ -86,8 +86,8 @@ void SfxMacroConfig::Release_Impl() struct SfxMacroConfig_Impl { SfxMacroInfoArr_Impl aArr; - sal_uInt32 nEventId; - sal_Bool bWaitingForCallback; + sal_uInt32 nEventId; + sal_Bool bWaitingForCallback; SfxMacroConfig_Impl() : nEventId( 0 ) @@ -179,7 +179,7 @@ SfxMacroInfo::SfxMacroInfo( const String& rURL ) : 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 + // 'macro://[docname|.]/lib.mod.proc(args)' => Macro via included Doc-BASIC-Mgr if ( aTmp.CompareToAscii("///", 3 ) != COMPARE_EQUAL ) bAppBasic = FALSE; aTmp = rURL.GetToken( 3, '/' ); @@ -226,7 +226,7 @@ SfxMacroInfo::SfxMacroInfo(bool _bAppBasic, const String& rLibName, //========================================================================== SfxMacroInfo::SfxMacroInfo(bool _bAppBasic, const String& rQualifiedName ) -: pHelpText(0), +: pHelpText(0), nRefCnt(0), bAppBasic(_bAppBasic), nSlotId(0), @@ -299,14 +299,16 @@ String SfxMacroInfo::GetQualifiedName() const aMacroName += '.'; } - // Wg. ::com::sun::star::script::JavaScript kein Zerlegen des Strings mehr + // due to ::com::sun::star::script::JavaScript + // no more disassembly of the string aMacroName += aMethodName; return aMacroName; } String SfxMacroInfo::GetFullQualifiedName() const { - // Liefert nur Unsinn, wenn f"ur ein ::com::sun::star::script::JavaScript aufgerufen ! + // Returns only nonsense, when called for a + // ::com::sun::star::script::JavaScript ! String aRet; if ( bAppBasic ) aRet = SFX_APP()->GetName(); @@ -321,7 +323,7 @@ String SfxMacroInfo::GetURL() const 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://[docname|.]/lib.mod.proc(args)' => Macro via included Doc-BASIC-Mgr // 'macro://obj.method(args)' => Object via App-BASIC-Mgr String aURL( String::CreateFromAscii("macro://") ); if ( !bAppBasic ) @@ -436,17 +438,18 @@ SFX_EXEC_STUB( SfxApplication, MacroExec_Impl ) sal_uInt16 SfxMacroConfig::GetSlotId(SfxMacroInfoPtr pInfo) { - sal_uInt16 nCount = pImp->aArr.Count(); // Macro suchen + sal_uInt16 nCount = pImp->aArr.Count(); // Search for Macro sal_uInt16 i; for (i=0; i<nCount; i++) if ((*(pImp->aArr)[i]) == (*pInfo)) break; if (i == nCount) - { // Macro noch unbekannt + { + // Macro still unknown nCount = aIdArray.Count(); sal_uInt16 n; - for (n=0; n<nCount; n++) // freie SlotId suchen + for (n=0; n<nCount; n++) // Seearch for free SlotId if (aIdArray[n] > SID_MACRO_START + n) break; @@ -479,7 +482,7 @@ sal_uInt16 SfxMacroConfig::GetSlotId(SfxMacroInfoPtr pInfo) else pNewSlot->pNextSlot = pNewSlot; - // Macro uebernehmen + // Take over Macro SfxMacroInfoPtr pNewInfo = new SfxMacroInfo(*pInfo); pNewInfo->nSlotId = SID_MACRO_START + n; pImp->aArr.Insert(pNewInfo,n); @@ -500,7 +503,7 @@ sal_uInt16 SfxMacroConfig::GetSlotId(SfxMacroInfoPtr pInfo) void SfxMacroConfig::ReleaseSlotId(sal_uInt16 nId) { - DBG_ASSERT( IsMacroSlot( nId ), "SlotId ist kein Macro!"); + DBG_ASSERT( IsMacroSlot( nId ), "SlotId is no Macro!"); sal_uInt16 nCount = pImp->aArr.Count(); for (sal_uInt16 i=0; i<nCount; i++) @@ -511,23 +514,23 @@ void SfxMacroConfig::ReleaseSlotId(sal_uInt16 nId) pInfo->nRefCnt--; if (pInfo->nRefCnt == 0) { - // Slot wird nicht mehr referenziert, also holen + // Slot is no longer referenced, so get SfxSlot *pSlot = pInfo->pSlot; - // Slot aus der Verkettung rausnehmen + // Take out Slot from the concatenation while (pSlot->pNextSlot != pInfo->pSlot) pSlot = (SfxSlot*) pSlot->pNextSlot; pSlot->pNextSlot = pInfo->pSlot->pNextSlot; - // Slot selbst kurz schlie\sen + // Slot close itself briefly pSlot = pInfo->pSlot; pSlot->pNextSlot = pSlot; - // MacroInfo aus Array entfernen, damit sie kein Unheil - // anrichten kann + // Remove Macro info from array so that it can not cause + // any harm pImp->aArr.Remove(i); - // SlotId wieder freigeben + // Release SlotId again sal_uInt16 nIdCount = aIdArray.Count(); for (sal_uInt16 n=0; n<nIdCount; n++) { @@ -538,9 +541,9 @@ void SfxMacroConfig::ReleaseSlotId(sal_uInt16 nId) } } - // Sofern nicht die Applikation heruntergefahren wird, mu\s - // der Slot asynchron gel"oscht werden, falls er in seinem - // eigenen Execute abgeschossen wird! + // Unless the application is not shut down, then + // the Slot has to be deleted asynchronously if cancelled in + // its own Execute! if ( !SFX_APP()->Get_Impl()->bInQuit ) pImp->nEventId = Application::PostUserEvent( LINK(this, SfxMacroConfig, EventHdl_Impl), pInfo ); else @@ -550,14 +553,14 @@ void SfxMacroConfig::ReleaseSlotId(sal_uInt16 nId) } } - DBG_ERROR("Macro-SlotId nicht gefunden!"); + DBG_ERROR("Macro-SlotId is not found!"); } //========================================================================== void SfxMacroConfig::RegisterSlotId(sal_uInt16 nId) { - DBG_ASSERT( IsMacroSlot( nId ), "SlotId ist kein Macro!"); + DBG_ASSERT( IsMacroSlot( nId ), "SlotId is no Macro!"); sal_uInt16 nCount = pImp->aArr.Count(); for (sal_uInt16 i=0; i<nCount; i++) @@ -569,7 +572,7 @@ void SfxMacroConfig::RegisterSlotId(sal_uInt16 nId) } } - DBG_ERROR("Macro-SlotId nicht gefunden!"); + DBG_ERROR("Macro-SlotId is not found!"); } //========================================================================== @@ -608,7 +611,7 @@ sal_Bool SfxMacroConfig::ExecuteMacro( sal_uInt16 nId, const String& rArgs ) con SvxMacro aMacro( pInfo->GetQualifiedName(), pInfo->GetBasicName(), STARBASIC ); sal_Bool bRet = ExecuteMacro( pSh, &aMacro, rArgs ); - // Release, da im Dispatcher-Execute ein Register gemacht wurde + // Release, because a register was created in the dispatcher Execute ((SfxMacroConfig*)this)->ReleaseSlotId( nId ); return bRet; } @@ -617,11 +620,11 @@ sal_Bool SfxMacroConfig::ExecuteMacro( SfxObjectShell *pSh, const SvxMacro* pMac { SfxApplication *pApp = SFX_APP(); - // Name des Macros oder Scripts bzw. ScriptCode + // Name of the Macros or Scripts (ScriptCode) String aCode( pMacro->GetMacName() ); ErrCode nErr = ERRCODE_NONE; - // Ist es ein Basic-Macro ? + // Is it a Basic-Macro ? ScriptType eSType = pMacro->GetScriptType(); sal_Bool bIsBasic = eSType == STARBASIC; sal_Bool bIsStarScript = ( eSType == EXTENDED_STYPE && pMacro->GetLibName().SearchAscii( "StarScript" ) != STRING_NOTFOUND ); @@ -633,10 +636,10 @@ sal_Bool SfxMacroConfig::ExecuteMacro( SfxObjectShell *pSh, const SvxMacro* pMac BasicManager *pAppMgr = SFX_APP()->GetBasicManager(); if( bIsBasic ) { - // BasicManager von Document? + // BasicManager of the Document? BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL; - // Da leider der Name zwischendurch h"aufig gewechselt hat ... + // As the name has unfortunately been changed often ... if( SFX_APP()->GetName() == pMacro->GetLibName() || pMacro->GetLibName().EqualsAscii("StarDesktop") ) pMgr = pAppMgr; @@ -676,16 +679,16 @@ sal_Bool SfxMacroConfig::CheckMacro( SfxObjectShell *pSh, const SvxMacro* pMacro { SfxApplication *pApp = SFX_APP(); - // Name des Macros oder Scripts bzw. ScriptCode + // Name of Macros or Scripts (ScriptCode) String aCode( pMacro->GetMacName() ); ErrCode nErr = ERRCODE_NONE; - // BasicManager von Document oder Application + // BasicManager of Document or Application pApp->EnterBasicCall(); BasicManager *pAppMgr = SFX_APP()->GetBasicManager(); BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL; - // Da leider der Name zwischendurch h"aufig gewechselt hat ... + // As the name has unfortunately been changed often ... if( SFX_APP()->GetName() == pMacro->GetLibName() || pMacro->GetLibName().EqualsAscii("StarDesktop") ) pMgr = pAppMgr; @@ -706,14 +709,15 @@ sal_Bool SfxMacroConfig::CheckMacro( sal_uInt16 nId ) const 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 + // only initialize Basic, when default is not + // ::com::sun::star::script::JavaScript; then the Basic has to be created + // anyway in IsBasic() SfxObjectShell* pSh = SfxObjectShell::Current(); SfxApplication *pApp = SFX_APP(); pApp->EnterBasicCall(); - // BasicManager von Document oder Application + // BasicManager of Document or Application BasicManager *pAppMgr = SFX_APP()->GetBasicManager(); BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL; diff --git a/sfx2/source/control/macro.cxx b/sfx2/source/control/macro.cxx index 0ce978564735..55ff8057d4e0 100644 --- a/sfx2/source/control/macro.cxx +++ b/sfx2/source/control/macro.cxx @@ -46,40 +46,45 @@ SV_IMPL_PTRARR( SfxStatements_Impl, SfxMacroStatement* ); struct SfxMacro_Impl -/* [Beschreibung] +/* [Description] - Implementations-Struktur der Klasse <SfxMacro>. + Implementation structure for the <SfxMacro> class. */ { - SfxMacroMode eMode; /* Zweck der <SfxMacro>-Instanz, - Bedeutung siehe enum <SfxMacroMode> */ - SfxStatements_Impl aList; /* Liste von aufgezeichneten Statements */ + SfxMacroMode eMode; /* purpose of the <SfxMacro> instance, + for meaning see enum <SfxMacroMode> */ + SfxStatements_Impl aList; /* List of recorded Statements */ }; //==================================================================== SfxMacroStatement::SfxMacroStatement ( - const SfxShell& /*rShell*/, // <SfxShell>, die den Request ausf"uhrte - const String& /*rTarget*/, // Name des Zielobjektes vor der Ausf"urhung - BOOL /*bAbsolute*/, // obsolet - const SfxSlot& rSlot, // der <SfxSlot>, der das Statement abspielen kann - BOOL bRequestDone, // wurde der Request tats"achlich ausgef"uhrt + const SfxShell& /*rShell*/, // <SfxShell> which excexutes the Request + const String& /*rTarget*/, // Name of the target object for the + // excecution + BOOL /*bAbsolute*/, // obsolete + const SfxSlot& rSlot, // the <SfxSlot>, which can read the + // statement + BOOL bRequestDone, // Was the Request really excecuted ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& rArgs ) -/* [Beschreibung] +/* [Description] Dieser Konstruktor der Klasse SfxMacroStatement erzeugt ein Statement, bei dem ein Objekt angesprochen wird, welches durch 'rShell' angegeben ist. Dabei erfolgt die Addressierung je nach 'bAbsolute' absolut, also z.B. als '[mydoc.sdc]' oder relativ, also z.B. 'ActiveDocument'. - Je nach Art der Subklasse von 'rShell' ergeben sich folgende - Ausdr"ucke: + This constructor of the SfxMacroStatement class generate a statement in + which an object is brought up, which is given by 'rShell'. Thus It is + addressing the ever after 'bAbsolute' absolute, for example, as '[mydoc.sdc]', or relative, that is 'active document'. - | absolut relativ + Depending on the subclass of 'rShell', the following terms: + + | absolute relative ----------------------------------------------------------------------- SfxApplication' | 'StarCalc' 'Application' SfxViewFrame' | '[mydoc.sdc:1]' 'ActiveWindow' @@ -88,47 +93,44 @@ SfxMacroStatement::SfxMacroStatement sonstige (Sub-Shells) | '[mydoc.sdc:1]' 'ActiveWindow' Dabei sind 'StarCalc' stellvertretend fuer den Namen der Applikation - (Application::GetAppName()const). In der absoluten Fassung k"onnte + (Application::GetAppName()const). In der absoluten Fassung könnte 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. - F"ur das so bezeichnete Objekt wird dann je nach Typ des Slots - eine Zuweisung an eines seiner Properties oder der Aufruf einer seiner - Methoden ausgedr"uckt. - + For the so-called object is then, depending on the type of slots, + expressed as an assignment to one of its properties or calling its methods. - [Beispiele] + [Example] - absolut: + absolute: SCalc3.OpenDocument( "\docs\mydoc.sdd", "StarDraw Presentation", 0, 0 ) [mydoc.sdd].Activate() [mydoc.sdd:1].SwitchToView( 2 ) [mydoc.sdc:1:1].CellSelection( "A5-D8" ).LineColor = 192357 - relativ: + relative: ActiveWindow.LineColor = 192357 - - [Querverweise] + [Cross-reference] <SfxMacroStatement::SfxMacroStatement(const String&,const SfxSlot&,BOOL,SfxArguments*)> <SfxMacroStatement::SfxMacroStatement(const String&)> */ -: nSlotId( rSlot.GetSlotId() ), +: nSlotId( rSlot.GetSlotId() ), aArgs( rArgs ), bDone( bRequestDone ), pDummy( 0 ) { - // Workaround Recording nicht exportierter Slots (#25386#) + // Workaround Recording non exported Slots (#25386#) if ( !rSlot.pName ) return; aStatement = DEFINE_CONST_UNICODE("Selection"); - // an diesen Objekt-Ausdruck den Methoden-/Property-Namen und Parameter + // to these object expression of the Method-/Property-Name and parameters GenerateNameAndArgs_Impl( SfxRequest::GetRecordingMacro(), rSlot, bRequestDone, aArgs); } @@ -136,22 +138,22 @@ SfxMacroStatement::SfxMacroStatement 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 + const String& rTarget, // The Object which is addressed while playing + const SfxSlot& rSlot, // The <SfxSlot>, which can playback the statement + BOOL bRequestDone, // was the Request actually performed ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& rArgs ) -/* [Beschreibung] +/* [Description] - [Querverweise] + [Cross-reference] <SfxMacroStatement::SfxMacroStatement(const String&)> <SfxMacroStatement::SfxMacroStatement(const SfxShell&,BOOL,const SfxSlot&,BOOL,SfxArguments*)> */ -: nSlotId( rSlot.GetSlotId() ), +: nSlotId( rSlot.GetSlotId() ), aArgs( rArgs ), bDone( bRequestDone ), pDummy( 0 ) @@ -165,25 +167,24 @@ SfxMacroStatement::SfxMacroStatement SfxMacroStatement::SfxMacroStatement ( - const String& rStatement // manuell erzeugte(s) Statement(s) + const String& rStatement // manually generated statement(s) ) -/* [Beschreibung] - - Dieser Konstruktor erzeugt eine SfxMacroStatement-Instanz, deren - Aufbau vollst"andig vom Applikationsentwickler bestimmt wird. Da der - angegebene String auch mehrere mit CR/LF getrennte Statements - enthalten darf, ist damit ein weitgehender Eingriff in das Aufzeichnen - von BASIC-Makros m"oglich, um Spezialf"alle zu behandeln. +/* [Description] + This constructor creates a SfxMacroStatement instance, its structure is + determined completely by the application developer. Because the specified + string may contain several statements separated with CR/LF, which enables + a extensive in the recording of BASIC-macros, in order to handle special + cases. - [Querverweise] + [Cross-reference] <SfxMacroStatement::SfxMacroStatement(const String&,const SfxSlot&,BOOL,SfxArguments*)> <SfxMacroStatement::SfxMacroStatement(const SfxShell&,BOOL,const SfxSlot&,BOOL,SfxArguments*)> */ -: nSlotId( 0 ), +: nSlotId( 0 ), aStatement( rStatement ), bDone( TRUE ), pDummy( 0 ) @@ -194,15 +195,15 @@ SfxMacroStatement::SfxMacroStatement SfxMacroStatement::SfxMacroStatement ( - const SfxMacroStatement& rOrig // Original, von dem kopiert wird + const SfxMacroStatement& rOrig // Original, from which it will be copied ) -/* [Beschreibung] +/* [Description] - Copy-Konstruktor der SfxMacroStatement-Klasse. + Copy constructor of the sSfxMacroStatement class. */ -: nSlotId( rOrig.nSlotId ), +: nSlotId( rOrig.nSlotId ), aStatement( rOrig.aStatement ), bDone( rOrig.bDone ), pDummy( 0 ) @@ -214,10 +215,10 @@ SfxMacroStatement::SfxMacroStatement SfxMacroStatement::~SfxMacroStatement() -/* [Beschreibung] +/* [Description] - Destruktor der Klasse SfxMacroStatement. Gibt die Liste der - aktuellen Parameter frei. + Destructor of the SfxMacroStatement class. Frees the list of the + current parameters. */ { @@ -227,18 +228,17 @@ SfxMacroStatement::~SfxMacroStatement() 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 + SfxMacro* /*pMacro*/, // in this is recorded + const SfxSlot& rSlot, // the slot, which can playback the statement + BOOL bRequestDone, // TRUE=was executed, FALSE=cancelled ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& /*rArgs*/ ) -/* [Beschreibung] +/* [Description] - Interne Hilfsmethode zum generieren des Funktions-/Property-Names - sowie der Parameter. Diese Methode wird nur verwendet, wenn der - Anwendungsprogrammierer keinen eigenen Source an den <SfxRequest> - geh"angt hat. + Internal utility method for generating the functions-/property-names as + well as the parameter. This method is only used if the application + programmer has not attached his own source to the <SfxRequest>. */ { @@ -246,18 +246,18 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl && rSlot.pName[0] != '.' ) aStatement += '.'; - // der Name des Slots ist der Name der Methode / des Properties + // The name of the slots is the name of the method or properties aStatement += String::CreateFromAscii(rSlot.pName); if ( rSlot.IsMode(SFX_SLOT_METHOD) ) aStatement += DEFINE_CONST_UNICODE("( "); else aStatement += DEFINE_CONST_UNICODE(" = "); - // alle zusammengesuchten Parameter rausschreiben + // Print all required Parameters if ( aArgs.getLength() ) for ( USHORT nArg = 0; nArg < aArgs.getLength(); ++nArg ) { - // den Parameter textuell darstellen + // represent the parameters textually String aArg; ::com::sun::star::uno::Any& rValue = aArgs[nArg].Value; ::com::sun::star::uno::Type pType = rValue.getValueType(); @@ -284,7 +284,7 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl ::rtl::OUString sTemp; rValue >>= sTemp; - // Anf"uhrungszeichen werden verdoppelt + // Quotation marks are doubled XubString aRecordable( sTemp ); USHORT nPos = 0; while ( TRUE ) @@ -295,12 +295,12 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl nPos += 2; } - // nicht druckbare Zeichen werden als chr$(...) geschrieben + // non-printable characters are written as chr $(...) bool bPrevReplaced = false; for ( USHORT n = 0; n < aRecordable.Len(); ++n ) { sal_Unicode cChar = aRecordable.GetChar(n); - if ( !( cChar>=32 && cChar!=127 ) ) // ALS ERSATZ FUER String::IsPrintable()! + if ( !( cChar>=32 && cChar!=127 ) ) // As replacement for String::IsPrintable()! { XubString aReplacement( DEFINE_CONST_UNICODE("+chr$(") ); aReplacement += cChar; @@ -325,7 +325,7 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl else bPrevReplaced = false; - // Argument in Anf"uhrungszeichen + // Argument in quotation marks aArg = '"'; aArg += aRecordable; aArg += '"'; @@ -337,12 +337,12 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl pType == ::getVoidCppuType(), "Unknown Type in recorder!" ); } - // den Parameter anh"angen + // Attach the parameter aStatement += aArg; aStatement += DEFINE_CONST_UNICODE(", "); } - // Statement beeden + // End statement if ( aArgs.getLength() ) aStatement.Erase( aStatement.Len() - 2, 1 ); else @@ -351,7 +351,7 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl aStatement += ')'; if ( !bRequestDone ) - // nicht als "Done()" gekennzeichnete Statements auskommentieren + // not comment out the "Done ()" marked statements aStatement.InsertAscii( "rem ", 0 ); } @@ -359,29 +359,28 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl SfxMacro::SfxMacro ( - SfxMacroMode eMode // Zweck der Instanz, siehe <SfxMacroMode> + SfxMacroMode eMode // Purpose of the instance, see <SfxMacroMode> ) -/* [Beschreibung] +/* [Description] - Konstruktor der Klasse SfxMacro. Instanzen dieser Klasse werden im - SFx zu zwei Zwecken ben"otigt: + Constructor of the SfxMacro class. Instances of this class are required + for two purposes in SFx: - 1. zum Aufzeichnen von Makros - In diesem Fall wird der Konstruktor mit SFX_MACRO_RECORDINGABSOLUTE - oder SFX_MACRO_RECORDINGRELATIVE aufgerufen. Es sollte sich um eine - Instanz einer abgeleiteten Klasse handeln, um in der Ableitung - die Information dar"uber unterzubringen, wo das Makro gespeichert - werden soll. Ein solches Makro solle sich dann in seinem Destruktor - an der vom Benutzer gew"ahlten Stelle speichern. + 1. for recording macros + In this cas is th constructor called with SFX_MACRO_RECORDINGABSOLUTE or + SFX_MACRO_RECORDINGRELATIVE. Should be an instance of a derived class, + in order to acommodate the derivation of information, where the macro + should be saved. Such a macro should, in its destructor, be saved at the + location specified by the user. - 2. zum Zuordnen von exisitierenden Makros - In diesem Fall wird der Konstruktor mit SFX_MACRO_EXISTING aufgerufen. - Eine solche Instanz wird z.B. ben"otigt, wenn Makros auf Events - oder <SfxControllerItem>s konfiguriert werden sollen. + 2. Assignment of exisiting macros + In this case the constructor is called with SFX_MACRO_EXISTING. + Such a instance is for example needed when macros are to be configured for + events or <SfxControllerItem>s. */ -: pImp( new SfxMacro_Impl ) +: pImp( new SfxMacro_Impl ) { pImp->eMode = eMode; @@ -391,15 +390,13 @@ SfxMacro::SfxMacro SfxMacro::~SfxMacro() -/* [Beschreibung] +/* [Description] - Virtueller Destruktor der Klasse SfxMacro. Dieser sollte in den - abgeleiteten Klassen "uberladen werden, um in den Modi - SFX_MACRO_RECORDINGABSOLUTE und SFX_MACRO_RECORDINGRELATIVE den - aufgezeichneten Source abzuspeichern. + Virtual Destructor of the SfxMacro class. This should be overloaded in + the derived classes to save the recorded source in the mode + SFX_MACRO_RECORDINGABSOLUTE and SFX_MACRO_RECORDINGRELATIVE. - - [Querverweise] + [Cross-reference] <SfxMacro::GenerateSource()const> */ @@ -416,13 +413,12 @@ SfxMacro::~SfxMacro() SfxMacroMode SfxMacro::GetMode() const -/* [Beschreibung] - - Liefert den Modus, der besagt zu welchem Zweck das SfxMacro konstruiert - wurde. +/* [Description] + Returns the mode, which indicates for what purpose this SfxMacro was + constructed. - [Querverweise] + [Cross-reference] enum <SfxMacroMode> */ @@ -435,21 +431,20 @@ SfxMacroMode SfxMacro::GetMode() const void SfxMacro::Record ( - SfxMacroStatement* pStatement // aufzuzeichnendes <SfxMacroStatement> + SfxMacroStatement* pStatement // the recordning <SfxMacroStatement> ) -/* [Beschreibung] - - Diese Methode zeichnet das als Parameter "ubergeben Statement auf. - Die Instanz auf die der "ubergebe Pointer zeigt, geht in das Eigentum - des SfxMacro "uber. +/* [Description] - Der Aufruf ist nur g"ultig, wenn es sich um ein SfxMacro handelt, - welches mit SFX_MACRO_RECORDINGABSOLUTE oder SFX_MACRO_RECORDINGRELATIVE - konstruiert wirde. + This method features the parameters passed on as a Statement. The + instance to which the pointer points is transfered to the ownership + of SfxMacro. + The call is only valid if it is about a SfxMacro, which was constructed + with SFX_MACRO_RECORDINGRELATIVE or SFX_MACRO_RECORDINGABSOLUTE and is + available as an already recorded statement. - [Querverweise] + [Cross-reference] <SfxMacro::Replace(SfxMacroStatement*)> <SfxMacro::Remove()> @@ -465,35 +460,30 @@ void SfxMacro::Record void SfxMacro::Replace ( - SfxMacroStatement* pStatement // aufzuzeichnendes <SfxMacroStatement> + SfxMacroStatement* pStatement // the recording <SfxMacroStatement> ) -/* [Beschreibung] +/* [Description] - Diese Methode zeichnet das als Parameter "ubergeben Statement auf. - Dabei wird das jeweils zuletzt aufgezeichnete Statement "uberschrieben. - Die Instanz auf die der "ubergebe Pointer zeigt, geht in das Eigentum - des SfxMacro "uber. + This method records the statement passed on as a parameter. This will + overwrite the last recorded statement. The instance to which the passed + pointer points is transfered to the ownership of the SfxMacro. - Mit dieser Methode ist es m"oglich, Statements zusammenzufassen. Z.B. - anstelle f"unfmal hintereinander 'CursorLeft()' aufzurufen, k"onnte - das zu 'CursorLeft(5)' zusammengefa\st werden. Oder anstelle ein Wort - Buchstabe f"ur Buchstabe aufzubauen, k"onnte dies durch ein einziges - Statement 'InsertString("Hallo")' ersetzt werden. + With this method it is possible to combine statements. For example, instead + of calling the 'CursorLeft()' five times could be summarized as + 'CursorLeft (5)'. Or rather than building a word letter by letter, this + could be done by a single statement 'InsertString("Hello")'. - Der Aufruf ist nur g"ultig, wenn es sich um ein SfxMacro handelt, - welches mit SFX_MACRO_RECORDINGABSOLUTE oder SFX_MACRO_RECORDINGRELATIVE - konstruiert wurde und bereits ein aufgezeichnetes Statement vorhanden - ist. + The call is only valid if it is about a SfxMacro, which was constructed + with SFX_MACRO_RECORDINGRELATIVE or SFX_MACRO_RECORDINGABSOLUTE and is + available as an already recorded statement. + [Note] - [Anmerkung] + This method is typically called from the execute methods of + <SfxSlot>s created by the application developers. - Diese Methode wird typischerweise aus den Execute-Methoden der - <SfxSlot>s von den Applikationsentwicklern gerufen. - - - [Querverweise] + [Cross-reference] <SfxMacro::Record(SfxMacroStatement*)> <SfxMacro::Remove()> @@ -511,30 +501,26 @@ void SfxMacro::Replace void SfxMacro::Remove() -/* [Beschreibung] - - Diese Methode l"oscht das zuletzt aufgezeichnete <SfxMacroStatement> - und entfernt es aus dem Macro. +/* [Description] - Mit dieser Methode ist es m"oglich, Statements zusammenzufassen. Z.B. - anstelle f"unfmal hintereinander 'CursorLeft()' aufzurufen, k"onnte - das zu 'CursorLeft(5)' zusammengefa\st werden. Oder anstelle ein Wort - Buchstabe f"ur Buchstabe aufzubauen, k"onnte dies durch ein einziges - Statement 'InsertString("Hallo")' ersetzt werden. + This method deletes the last recorded <SfxMacroStatement> and removes + it from the macro. - Der Aufruf ist nur g"ultig, wenn es sich um ein SfxMacro handelt, - welches mit SFX_MACRO_RECORDINGABSOLUTE oder SFX_MACRO_RECORDINGRELATIVE - konstruiert wurde und bereits ein aufgezeichnetes Statement vorhanden - ist. + With this method it is possible to combine statements. For example, instead + of calling the 'CursorLeft()' five times could be summarized as + 'CursorLeft (5)'. Or rather than building a word letter by letter, this + could be done by a single statement 'InsertString("Hello")'. + The call is only valid if it is about a SfxMacro, which was constructed + with SFX_MACRO_RECORDINGRELATIVE or SFX_MACRO_RECORDINGABSOLUTE and is + available as an already recorded statement. - [Anmerkung] + [Note] - Diese Methode wird typischerweise aus den Execute-Methoden der - <SfxSlot>s von den Applikationsentwicklern gerufen. + This method is typically called from the the Execute methods of <SfxSlot>s + by the application developer. - - [Querverweise] + [Cross-reference] <SfxMacro::Replace(SfxMacroStatement*)> <SfxMacro::Record(SfxMacroStatement*)> @@ -551,19 +537,17 @@ void SfxMacro::Remove() const SfxMacroStatement* SfxMacro::GetLastStatement() const -/* [Beschreibung] - - Mit dieser Methode kann auf das jeweils zuletzt aufgezeichnete Statement - lesend zugegriffen werden. Zusammen mit der Methode - <SfxMacro::Replace(SfxMacroStatement*)> ergibt sich dadurch die - M"oglichkeit, Statements zusammenzufassen. +/* [Description] - Der Aufruf ist nur g"ultig, wenn es sich um ein SfxMacro handelt, - welches mit SFX_MACRO_RECORDINGABSOLUTE oder SFX_MACRO_RECORDINGRELATIVE - konstruiert wurde. + This method enables read access to the last recorded statement. + Together with the method <SfxMacro::Replace(SfxMacroStatement*)> this opens + for the possibility to summarize statements. + The call is only valid if it is about a SfxMacro, which was constructed + with SFX_MACRO_RECORDINGRELATIVE or SFX_MACRO_RECORDINGABSOLUTE and is + available as an already recorded statement. - [Querverweise] + [Cross-reference] <SfxMacro::Record(SfxMacroStatement*)> <SfxMacro::Replace(SfxMacroStatement*)> @@ -580,15 +564,14 @@ const SfxMacroStatement* SfxMacro::GetLastStatement() const String SfxMacro::GenerateSource() const -/* [Beschreibung] - - Diese Funktion generiert aus den, seit dem Konstruieren der Instanz - bis zum Zeitpunkt des Aufrufs dieser Methode aufgezeichneten - <SfxMacroStatement>s einen BASIC-Sourcecode, der die Statements, - jedoch nicht den Header ('Sub X') und den Footer ('End Sub') enth"alt. +/* [Description] + This function generates BASIC source code that contains the statements, but + does not contain the header ('Sub X') and Footer ('End Sub') from recorded + <SfxMacroStatement> since the construction of the instance until the time + of calling this method. - [Querverweise] + [Cross-reference] <SfxMacro::Record(SfxMacroStatement*)> <SfxMacro::Repeat(SfxMacroStatement*)> diff --git a/sfx2/source/control/makefile.mk b/sfx2/source/control/makefile.mk index 86797589e3aa..4dc271cadd06 100644 --- a/sfx2/source/control/makefile.mk +++ b/sfx2/source/control/makefile.mk @@ -36,7 +36,7 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/util$/makefile.pmk -# w.g. compilerbugs +# due to compilerbugs .IF "$(GUI)"=="WNT" .IF "$(COM)"!="GCC" CFLAGS+=-Od diff --git a/sfx2/source/control/minfitem.cxx b/sfx2/source/control/minfitem.cxx index e0eb5084edad..90281e1d8a71 100644 --- a/sfx2/source/control/minfitem.cxx +++ b/sfx2/source/control/minfitem.cxx @@ -40,7 +40,7 @@ TYPEINIT1(SfxMacroInfoItem, SfxPoolItem); // ----------------------------------------------------------------------- SfxMacroInfoItem::SfxMacroInfoItem( - USHORT nWhichId, // Slot-ID + USHORT nWhichId, // Slot-ID const BasicManager* pMgr, const String &rLibName, const String &rModuleName, @@ -57,7 +57,7 @@ SfxMacroInfoItem::SfxMacroInfoItem( // ----------------------------------------------------------------------- -// copy ctor +// copy constructor SfxMacroInfoItem::SfxMacroInfoItem(const SfxMacroInfoItem& rCopy): SfxPoolItem(rCopy), diff --git a/sfx2/source/control/msgpool.cxx b/sfx2/source/control/msgpool.cxx index 8d552c6d99ef..55e11abfaca3 100644 --- a/sfx2/source/control/msgpool.cxx +++ b/sfx2/source/control/msgpool.cxx @@ -31,7 +31,7 @@ #include <tools/stream.hxx> #include <rsc/rscsfx.hxx> -// wg. pSlotPool +// due to pSlotPool #include "appdata.hxx" #include <sfx2/msgpool.hxx> #include <sfx2/minarray.hxx> @@ -98,7 +98,6 @@ SfxSlotPool::~SfxSlotPool() } //==================================================================== - // registers the availability of the Interface of functions void SfxSlotPool::RegisterInterface( SfxInterface& rInterface ) @@ -110,8 +109,8 @@ void SfxSlotPool::RegisterInterface( SfxInterface& rInterface ) _pInterfaces = new SfxInterfaceArr_Impl; _pInterfaces->Append(&rInterface); - // bei einem (einzelnen) Null-Slot abbrechen (aus syntaktischen Gr"unden - // enthalten interfaces immer mindestens einen Slot) + // Stop at a (single) Null-slot (for syntactic reasons the interfaces + // always contain at least one slot) if ( rInterface.Count() == 1 && !rInterface[0]->nSlotId ) return; @@ -122,7 +121,7 @@ void SfxSlotPool::RegisterInterface( SfxInterface& rInterface ) if ( _pParentPool ) { - // Die Groups im parent Slotpool sind auch hier bekannt + // The Groups in parent Slotpool are also known here SfxSlotGroupArr_Impl& rGroups = *_pParentPool->_pGroups; for ( USHORT n=0; n<rGroups.Count(); n++ ) _pGroups->Append( rGroups[n] ); @@ -162,7 +161,6 @@ TypeId SfxSlotPool::GetSlotType( USHORT nId ) const } //==================================================================== - // unregisters the availability of the Interface of functions void SfxSlotPool::ReleaseInterface( SfxInterface& rInterface ) @@ -182,7 +180,7 @@ const SfxSlot* SfxSlotPool::GetSlot( USHORT nId ) DBG_MEMTEST(); DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" ); - // Zun"achst die eigenen Interfaces absuchen + // First, search their own interfaces for ( USHORT nInterf = 0; nInterf < _pInterfaces->Count(); ++nInterf ) { const SfxSlot *pDef = _pInterfaces->GetObject(nInterf)->GetSlot(nId); @@ -190,7 +188,7 @@ const SfxSlot* SfxSlotPool::GetSlot( USHORT nId ) return pDef; } - // Dann beim eventuell vorhandenen parent versuchen + // Then try any of the possible existing parent return _pParentPool ? _pParentPool->GetSlot( nId ) : 0; } @@ -209,15 +207,14 @@ String SfxSlotPool::SeekGroup( USHORT nNo ) _nCurGroup = nNo; if ( _pParentPool ) { - // Meistens stimmt die Reihenfolge der Ids "uberein + // In most cases, the order of the IDs agree USHORT nParentCount = _pParentPool->_pGroups->Count(); if ( nNo < nParentCount && (*_pGroups)[nNo] == (*_pParentPool->_pGroups)[nNo] ) _pParentPool->_nCurGroup = nNo; else { - // Ansonsten mu\s gesucht werden - // Wenn die Gruppe im parent pool nicht gefunden wird, wird - // _nCurGroup au\serhalb des g"ultigen Bereiches gesetzt + // Otherwise search. If the group is not found in the parent + // pool, _nCurGroup is set outside the valid range USHORT i; for ( i=1; i<nParentCount; i++ ) if ( (*_pGroups)[nNo] == (*_pParentPool->_pGroups)[i] ) @@ -230,7 +227,7 @@ String SfxSlotPool::SeekGroup( USHORT nNo ) aResId.SetRT(RSC_STRING); if ( !aResId.GetResMgr()->IsAvailable(aResId) ) { - DBG_ERROR( "GroupId-Name nicht im SFX definiert!" ); + DBG_ERROR( "GroupId-Name not defined in SFX!" ); return String(); } @@ -258,18 +255,18 @@ const SfxSlot* SfxSlotPool::SeekSlot( USHORT nStartInterface ) DBG_MEMTEST(); DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" ); - // Die Numerierung der interfaces startet beim parent pool + // The numbering starts at the interfaces of the parent pool USHORT nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0; - // sind wir am Ende des Parent-Pools angekommen? + // have reached the end of the Parent-Pools? if ( nStartInterface < nFirstInterface && _pParentPool->_nCurGroup >= _pParentPool->_pGroups->Count() ) nStartInterface = nFirstInterface; - // liegt das Interface noch im Parent-Pool? + // Is the Interface still in the Parent-Pool? if ( nStartInterface < nFirstInterface ) { - DBG_ASSERT( _pParentPool, "Kein parent pool!" ); + DBG_ASSERT( _pParentPool, "No parent pool!" ); _nCurInterface = nStartInterface; return _pParentPool->SeekSlot( nStartInterface ); } @@ -295,7 +292,6 @@ const SfxSlot* SfxSlotPool::SeekSlot( USHORT nStartInterface ) } //-------------------------------------------------------------------- - // skips to the next func in the current group const SfxSlot* SfxSlotPool::NextSlot() @@ -303,7 +299,7 @@ const SfxSlot* SfxSlotPool::NextSlot() DBG_MEMTEST(); DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" ); - // Die Numerierung der interfaces startet beim parent pool + // The numbering starts at the interfaces of the parent pool USHORT nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0; if ( _nCurInterface < nFirstInterface && _nCurGroup >= _pParentPool->_pGroups->Count() ) @@ -311,13 +307,13 @@ const SfxSlot* SfxSlotPool::NextSlot() if ( _nCurInterface < nFirstInterface ) { - DBG_ASSERT( _pParentPool, "Kein parent pool!" ); + DBG_ASSERT( _pParentPool, "No parent pool!" ); const SfxSlot *pSlot = _pParentPool->NextSlot(); _nCurInterface = _pParentPool->_nCurInterface; if ( pSlot ) return pSlot; if ( _nCurInterface == nFirstInterface ) - // parent pool ist fertig + // parent pool is ready return SeekSlot( nFirstInterface ); } @@ -340,9 +336,7 @@ const SfxSlot* SfxSlotPool::NextSlot() //-------------------------------------------------------------------- - -// SlotName erfragen, gfs. mit HilfeText - +// Query SlotName with help text //-------------------------------------------------------------------- SfxInterface* SfxSlotPool::FirstInterface() diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx index 33474bf29bb9..2db27a9078a2 100644 --- a/sfx2/source/control/objface.cxx +++ b/sfx2/source/control/objface.cxx @@ -130,7 +130,7 @@ static SfxObjectUI_Impl* CreateObjectBarUI_Impl( USHORT nPos, const ResId& rResI //==================================================================== //==================================================================== -// ctor, registeres a new unit +// constuctor, registeres a new unit SfxInterface::SfxInterface( const char *pClassName, const ResId& rNameResId, @@ -182,9 +182,9 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) pIter->GetSlotId() != (pIter+1)->GetSlotId(), "doppelte SID" ); - // jeder Master verweist auf seinen ersten Slave (ENUM), alle - // Slaves auf ihren Master. - // Slaves verweisen im Ring auf die anderen mit gleichem Master + // every master refers to his first slave (ENUM), + // all slaves refer to their master. + // Slaves refer in a circle to the other slaves with the same master if ( pIter->GetKind() == SFX_KIND_ENUM ) { pIter->pLinkedSlot = GetSlot( pIter->nMasterSlotId ); @@ -209,7 +209,8 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) } else if ( 0 == pIter->GetNextSlot() ) { - // Slots verweisen im Ring auf den n"achten mit derselben Statusmethode + // Slots refering in circle to the next with the same + // Status method. SfxSlot *pLastSlot = pIter; for ( USHORT n = nIter; n < Count(); ++n ) { @@ -232,7 +233,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) { if ( pNext->GetSlotId() <= pIter->GetSlotId() ) - DBG_ERROR ("Falsche Reihenfolge!"); + DBG_ERROR ("Wrong order!"); if ( pIter->GetKind() == SFX_KIND_ENUM ) { @@ -243,7 +244,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) { if ( pSlave->pLinkedSlot != pMasterSlot ) { - ByteString aStr("Falsche Master/Slave-Verkettung : "); + ByteString aStr("Wrong Master/Slave- link: "); aStr += ByteString::CreateFromInt32(pMasterSlot->GetSlotId()); aStr += " , "; aStr += ByteString::CreateFromInt32(pSlave->GetSlotId()); @@ -252,7 +253,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) if ( pSlave->nMasterSlotId != pMasterSlot->GetSlotId() ) { - ByteString aStr("Falsche Master/Slave-Ids : "); + ByteString aStr("Wrong Master/Slave-Ids: "); aStr += ByteString::CreateFromInt32(pMasterSlot->GetSlotId()); aStr += " , "; aStr += ByteString::CreateFromInt32(pSlave->GetSlotId()); @@ -269,7 +270,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) { if ( pIter->pLinkedSlot->GetKind() != SFX_KIND_ENUM ) { - ByteString aStr("Slave ist kein enum : "); + ByteString aStr("Slave is no enum: "); aStr += ByteString::CreateFromInt32(pIter->GetSlotId()); aStr += " , "; aStr += ByteString::CreateFromInt32(pIter->pLinkedSlot->GetSlotId()); @@ -283,7 +284,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) pCurSlot = pCurSlot->pNextSlot; if ( pCurSlot->GetStateFnc() != pIter->GetStateFnc() ) { - ByteString aStr("Verkettete Slots mit verschiedenen StateMethods : "); + ByteString aStr("Linked Slots with different State Methods : "); aStr += ByteString::CreateFromInt32(pCurSlot->GetSlotId()); aStr += " , "; aStr += ByteString::CreateFromInt32(pIter->GetSlotId()); @@ -299,11 +300,8 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) #endif } - //-------------------------------------------------------------------- - - SfxInterface::~SfxInterface() { SfxModule *pMod = pImpData->pModule; @@ -323,7 +321,6 @@ SfxInterface::~SfxInterface() // searches for the specified func - const SfxSlot* SfxInterface::GetSlot( USHORT nFuncId ) const { DBG_MEMTEST(); @@ -359,7 +356,6 @@ const SfxSlot* SfxInterface::GetSlot( const String& rCommand ) const //-------------------------------------------------------------------- - const SfxSlot* SfxInterface::GetRealSlot( const SfxSlot *pSlot ) const { DBG_MEMTEST(); @@ -370,7 +366,7 @@ const SfxSlot* SfxInterface::GetRealSlot( const SfxSlot *pSlot ) const { if(pGenoType) return pGenoType->GetRealSlot(pSlot); - DBG_ERROR("fremder Slot"); + DBG_ERROR("unknown Slot"); return 0; } @@ -379,7 +375,6 @@ const SfxSlot* SfxInterface::GetRealSlot( const SfxSlot *pSlot ) const //-------------------------------------------------------------------- - const SfxSlot* SfxInterface::GetRealSlot( USHORT nSlotId ) const { DBG_MEMTEST(); @@ -400,7 +395,6 @@ const SfxSlot* SfxInterface::GetRealSlot( USHORT nSlotId ) const //-------------------------------------------------------------------- - void SfxInterface::RegisterPopupMenu( const ResId& rResId ) { DBG_CHKTHIS(SfxInterface, 0); @@ -453,10 +447,10 @@ const ResId& SfxInterface::GetObjectBarResId( USHORT nNo ) const BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { - // Gibt es Toolbars in der Superklasse ? + // Are there toolbars in the super class? USHORT nBaseCount = pGenoType->GetObjectBarCount(); if ( nNo < nBaseCount ) - // Die der Superklasse kommen zuerst + // The Super class comes first return pGenoType->GetObjectBarResId( nNo ); else nNo = nNo - nBaseCount; @@ -464,7 +458,7 @@ const ResId& SfxInterface::GetObjectBarResId( USHORT nNo ) const #ifdef DBG_UTIL USHORT nObjBarCount = pImpData->pObjectBars->Count(); - DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unbekannt!" ); + DBG_ASSERT( nNo<nObjBarCount,"Objectbar is unknown!" ); #endif return (*pImpData->pObjectBars)[nNo]->aResId; } @@ -477,10 +471,10 @@ USHORT SfxInterface::GetObjectBarPos( USHORT nNo ) const BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { - // Gibt es Toolbars in der Superklasse ? + // Are there toolbars in the super class? USHORT nBaseCount = pGenoType->GetObjectBarCount(); if ( nNo < nBaseCount ) - // Die der Superklasse kommen zuerst + // The Super class comes first return pGenoType->GetObjectBarPos( nNo ); else nNo = nNo - nBaseCount; @@ -488,7 +482,7 @@ USHORT SfxInterface::GetObjectBarPos( USHORT nNo ) const #ifdef DBG_UTIL USHORT nObjBarCount = pImpData->pObjectBars->Count(); - DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unbekannt!" ); + DBG_ASSERT( nNo<nObjBarCount,"Objectbar is unknown!" ); #endif return (*pImpData->pObjectBars)[nNo]->nPos; } @@ -527,10 +521,10 @@ sal_uInt32 SfxInterface::GetChildWindowId (USHORT nNo) const { if ( pGenoType ) { - // Gibt es ChildWindows in der Superklasse ? + // Are there ChildWindows in der Superklasse? USHORT nBaseCount = pGenoType->GetChildWindowCount(); if ( nNo < nBaseCount ) - // Die der Superklasse kommen zuerst + // The Super class comes first return pGenoType->GetChildWindowId( nNo ); else nNo = nNo - nBaseCount; @@ -538,7 +532,7 @@ sal_uInt32 SfxInterface::GetChildWindowId (USHORT nNo) const #ifdef DBG_UTIL USHORT nCWCount = pImpData->pChildWindows->Count(); - DBG_ASSERT( nNo<nCWCount,"ChildWindow ist unbekannt!" ); + DBG_ASSERT( nNo<nCWCount,"ChildWindow is unknown!" ); #endif sal_uInt32 nRet = (*pImpData->pChildWindows)[nNo]->aResId.GetId(); if ( (*pImpData->pChildWindows)[nNo]->bContext ) @@ -550,10 +544,10 @@ sal_uInt32 SfxInterface::GetChildWindowFeature (USHORT nNo) const { if ( pGenoType ) { - // Gibt es ChildWindows in der Superklasse ? + // Are there ChildWindows in der Superklasse? USHORT nBaseCount = pGenoType->GetChildWindowCount(); if ( nNo < nBaseCount ) - // Die der Superklasse kommen zuerst + // The Super class comes first return pGenoType->GetChildWindowFeature( nNo ); else nNo = nNo - nBaseCount; @@ -561,7 +555,7 @@ sal_uInt32 SfxInterface::GetChildWindowFeature (USHORT nNo) const #ifdef DBG_UTIL USHORT nCWCount = pImpData->pChildWindows->Count(); - DBG_ASSERT( nNo<nCWCount,"ChildWindow ist unbekannt!" ); + DBG_ASSERT( nNo<nCWCount,"ChildWindow is unknown!" ); #endif return (*pImpData->pChildWindows)[nNo]->nFeature; } @@ -599,10 +593,10 @@ const String* SfxInterface::GetObjectBarName ( USHORT nNo ) const BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { - // Gibt es Toolbars in der Superklasse ? + // Are there toolbars in the super class? USHORT nBaseCount = pGenoType->GetObjectBarCount(); if ( nNo < nBaseCount ) - // Die der Superklasse kommen zuerst + // The Super class comes first return pGenoType->GetObjectBarName( nNo ); else nNo = nNo - nBaseCount; @@ -610,7 +604,7 @@ const String* SfxInterface::GetObjectBarName ( USHORT nNo ) const #ifdef DBG_UTIL USHORT nObjBarCount = pImpData->pObjectBars->Count(); - DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unbekannt!" ); + DBG_ASSERT( nNo<nObjBarCount,"Objectbar is unknown!" ); #endif return (*pImpData->pObjectBars)[nNo]->pName; } @@ -620,10 +614,10 @@ sal_uInt32 SfxInterface::GetObjectBarFeature ( USHORT nNo ) const BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { - // Gibt es Toolbars in der Superklasse ? + // Are there toolbars in the super class? USHORT nBaseCount = pGenoType->GetObjectBarCount(); if ( nNo < nBaseCount ) - // Die der Superklasse kommen zuerst + // The Super class comes first return pGenoType->GetObjectBarFeature( nNo ); else nNo = nNo - nBaseCount; @@ -631,7 +625,7 @@ sal_uInt32 SfxInterface::GetObjectBarFeature ( USHORT nNo ) const #ifdef DBG_UTIL USHORT nObjBarCount = pImpData->pObjectBars->Count(); - DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unbekannt!" ); + DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unknown!" ); #endif return (*pImpData->pObjectBars)[nNo]->nFeature; } @@ -641,10 +635,10 @@ BOOL SfxInterface::IsObjectBarVisible(USHORT nNo) const BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { - // Gibt es Toolbars in der Superklasse ? + // Are there toolbars in the super class? USHORT nBaseCount = pGenoType->GetObjectBarCount(); if ( nNo < nBaseCount ) - // Die der Superklasse kommen zuerst + // The Super class comes first return pGenoType->IsObjectBarVisible( nNo ); else nNo = nNo - nBaseCount; @@ -652,7 +646,7 @@ BOOL SfxInterface::IsObjectBarVisible(USHORT nNo) const #ifdef DBG_UTIL USHORT nObjBarCount = pImpData->pObjectBars->Count(); - DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unbekannt!" ); + DBG_ASSERT( nNo<nObjBarCount,"Objectbar is unknown!" ); #endif return (*pImpData->pObjectBars)[nNo]->bVisible; } @@ -662,17 +656,17 @@ const SfxInterface* SfxInterface::GetRealInterfaceForSlot( const SfxSlot *pRealS DBG_ASSERT( pImpData->bRegistered, "Interface not registered!" ); const SfxInterface* pInterface = this; - // Der Slot k"onnte auch aus dem Interface einer Shell-Basisklasse stammen + // The slot could also originate from the interface of a shell base class. do { const SfxSlot *pLastSlot = (*pInterface)[pInterface->Count()-1]; const SfxSlot *pFirstSlot = (*pInterface)[0]; - // Ist pInterface der Owner von pRealSlot ? + // Is pInterface the Owner of pRealSlot ? if ( pFirstSlot <= pRealSlot && pRealSlot <= pLastSlot ) break; - // Sonst Interface der Superklasse probieren + // Otherwise try the Interface of Super class pInterface = pInterface->pGenoType; } while ( pInterface ); @@ -680,6 +674,4 @@ const SfxInterface* SfxInterface::GetRealInterfaceForSlot( const SfxSlot *pRealS return pInterface; } - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |