// special key to return the Application constchar sAppService[] = "ooo.vba.Application";
constexpr OUString gsApplication( u"Application"_ustr );
VbaGlobalsBase::VbaGlobalsBase( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const OUString& sDocCtxName )
: Globals_BASE( xParent, xContext )
, msDocCtxName( sDocCtxName )
{ // overwrite context with custom one ( that contains the application ) // wrap the service manager as we don't want the disposing context to tear down the 'normal' ServiceManager ( or at least that's what the code appears like it wants to do )
uno::Reference< uno::XInterface > aSrvMgr; if ( xContext.is() && xContext->getServiceManager().is() )
{
aSrvMgr = xContext->getServiceManager()->createInstanceWithContext( u"com.sun.star.comp.stoc.OServiceManagerWrapper"_ustr , xContext );
}
::cppu::ContextEntry_Init aHandlerContextInfo[] =
{
::cppu::ContextEntry_Init( gsApplication, uno::Any() ),
::cppu::ContextEntry_Init( sDocCtxName, uno::Any() ),
::cppu::ContextEntry_Init( u"/singletons/com.sun.star.lang.theServiceManager"_ustr , uno::Any( aSrvMgr ) )
}; // don't pass a delegate, this seems to introduce yet another cyclic dependency ( and // some strange behavior
mxContext = ::cppu::createComponentContext(
aHandlerContextInfo,
SAL_N_ELEMENTS( aHandlerContextInfo ), nullptr ); if ( !aSrvMgr.is() ) return;
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.