// replaces the successor in the list of bindings of the same id
SfxControllerItem* SfxControllerItem::ChangeItemLink( SfxControllerItem* pNewLink )
{
SfxControllerItem* pOldLink = pNext;
pNext = pNewLink; return pOldLink == this ? nullptr : pOldLink;
}
// changes the id of unbound functions (e.g. for sub-menu-ids) void SfxControllerItem::SetId( sal_uInt16 nItemId )
{
DBG_ASSERT( !IsBound(), "changing id of bound binding" );
nId = nItemId;
}
// creates an atomic item for a controller without registration.
SfxControllerItem::SfxControllerItem()
: pNext(this)
, pBindings(nullptr)
, eFallbackCoreMetric(MapUnit::Map100thMM)
, nId(0)
{
}
// creates a representation of the function nId and registers it
SfxControllerItem::SfxControllerItem(sal_uInt16 nID, SfxBindings &rBindings)
: pNext(this)
, pBindings(&rBindings)
, eFallbackCoreMetric(MapUnit::Map100thMM)
, nId(nID)
{
Bind(nId, &rBindings);
}
// unregisters the item in the bindings
SfxControllerItem::~SfxControllerItem()
{
dispose();
}
void SfxControllerItem::dispose()
{ if ( IsBound() )
UnBind();
}
void SfxControllerItem::StateChangedAtToolBoxControl
(
sal_uInt16, // <SID> of the triggering slot
SfxItemState, // <SfxItemState> of 'pState' const SfxPoolItem* // Slot-Status, NULL or IsInvalidItem()
)
if ( !pDispat )
{
SfxViewFrame* pViewFrame = SfxViewFrame::Current(); if ( pViewFrame )
pDispat = pViewFrame->GetDispatcher();
}
if ( pDispat && pCache )
{ const SfxSlotServer *pServer = pCache->GetSlotServer( *pDispat ); if ( pServer )
{ if (SfxShell *pSh = pDispat->GetShell( pServer->GetShellLevel() ))
{
SfxItemPool &rPool = pSh->GetPool();
sal_uInt16 nWhich = rPool.GetWhichIDFromSlotID( nId );
// invalidate slot and its message|slot server as 'global' information // about the validated message|slot server is not made available
pCache->Invalidate( true );
return rPool.GetMetric( nWhich );
}
}
}
SAL_INFO( "sfx.control", "W1: Can not find ItemPool!" ); return eFallbackCoreMetric;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.