LCOV - code coverage report
Current view: top level - cpputools/source/unoexe - unoexe.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 135 222 60.8 %
Date: 2015-06-13 12:38:46 Functions: 15 20 75.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <stdio.h>
      21             : 
      22             : #include "sal/main.h"
      23             : #include <osl/diagnose.h>
      24             : #include <osl/mutex.hxx>
      25             : #include <osl/conditn.hxx>
      26             : 
      27             : #include <rtl/process.h>
      28             : #include <rtl/string.h>
      29             : #include <rtl/strbuf.hxx>
      30             : #include <rtl/ustrbuf.hxx>
      31             : 
      32             : #include <cppuhelper/bootstrap.hxx>
      33             : #include <cppuhelper/implbase1.hxx>
      34             : 
      35             : #include <com/sun/star/lang/XMain.hpp>
      36             : #include <com/sun/star/lang/XInitialization.hpp>
      37             : #include <com/sun/star/lang/XComponent.hpp>
      38             : #include <com/sun/star/lang/XSingleComponentFactory.hpp>
      39             : #include <com/sun/star/lang/XSingleServiceFactory.hpp>
      40             : #include <com/sun/star/lang/XEventListener.hpp>
      41             : #include <com/sun/star/loader/XImplementationLoader.hpp>
      42             : #include <com/sun/star/registry/XRegistryKey.hpp>
      43             : #include <com/sun/star/connection/Acceptor.hpp>
      44             : #include <com/sun/star/connection/XConnection.hpp>
      45             : #include <com/sun/star/bridge/XBridgeFactory.hpp>
      46             : #include <com/sun/star/bridge/XBridge.hpp>
      47             : 
      48             : using namespace std;
      49             : using namespace osl;
      50             : using namespace cppu;
      51             : using namespace com::sun::star::uno;
      52             : using namespace com::sun::star::lang;
      53             : using namespace com::sun::star::loader;
      54             : using namespace com::sun::star::registry;
      55             : using namespace com::sun::star::connection;
      56             : using namespace com::sun::star::bridge;
      57             : using namespace com::sun::star::container;
      58             : 
      59             : namespace unoexe
      60             : {
      61             : 
      62             : static bool s_quiet = false;
      63             : 
      64           3 : static inline void out( const sal_Char * pText )
      65             : {
      66           3 :     if (! s_quiet)
      67           0 :         fprintf( stderr, "%s", pText );
      68           3 : }
      69             : 
      70           1 : static inline void out( const OUString & rText )
      71             : {
      72           1 :     if (! s_quiet)
      73             :     {
      74           0 :         OString aText( OUStringToOString( rText, RTL_TEXTENCODING_ASCII_US ) );
      75           0 :         fprintf( stderr, "%s", aText.getStr() );
      76             :     }
      77           1 : }
      78             : 
      79             : static const char arUsingText[] =
      80             : "\nusing:\n\n"
      81             : "uno [-c ComponentImplementationName -l LocationUrl | -s ServiceName]\n"
      82             : "    [-u uno:(socket[,host=HostName][,port=nnn]|pipe[,name=PipeName]);<protocol>;Name\n"
      83             : "        [--singleaccept] [--singleinstance]]\n"
      84             : "    [--quiet]\n"
      85             : "    [-- Argument1 Argument2 ...]\n";
      86             : 
      87          15 : static bool readOption( OUString * pValue, const sal_Char * pOpt,
      88             :                         sal_uInt32 * pnIndex, const OUString & aArg)
      89             :     throw (RuntimeException)
      90             : {
      91          15 :     const OUString dash("-");
      92          15 :     if(!aArg.startsWith(dash))
      93           0 :         return false;
      94             : 
      95          30 :     OUString aOpt = OUString::createFromAscii( pOpt );
      96             : 
      97          15 :     if (aArg.getLength() < aOpt.getLength())
      98           0 :         return false;
      99             : 
     100          15 :     if (aOpt.equalsIgnoreAsciiCase( aArg.copy(1) ))
     101             :     {
     102             :         // take next argument
     103           2 :         ++(*pnIndex);
     104             : 
     105           2 :         rtl_getAppCommandArg(*pnIndex, &pValue->pData);
     106           2 :         if (*pnIndex >= rtl_getAppCommandArgCount() || pValue->copy(1).equals(dash))
     107             :         {
     108           0 :             throw RuntimeException( "incomplete option \"-" + aOpt + "\" given!" );
     109             :         }
     110             :         else
     111             :         {
     112             : #if OSL_DEBUG_LEVEL > 1
     113             :             out( "\n> identified option -" );
     114             :             out( pOpt );
     115             :             out( " = " );
     116             :             OString tmp = OUStringToOString(aArg, RTL_TEXTENCODING_ASCII_US);
     117             :               out( tmp.getStr() );
     118             : #endif
     119           2 :             ++(*pnIndex);
     120           2 :             return true;
     121             :         }
     122             :     }
     123          13 :       else if (aArg.indexOf(aOpt) == 1)
     124             :     {
     125           0 :         *pValue = aArg.copy(1 + aOpt.getLength());
     126             : #if OSL_DEBUG_LEVEL > 1
     127             :         out( "\n> identified option -" );
     128             :         out( pOpt );
     129             :         out( " = " );
     130             :         OString tmp = OUStringToOString(aArg.copy(aOpt.getLength()), RTL_TEXTENCODING_ASCII_US);
     131             :         out( tmp.getStr() );
     132             : #endif
     133           0 :         ++(*pnIndex);
     134             : 
     135           0 :         return true;
     136             :     }
     137          28 :     return false;
     138             : }
     139             : 
     140           3 : static bool readOption( bool * pbOpt, const sal_Char * pOpt,
     141             :                         sal_uInt32 * pnIndex, const OUString & aArg)
     142             : {
     143           3 :     const OUString dashdash("--");
     144           6 :     OUString aOpt = OUString::createFromAscii(pOpt);
     145             : 
     146           3 :     if(aArg.startsWith(dashdash) && aOpt.equals(aArg.copy(2)))
     147             :     {
     148           2 :         ++(*pnIndex);
     149           2 :         *pbOpt = true;
     150             : #if OSL_DEBUG_LEVEL > 1
     151             :         out( "\n> identified option --" );
     152             :         out( pOpt );
     153             : #endif
     154           2 :         return true;
     155             :     }
     156           4 :     return false;
     157             : }
     158             : 
     159             : template< class T >
     160           2 : void createInstance(
     161             :     Reference< T > & rxOut,
     162             :     const Reference< XComponentContext > & xContext,
     163             :     const OUString & rServiceName )
     164             :     throw (Exception)
     165             : {
     166           2 :     Reference< XMultiComponentFactory > xMgr( xContext->getServiceManager() );
     167           4 :     Reference< XInterface > x( xMgr->createInstanceWithContext( rServiceName, xContext ) );
     168             : 
     169           2 :     if (! x.is())
     170             :     {
     171           0 :         throw RuntimeException( "cannot get service instance \"" + rServiceName + "\"!" );
     172             :     }
     173             : 
     174           2 :     rxOut = Reference< T >::query( x );
     175           2 :     if (! rxOut.is())
     176             :     {
     177           0 :         const Type & rType = cppu::UnoType<T>::get();
     178           0 :         throw RuntimeException(
     179           0 :             "service instance \"" + rServiceName +
     180           0 :             "\" does not support demanded interface \"" +
     181           0 :             rType.getTypeName() + "\"!" );
     182           2 :     }
     183           2 : }
     184             : 
     185           0 : static Reference< XInterface > loadComponent(
     186             :     const Reference< XComponentContext > & xContext,
     187             :     const OUString & rImplName, const OUString & rLocation )
     188             :     throw (Exception)
     189             : {
     190             :     // determine loader to be used
     191           0 :     sal_Int32 nDot = rLocation.lastIndexOf( '.' );
     192           0 :     if (nDot > 0 && nDot < rLocation.getLength())
     193             :     {
     194           0 :         Reference< XImplementationLoader > xLoader;
     195             : 
     196           0 :         OUString aExt( rLocation.copy( nDot +1 ) );
     197             : 
     198           0 :         if (aExt == "dll" || aExt == "exe" || aExt == "dylib" || aExt == "so")
     199             :         {
     200             :             createInstance(
     201           0 :                 xLoader, xContext, OUString("com.sun.star.loader.SharedLibrary") );
     202             :         }
     203           0 :         else if (aExt == "jar" || aExt == "class")
     204             :         {
     205             :             createInstance(
     206           0 :                 xLoader, xContext, OUString("com.sun.star.loader.Java") );
     207             :         }
     208             :         else
     209             :         {
     210             :             throw RuntimeException(
     211           0 :                 "unknown extension of \"" + rLocation + "\"!  No loader available!" );
     212             :         }
     213             : 
     214           0 :         Reference< XInterface > xInstance;
     215             : 
     216             :         // activate
     217           0 :         Reference< XInterface > xFactory( xLoader->activate(
     218           0 :             rImplName, OUString(), rLocation, Reference< XRegistryKey >() ) );
     219           0 :         if (xFactory.is())
     220             :         {
     221           0 :             Reference< XSingleComponentFactory > xCFac( xFactory, UNO_QUERY );
     222           0 :             if (xCFac.is())
     223             :             {
     224           0 :                 xInstance = xCFac->createInstanceWithContext( xContext );
     225             :             }
     226             :             else
     227             :             {
     228           0 :                 Reference< XSingleServiceFactory > xSFac( xFactory, UNO_QUERY );
     229           0 :                 if (xSFac.is())
     230             :                 {
     231           0 :                     out( "\n> warning: ignroing context for implementation \"" );
     232           0 :                     out( rImplName );
     233           0 :                     out( "\"!" );
     234           0 :                     xInstance = xSFac->createInstance();
     235           0 :                 }
     236           0 :             }
     237             :         }
     238             : 
     239           0 :         if (! xInstance.is())
     240             :         {
     241             :             throw RuntimeException(
     242           0 :                 "activating component \"" + rImplName + "\" from location \"" + rLocation + "\" failed!" );
     243             :         }
     244             : 
     245           0 :         return xInstance;
     246             :     }
     247             :     else
     248             :     {
     249             :         throw RuntimeException(
     250           0 :             "location \"" + rLocation + "\" has no extension!  Cannot determine loader to be used!" );
     251             :     }
     252             : }
     253             : 
     254           0 : class OInstanceProvider
     255             :     : public WeakImplHelper1< XInstanceProvider >
     256             : {
     257             :     Reference< XComponentContext > _xContext;
     258             : 
     259             :     Mutex                             _aSingleInstanceMutex;
     260             :     Reference< XInterface >           _xSingleInstance;
     261             :     bool                              _bSingleInstance;
     262             : 
     263             :     OUString                          _aImplName;
     264             :     OUString                          _aLocation;
     265             :     OUString                          _aServiceName;
     266             :     Sequence< Any >                   _aInitParams;
     267             : 
     268             :     OUString                          _aInstanceName;
     269             : 
     270             :     inline Reference< XInterface > createInstance() throw (Exception);
     271             : 
     272             : public:
     273           1 :     OInstanceProvider( const Reference< XComponentContext > & xContext,
     274             :                        const OUString & rImplName, const OUString & rLocation,
     275             :                        const OUString & rServiceName, const Sequence< Any > & rInitParams,
     276             :                        bool bSingleInstance, const OUString & rInstanceName )
     277             :         : _xContext( xContext )
     278             :         , _bSingleInstance( bSingleInstance )
     279             :         , _aImplName( rImplName )
     280             :         , _aLocation( rLocation )
     281             :         , _aServiceName( rServiceName )
     282             :         , _aInitParams( rInitParams )
     283           1 :         , _aInstanceName( rInstanceName )
     284           1 :         {}
     285             : 
     286             :     // XInstanceProvider
     287             :     virtual Reference< XInterface > SAL_CALL getInstance( const OUString & rName )
     288             :         throw (NoSuchElementException, RuntimeException, std::exception) SAL_OVERRIDE;
     289             : };
     290             : 
     291           0 : inline Reference< XInterface > OInstanceProvider::createInstance()
     292             :     throw (Exception)
     293             : {
     294           0 :     Reference< XInterface > xRet;
     295           0 :     if (!_aImplName.isEmpty()) // manually via loader
     296           0 :         xRet = loadComponent( _xContext, _aImplName, _aLocation );
     297             :     else // via service manager
     298           0 :         unoexe::createInstance( xRet, _xContext, _aServiceName );
     299             : 
     300             :     // opt XInit
     301           0 :     Reference< XInitialization > xInit( xRet, UNO_QUERY );
     302           0 :     if (xInit.is())
     303           0 :         xInit->initialize( _aInitParams );
     304             : 
     305           0 :     return xRet;
     306             : }
     307             : 
     308           1 : Reference< XInterface > OInstanceProvider::getInstance( const OUString & rName )
     309             :     throw (NoSuchElementException, RuntimeException, std::exception)
     310             : {
     311             :     try
     312             :     {
     313           1 :         if (_aInstanceName == rName)
     314             :         {
     315           1 :             Reference< XInterface > xRet;
     316             : 
     317           1 :             if (_aImplName.isEmpty() && _aServiceName.isEmpty())
     318             :             {
     319             :                 OSL_ASSERT( rName == "uno.ComponentContext" );
     320           1 :                 xRet = _xContext;
     321             :             }
     322           0 :             else if (_bSingleInstance)
     323             :             {
     324           0 :                 if (! _xSingleInstance.is())
     325             :                 {
     326           0 :                     MutexGuard aGuard( _aSingleInstanceMutex );
     327           0 :                     if (! _xSingleInstance.is())
     328             :                     {
     329           0 :                         _xSingleInstance = createInstance();
     330           0 :                     }
     331             :                 }
     332           0 :                 xRet = _xSingleInstance;
     333             :             }
     334             :             else
     335             :             {
     336           0 :                 xRet = createInstance();
     337             :             }
     338             : 
     339           2 :             return xRet;
     340             :         }
     341             :     }
     342           0 :     catch (Exception & rExc)
     343             :     {
     344           0 :         out( "\n> error: " );
     345           0 :         out( rExc.Message );
     346             :     }
     347             :     throw NoSuchElementException(
     348           0 :         "no such element \"" + rName + "\"!" );
     349             : }
     350             : 
     351           3 : struct ODisposingListener : public WeakImplHelper1< XEventListener >
     352             : {
     353             :     Condition cDisposed;
     354             : 
     355             :     // XEventListener
     356             :     virtual void SAL_CALL disposing( const EventObject & rEvt )
     357             :         throw (RuntimeException, std::exception) SAL_OVERRIDE;
     358             : 
     359             :     static void waitFor( const Reference< XComponent > & xComp );
     360             : };
     361             : 
     362           1 : void ODisposingListener::disposing( const EventObject & )
     363             :     throw (RuntimeException, std::exception)
     364             : {
     365           1 :     cDisposed.set();
     366           1 : }
     367             : 
     368           1 : void ODisposingListener::waitFor( const Reference< XComponent > & xComp )
     369             : {
     370           1 :     ODisposingListener * pListener = new ODisposingListener();
     371           1 :     Reference< XEventListener > xListener( pListener );
     372             : 
     373           1 :     xComp->addEventListener( xListener );
     374           1 :     pListener->cDisposed.wait();
     375           1 : }
     376             : 
     377             : } // namespace unoexe
     378             : 
     379             : using namespace unoexe;
     380             : 
     381           4 : SAL_IMPLEMENT_MAIN()
     382             : {
     383           2 :     sal_uInt32 nCount = rtl_getAppCommandArgCount();
     384           2 :     if (nCount == 0)
     385             :     {
     386           0 :         out( arUsingText );
     387           0 :         return 0;
     388             :     }
     389             : 
     390           2 :     sal_Int32 nRet = 0;
     391           2 :     Reference< XComponentContext > xContext;
     392             : 
     393             : 
     394             :     try
     395             :     {
     396           4 :         OUString aImplName, aLocation, aServiceName, aUnoUrl;
     397           4 :         Sequence< OUString > aParams;
     398           2 :         bool bSingleAccept = false;
     399           2 :         bool bSingleInstance = false;
     400             : 
     401             :         // read command line arguments
     402             : 
     403           2 :         sal_uInt32 nPos = 0;
     404             :         // read up to arguments
     405           8 :         while (nPos < nCount)
     406             :         {
     407           5 :             OUString arg;
     408             : 
     409           5 :             rtl_getAppCommandArg(nPos, &arg.pData);
     410             : 
     411           9 :             const OUString dashdash("--");
     412           5 :             if (dashdash == arg)
     413             :             {
     414           1 :                 ++nPos;
     415           1 :                 break;
     416             :             }
     417             : 
     418          12 :             if (!(readOption( &aImplName, "c", &nPos, arg)                ||
     419           8 :                   readOption( &aLocation, "l", &nPos, arg)                ||
     420           7 :                   readOption( &aServiceName, "s", &nPos, arg)             ||
     421           5 :                   readOption( &aUnoUrl, "u", &nPos, arg)                  ||
     422           3 :                   readOption( &s_quiet, "quiet", &nPos, arg)              ||
     423           1 :                   readOption( &bSingleAccept, "singleaccept", &nPos, arg) ||
     424           4 :                   readOption( &bSingleInstance, "singleinstance", &nPos, arg)))
     425             :             {
     426             :                 throw RuntimeException(
     427           0 :                     "unexpected argument \"" + arg + "\"" );
     428             :             }
     429           4 :         }
     430             : 
     431           2 :         if (!(aImplName.isEmpty() || aServiceName.isEmpty()))
     432           0 :             throw RuntimeException("give component exOR service name!" );
     433           2 :         if (aImplName.isEmpty() && aServiceName.isEmpty())
     434             :         {
     435           1 :             if (! aUnoUrl.endsWithIgnoreAsciiCase( ";uno.ComponentContext" ))
     436             :                 throw RuntimeException(
     437           0 :                     "expected UNO-URL with instance name uno.ComponentContext!" );
     438           1 :             if (bSingleInstance)
     439             :                 throw RuntimeException(
     440           0 :                     "unexpected option --singleinstance!" );
     441             :         }
     442           2 :         if (!aImplName.isEmpty() && aLocation.isEmpty())
     443           0 :             throw RuntimeException("give component location!" );
     444           2 :         if (!aServiceName.isEmpty() && !aLocation.isEmpty())
     445           0 :             out( "\n> warning: service name given, will ignore location!" );
     446             : 
     447             :         // read component params
     448           2 :         aParams.realloc( nCount - nPos );
     449           2 :         OUString * pParams = aParams.getArray();
     450             : 
     451           2 :         sal_uInt32 nOffset = nPos;
     452           3 :         for ( ; nPos < nCount; ++nPos )
     453             :         {
     454           1 :             rtl_getAppCommandArg( nPos, &pParams[nPos -nOffset].pData );
     455             :         }
     456             : 
     457           2 :         xContext = defaultBootstrap_InitialComponentContext();
     458             : 
     459             :         // accept, instanciate, etc.
     460             : 
     461           2 :         if (!aUnoUrl.isEmpty()) // accepting connections
     462             :         {
     463           1 :             sal_Int32 nIndex = 0, nTokens = 0;
     464           3 :             do { aUnoUrl.getToken( 0, ';', nIndex ); nTokens++; } while( nIndex != -1 );
     465           4 :             if (nTokens != 3 || aUnoUrl.getLength() < 10 ||
     466           4 :                 !aUnoUrl.copy( 0, 4 ).equalsIgnoreAsciiCase( "uno:" ))
     467             :             {
     468           0 :                 throw RuntimeException("illegal uno url given!" );
     469             :             }
     470           1 :             nIndex = 0;
     471           1 :             OUString aConnectDescr( aUnoUrl.getToken( 0, ';', nIndex ).copy( 4 ) ); // uno:CONNECTDESCR;iiop;InstanceName
     472           2 :             OUString aInstanceName( aUnoUrl.getToken( 1, ';', nIndex ) );
     473             : 
     474           2 :             Reference< XAcceptor > xAcceptor = Acceptor::create(xContext);
     475             : 
     476             :             // init params
     477           2 :             Sequence< Any > aInitParams( aParams.getLength() );
     478           1 :             const OUString * p = aParams.getConstArray();
     479           1 :             Any * pInitParams = aInitParams.getArray();
     480           2 :             for ( sal_Int32 i = aParams.getLength(); i--; )
     481             :             {
     482           0 :                 pInitParams[i] = makeAny( p[i] );
     483             :             }
     484             : 
     485             :             // instance provider
     486             :             Reference< XInstanceProvider > xInstanceProvider( new OInstanceProvider(
     487             :                 xContext, aImplName, aLocation, aServiceName, aInitParams,
     488           2 :                 bSingleInstance, aInstanceName ) );
     489             : 
     490           1 :             nIndex = 0;
     491           2 :             OUString aUnoUrlToken( aUnoUrl.getToken( 1, ';', nIndex ) );
     492             :             // coverity[loop_top] - not really an infinite loop, we can be instructed to exit via the connection
     493             :             for (;;)
     494             :             {
     495             :                 // accepting
     496           1 :                 out( "\n> accepting " );
     497           1 :                 out( aConnectDescr );
     498           1 :                 out( "..." );
     499           1 :                 Reference< XConnection > xConnection( xAcceptor->accept( aConnectDescr ) );
     500           1 :                 out( "connection established." );
     501             : 
     502           1 :                 Reference< XBridgeFactory > xBridgeFactory;
     503             :                 createInstance(
     504             :                     xBridgeFactory, xContext,
     505           1 :                     OUString("com.sun.star.bridge.BridgeFactory") );
     506             : 
     507             :                 // bridge
     508           1 :                 Reference< XBridge > xBridge( xBridgeFactory->createBridge(
     509             :                     OUString(), aUnoUrlToken,
     510           1 :                     xConnection, xInstanceProvider ) );
     511             : 
     512           1 :                 if (bSingleAccept)
     513             :                 {
     514           1 :                     Reference< XComponent > xComp( xBridge, UNO_QUERY );
     515           1 :                     if (! xComp.is())
     516           0 :                         throw RuntimeException( "bridge factory does not export interface \"com.sun.star.lang.XComponent\"!" );
     517           1 :                     ODisposingListener::waitFor( xComp );
     518           1 :                     xComp->dispose();
     519             :                         // explicitly dispose the remote bridge so that it joins
     520             :                         // on all spawned threads before process exit (see
     521             :                         // binaryurp/source/bridge.cxx for details)
     522           1 :                     break;
     523             :                 }
     524           1 :             }
     525             :         }
     526             :         else // no uno url
     527             :         {
     528           1 :             Reference< XInterface > xInstance;
     529           1 :             if (!aImplName.isEmpty()) // manually via loader
     530           0 :                 xInstance = loadComponent( xContext, aImplName, aLocation );
     531             :             else // via service manager
     532           1 :                 createInstance( xInstance, xContext, aServiceName );
     533             : 
     534             :             // execution
     535           2 :             Reference< XMain > xMain( xInstance, UNO_QUERY );
     536           1 :             if (xMain.is())
     537             :             {
     538           1 :                 nRet = xMain->run( aParams );
     539             :             }
     540             :             else
     541             :             {
     542           0 :                 Reference< XComponent > xComp( xInstance, UNO_QUERY );
     543           0 :                 if (xComp.is())
     544           0 :                     xComp->dispose();
     545           0 :                 throw RuntimeException( "component does not export interface interface \"com.sun.star.lang.XMain\"!" );
     546           1 :             }
     547           2 :         }
     548             :     }
     549           0 :     catch (Exception & rExc)
     550             :     {
     551           0 :         out( "\n> error: " );
     552           0 :         out( rExc.Message );
     553           0 :         out( "\n> dying..." );
     554           0 :         nRet = 1;
     555             :     }
     556             : 
     557             :     // cleanup
     558           4 :     Reference< XComponent > xComp( xContext, UNO_QUERY );
     559           2 :     if (xComp.is())
     560           2 :         xComp->dispose();
     561             : 
     562             : #if OSL_DEBUG_LEVEL > 1
     563             :     out( "\n" );
     564             : #endif
     565           4 :     return nRet;
     566             : }
     567             : 
     568             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11