diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2006-05-02 16:13:10 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2006-05-02 16:13:10 +0000 |
commit | 85791b8bcb8ad2c366046638d3f6b92ca2679c43 (patch) | |
tree | e9c98574fa38715cc1ed80c72684ed7ee1018bc7 /desktop/source/offacc/acceptor.cxx | |
parent | 0dead7eda9629bbd3bc540023d84e9cdadde357b (diff) |
INTEGRATION: CWS sfxcleanup (1.4.130); FILE MERGED
2006/02/27 15:17:27 mba 1.4.130.1: #132394#: remove superfluous code
Diffstat (limited to 'desktop/source/offacc/acceptor.cxx')
-rw-r--r-- | desktop/source/offacc/acceptor.cxx | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx index af4e5484b9..90891b7994 100644 --- a/desktop/source/offacc/acceptor.cxx +++ b/desktop/source/offacc/acceptor.cxx @@ -4,9 +4,9 @@ * * $RCSfile: acceptor.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: rt $ $Date: 2005-09-08 17:42:43 $ + * last change: $Author: rt $ $Date: 2006-05-02 17:13:10 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -47,9 +47,6 @@ #ifndef _STREAM_HXX #include <tools/stream.hxx> #endif -#ifndef _SFX_HRC -#include <sfx2/sfx.hrc> -#endif #ifndef _SV_SVAPP_HXX #include <vcl/svapp.hxx> #endif @@ -60,9 +57,9 @@ #include <com/sun/star/uno/XNamingService.hpp> #endif +#include <cppuhelper/factory.hxx> - -namespace desktop +namespace desktop { extern "C" void workerfunc (void * acc) @@ -96,7 +93,7 @@ Acceptor::Acceptor( const Reference< XMultiServiceFactory >& rFactory ) rtl::OUString::createFromAscii( "com.sun.star.bridge.BridgeFactory" )), UNO_QUERY ); // get component context - m_rContext = getComponentContext(m_rSMgr); + m_rContext = getComponentContext(m_rSMgr); } @@ -132,7 +129,7 @@ void SAL_CALL Acceptor::run() RTL_LOGFILE_CONTEXT_TRACE1( aLog, "desktop (lo119109) Acceptor::run connection %s", OUStringToOString(aDescription, RTL_TEXTENCODING_ASCII_US).getStr()); - // create instanceprovider for this connection + // create instanceprovider for this connection Reference< XInstanceProvider > rInstanceProvider( (XInstanceProvider*)new AccInstanceProvider(m_rSMgr, rConnection)); // create the bridge. The remote end will have a reference to this bridge @@ -143,7 +140,7 @@ void SAL_CALL Acceptor::run() } catch (Exception&) { // connection failed... - // something went wrong during connection setup. + // something went wrong during connection setup. // just wait for a new connection to accept } } @@ -161,11 +158,11 @@ void SAL_CALL Acceptor::initialize( const Sequence<Any>& aArguments ) // arg count int nArgs = aArguments.getLength(); - + // not yet initialized and acceptstring - if (!m_bInit && nArgs > 0 && (aArguments[0] >>= m_aAcceptString)) + if (!m_bInit && nArgs > 0 && (aArguments[0] >>= m_aAcceptString)) { - RTL_LOGFILE_CONTEXT_TRACE1( aLog, "desktop (lo119109) Acceptor::initialize string=%s", + RTL_LOGFILE_CONTEXT_TRACE1( aLog, "desktop (lo119109) Acceptor::initialize string=%s", OUStringToOString(m_aAcceptString, RTL_TEXTENCODING_ASCII_US).getStr()); // get connect string and protocol from accept string @@ -173,7 +170,7 @@ void SAL_CALL Acceptor::initialize( const Sequence<Any>& aArguments ) sal_Int32 nIndex1 = m_aAcceptString.indexOf( (sal_Unicode) ';' ); if (nIndex1 < 0) throw IllegalArgumentException( OUString::createFromAscii("Invalid accept-string format"), m_rContext, 1); - m_aConnectString = m_aAcceptString.copy( 0 , nIndex1 ).trim(); + m_aConnectString = m_aAcceptString.copy( 0 , nIndex1 ).trim(); nIndex1++; sal_Int32 nIndex2 = m_aAcceptString.indexOf( (sal_Unicode) ';' , nIndex1 ); if (nIndex2 < 0) nIndex2 = m_aAcceptString.getLength(); @@ -183,19 +180,19 @@ void SAL_CALL Acceptor::initialize( const Sequence<Any>& aArguments ) oslThread m_aThread = osl_createThread(workerfunc, this); m_bInit = sal_True; bOk = sal_True; - } - + } + // do we want to enable accepting? sal_Bool bEnable = sal_False; if ((nArgs == 1 && (aArguments[0] >>= bEnable) ) - || (nArgs == 2 && (aArguments[1] >>= bEnable)) + || (nArgs == 2 && (aArguments[1] >>= bEnable)) && bEnable ) { m_cEnable.set(); bOk = sal_True; } - - + + if (!bOk) { throw IllegalArgumentException( @@ -240,7 +237,7 @@ sal_Bool SAL_CALL Acceptor::supportsService( const OUString& aServiceName) return Acceptor::impl_supportsService( aServiceName ); } -// Factory +// Factory Reference< XInterface > Acceptor::impl_getInstance( const Reference< XMultiServiceFactory >& aFactory ) { try { @@ -266,9 +263,9 @@ Reference<XInterface> SAL_CALL AccInstanceProvider::getInstance (const OUString& { Reference<XInterface> rInstance; - + if ( aName.compareToAscii( "StarOffice.ServiceManager" ) == 0) - { + { rInstance = Reference< XInterface >( m_rSMgr ); } else if(aName.compareToAscii( "StarOffice.ComponentContext" ) == 0 ) @@ -288,8 +285,8 @@ Reference<XInterface> SAL_CALL AccInstanceProvider::getInstance (const OUString& OUString::createFromAscii( "StarOffice.ComponentContext" ), getComponentContext( m_rSMgr )); rInstance = rNamingService; } - } - /* + } + /* else if ( aName.compareToAscii("com.sun.star.ucb.RemoteContentProviderAcceptor" )) { Reference< XMultiServiceFactory > rSMgr = ::comphelper::getProcessServiceFactory(); @@ -312,13 +309,13 @@ extern "C" { using namespace desktop; -void SAL_CALL +void SAL_CALL component_getImplementationEnvironment(const sal_Char **ppEnvironmentTypeName, uno_Environment **ppEnvironment) { *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; } -sal_Bool SAL_CALL +sal_Bool SAL_CALL component_writeInfo(void *pServiceManager, void *pRegistryKey) { Reference< XMultiServiceFactory > xMan(reinterpret_cast< XMultiServiceFactory* >(pServiceManager)); @@ -335,7 +332,7 @@ component_writeInfo(void *pServiceManager, void *pRegistryKey) return sal_True; } -void * SAL_CALL +void * SAL_CALL component_getFactory(const sal_Char *pImplementationName, void *pServiceManager, void *pRegistryKey) { void* pReturn = NULL ; @@ -348,7 +345,7 @@ component_getFactory(const sal_Char *pImplementationName, void *pServiceManager, if (Acceptor::impl_getImplementationName().compareToAscii( pImplementationName ) == COMPARE_EQUAL ) { - xFactory = Reference< XSingleServiceFactory >( cppu::createSingleFactory( + xFactory = Reference< XSingleServiceFactory >( cppu::createSingleFactory( xServiceManager, Acceptor::impl_getImplementationName(), Acceptor::impl_getInstance, Acceptor::impl_getSupportedServiceNames()) ); } |