sal_Bool SAL_CALL BaseContainerControl::setModel( const Reference< XControlModel >& )
{ // This object has NO model. returnfalse;
}
// XControl
Reference< XControlModel > SAL_CALL BaseContainerControl::getModel()
{ // This object has NO model. // return (XControlModel*)this; return Reference< XControlModel >();
}
// XComponent
void SAL_CALL BaseContainerControl::dispose()
{ // Tell everything that this container is now gone. // It's faster if you listen to both the control and the container.
// Ready for multithreading
MutexGuard aGuard( m_aMutex );
// take memory for new item
IMPL_ControlInfo aNewControl;
// Ready for multithreading
MutexGuard aGuard (m_aMutex);
// set control
aNewControl.sName = rName;
aNewControl.xControl = rControl;
// and insert in list
maControlInfoList.emplace_back( aNewControl );
// initialize new control
aNewControl.xControl->setContext (getXWeak());
aNewControl.xControl->addEventListener ( static_cast< XEventListener* >( static_cast< XWindowListener* >( this ) ) );
// when container has a peer... if (getPeer().is())
{ // ... then create a peer on child
aNewControl.xControl->createPeer ( getPeer()->getToolkit(), getPeer() );
}
// Send message to all listener
comphelper::OInterfaceContainerHelper2* pInterfaceContainer = m_aListeners.getContainer( cppu::UnoType<XContainerListener>::get());
// Ready for multithreading
MutexGuard aGuard (m_aMutex);
// Search for right control auto it = std::find_if(maControlInfoList.begin(), maControlInfoList.end(),
[&rControl](const IMPL_ControlInfo& control)
{ return rControl == control.xControl; });
// if not found if ( it == maControlInfoList.end() ) return;
// remove listener from control
it->xControl->removeEventListener (static_cast< XEventListener* >( static_cast< XWindowListener* >( this ) ));
it->xControl->setContext ( Reference< XInterface > () );
// ... free memory
maControlInfoList.erase(it);
// Send message to all other listener
comphelper::OInterfaceContainerHelper2 * pInterfaceContainer = m_aListeners.getContainer( cppu::UnoType<XContainerListener>::get());
// Search for right control for( const IMPL_ControlInfo& rSearchControl : maControlInfoList )
{ if ( rSearchControl.sName == rName )
{ // We have found it ... // Break operation and return. return rSearchControl.xControl;
}
}
// We have not found it ... return NULL. return Reference< XControl > ();
}
// is it a top window ? if ( !getContext().is() && bVisible )
{ // then show it automatically
createPeer ( Reference< XToolkit > (), Reference< XWindowPeer > () );
}
}
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.