targeted string re-work

Change-Id: Ibe5c739c3066f3e706a44b64d4ad775abde9662c
This commit is contained in:
Norbert Thiebaud
2012-06-01 09:15:09 -05:00
parent 4de8cc3465
commit 9601b63509
4 changed files with 67 additions and 74 deletions

View File

@@ -180,46 +180,46 @@ void testConnection( const OUString &sConnectionDescription ,
int SAL_CALL main( int argc, char * argv[] ) int SAL_CALL main( int argc, char * argv[] )
{ {
Reference< XMultiServiceFactory > xMgr( Reference< XMultiServiceFactory > xMgr(
createRegistryServiceFactory( OUString( RTL_CONSTASCII_USTRINGPARAM("applicat.rdb")) ) ); createRegistryServiceFactory( OUString( "applicat.rdb") ) );
Reference< XImplementationRegistration > xImplReg( Reference< XImplementationRegistration > xImplReg(
xMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration")) ), UNO_QUERY ); xMgr->createInstance( OUString("com.sun.star.registry.ImplementationRegistration") ), UNO_QUERY );
OSL_ENSURE( xImplReg.is(), "### no impl reg!" ); OSL_ENSURE( xImplReg.is(), "### no impl reg!" );
OUString aLibName = OUString aLibName =
OUString(RTL_CONSTASCII_USTRINGPARAM( "connector.uno" SAL_DLLEXTENSION )); OUString( "connector.uno" SAL_DLLEXTENSION );
xImplReg->registerImplementation( xImplReg->registerImplementation(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")), aLibName, Reference< XSimpleRegistry >() ); OUString("com.sun.star.loader.SharedLibrary"), aLibName, Reference< XSimpleRegistry >() );
aLibName = OUString(RTL_CONSTASCII_USTRINGPARAM( "acceptor.uno" SAL_DLLEXTENSION )); aLibName = OUString( "acceptor.uno" SAL_DLLEXTENSION );
xImplReg->registerImplementation( xImplReg->registerImplementation(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")), aLibName, Reference< XSimpleRegistry >() ); OUString("com.sun.star.loader.SharedLibrary"), aLibName, Reference< XSimpleRegistry >() );
Reference < XAcceptor > rAcceptor( Reference < XAcceptor > rAcceptor(
xMgr->createInstance( xMgr->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.Acceptor")) ) , UNO_QUERY ); OUString("com.sun.star.connection.Acceptor") ) , UNO_QUERY );
Reference < XAcceptor > rAcceptorPipe( Reference < XAcceptor > rAcceptorPipe(
xMgr->createInstance( xMgr->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.Acceptor")) ) , UNO_QUERY ); OUString("com.sun.star.connection.Acceptor") ) , UNO_QUERY );
Reference < XConnector > rConnector( Reference < XConnector > rConnector(
xMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.Connector")) ) , UNO_QUERY ); xMgr->createInstance( OUString("com.sun.star.connection.Connector") ) , UNO_QUERY );
printf( "Testing sockets" ); printf( "Testing sockets" );
fflush( stdout ); fflush( stdout );
testConnection( OUString(RTL_CONSTASCII_USTRINGPARAM("socket,host=localhost,port=2001")), rAcceptor , rConnector ); testConnection( OUString("socket,host=localhost,port=2001"), rAcceptor , rConnector );
printf( " Done\n" ); printf( " Done\n" );
printf( "Testing pipe" ); printf( "Testing pipe" );
fflush( stdout ); fflush( stdout );
testConnection( OUString(RTL_CONSTASCII_USTRINGPARAM("pipe,name=bla")) , rAcceptorPipe , rConnector ); testConnection( OUString("pipe,name=bla") , rAcceptorPipe , rConnector );
printf( " Done\n" ); printf( " Done\n" );
// check, if errornous strings make any problem // check, if errornous strings make any problem
rAcceptor = Reference< XAcceptor > ( rAcceptor = Reference< XAcceptor > (
xMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.Acceptor")) ), xMgr->createInstance( OUString("com.sun.star.connection.Acceptor") ),
UNO_QUERY ); UNO_QUERY );
try try
@@ -251,14 +251,14 @@ int SAL_CALL main( int argc, char * argv[] )
} }
MyThread thread( rAcceptor , OUString(RTL_CONSTASCII_USTRINGPARAM("socket,host=localhost,port=2001")) ); MyThread thread( rAcceptor , OUString("socket,host=localhost,port=2001") );
thread.create(); thread.create();
TimeValue value = {0,1}; TimeValue value = {0,1};
osl_waitThread( &value ); osl_waitThread( &value );
try try
{ {
rAcceptor->accept( OUString(RTL_CONSTASCII_USTRINGPARAM("socket,host=localhost,port=2001")) ); rAcceptor->accept( OUString("socket,host=localhost,port=2001") );
OSL_FAIL( "already existing exception expected" ); OSL_FAIL( "already existing exception expected" );
} }
catch( AlreadyAcceptingException & ) catch( AlreadyAcceptingException & )

View File

@@ -69,7 +69,7 @@ using com::sun::star::beans::XIntrospection;
namespace pyuno namespace pyuno
{ {
#define USTR_ASCII(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) #define USTR_ASCII(x) OUString( x )
static PyTypeObject RuntimeImpl_Type = static PyTypeObject RuntimeImpl_Type =
{ {
@@ -133,8 +133,7 @@ static void getRuntimeImpl( PyRef & globalDict, PyRef &runtimeImpl )
PyThreadState * state = PyThreadState_Get(); PyThreadState * state = PyThreadState_Get();
if( ! state ) if( ! state )
{ {
throw RuntimeException( OUString( RTL_CONSTASCII_USTRINGPARAM( throw RuntimeException( OUString( "python global interpreter must be held (thread must be attached" )),
"python global interpreter must be held (thread must be attached)" )),
Reference< XInterface > () ); Reference< XInterface > () );
} }
@@ -142,8 +141,7 @@ static void getRuntimeImpl( PyRef & globalDict, PyRef &runtimeImpl )
if( ! globalDict.is() ) // FATAL ! if( ! globalDict.is() ) // FATAL !
{ {
throw RuntimeException( OUString( RTL_CONSTASCII_USTRINGPARAM( throw RuntimeException( OUString( "can't find __main__ module" ), Reference< XInterface > ());
"can't find __main__ module" )), Reference< XInterface > ());
} }
runtimeImpl = PyDict_GetItemString( globalDict.get() , "pyuno_runtime" ); runtimeImpl = PyDict_GetItemString( globalDict.get() , "pyuno_runtime" );
} }
@@ -182,7 +180,7 @@ static void readLoggingConfig( sal_Int32 *pLevel, FILE **ppFile )
reinterpret_cast< oslGenericFunction >(readLoggingConfig), reinterpret_cast< oslGenericFunction >(readLoggingConfig),
(rtl_uString **) &fileName ); (rtl_uString **) &fileName );
fileName = OUString( fileName.getStr(), fileName.lastIndexOf( '/' )+1 ); fileName = OUString( fileName.getStr(), fileName.lastIndexOf( '/' )+1 );
fileName += OUString(RTL_CONSTASCII_USTRINGPARAM( SAL_CONFIGFILE("pyuno") )); fileName += OUString( SAL_CONFIGFILE("pyuno" ));
rtl::Bootstrap bootstrapHandle( fileName ); rtl::Bootstrap bootstrapHandle( fileName );
OUString str; OUString str;
@@ -246,7 +244,7 @@ PyRef stRuntimeImpl::create( const Reference< XComponentContext > &ctx )
RuntimeImpl *me = PyObject_New (RuntimeImpl, &RuntimeImpl_Type); RuntimeImpl *me = PyObject_New (RuntimeImpl, &RuntimeImpl_Type);
if( ! me ) if( ! me )
throw RuntimeException( throw RuntimeException(
OUString( RTL_CONSTASCII_USTRINGPARAM( "cannot instantiate pyuno::RuntimeImpl" ) ), OUString( "cannot instantiate pyuno::RuntimeImpl" ),
Reference< XInterface > () ); Reference< XInterface > () );
me->cargo = 0; me->cargo = 0;
// must use a different struct here, as the PyObject_New // must use a different struct here, as the PyObject_New
@@ -259,60 +257,59 @@ PyRef stRuntimeImpl::create( const Reference< XComponentContext > &ctx )
c->xContext = ctx; c->xContext = ctx;
c->xInvocation = Reference< XSingleServiceFactory > ( c->xInvocation = Reference< XSingleServiceFactory > (
ctx->getServiceManager()->createInstanceWithContext( ctx->getServiceManager()->createInstanceWithContext(
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.Invocation" ) ), OUString( "com.sun.star.script.Invocation" ),
ctx ), ctx ),
UNO_QUERY ); UNO_QUERY );
if( ! c->xInvocation.is() ) if( ! c->xInvocation.is() )
throw RuntimeException( throw RuntimeException(
OUString( RTL_CONSTASCII_USTRINGPARAM( "pyuno: couldn't instantiate invocation service" ) ), OUString( "pyuno: couldn't instantiate invocation service" ),
Reference< XInterface > () ); Reference< XInterface > () );
c->xTypeConverter = Reference< XTypeConverter > ( c->xTypeConverter = Reference< XTypeConverter > (
ctx->getServiceManager()->createInstanceWithContext( ctx->getServiceManager()->createInstanceWithContext(
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.Converter" ) ), OUString( "com.sun.star.script.Converter" ),
ctx ), ctx ),
UNO_QUERY ); UNO_QUERY );
if( ! c->xTypeConverter.is() ) if( ! c->xTypeConverter.is() )
throw RuntimeException( throw RuntimeException(
OUString( RTL_CONSTASCII_USTRINGPARAM( "pyuno: couldn't instantiate typeconverter service" )), OUString( "pyuno: couldn't instantiate typeconverter service" ),
Reference< XInterface > () ); Reference< XInterface > () );
c->xCoreReflection = Reference< XIdlReflection > ( c->xCoreReflection = Reference< XIdlReflection > (
ctx->getServiceManager()->createInstanceWithContext( ctx->getServiceManager()->createInstanceWithContext(
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.reflection.CoreReflection" ) ), OUString( "com.sun.star.reflection.CoreReflection" ),
ctx ), ctx ),
UNO_QUERY ); UNO_QUERY );
if( ! c->xCoreReflection.is() ) if( ! c->xCoreReflection.is() )
throw RuntimeException( throw RuntimeException(
OUString( RTL_CONSTASCII_USTRINGPARAM( "pyuno: couldn't instantiate corereflection service" )), OUString( "pyuno: couldn't instantiate corereflection service" ),
Reference< XInterface > () ); Reference< XInterface > () );
c->xAdapterFactory = Reference< XInvocationAdapterFactory2 > ( c->xAdapterFactory = Reference< XInvocationAdapterFactory2 > (
ctx->getServiceManager()->createInstanceWithContext( ctx->getServiceManager()->createInstanceWithContext(
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.InvocationAdapterFactory" ) ), OUString( "com.sun.star.script.InvocationAdapterFactory" ),
ctx ), ctx ),
UNO_QUERY ); UNO_QUERY );
if( ! c->xAdapterFactory.is() ) if( ! c->xAdapterFactory.is() )
throw RuntimeException( throw RuntimeException(
OUString( RTL_CONSTASCII_USTRINGPARAM( "pyuno: couldn't instantiate invocation adapter factory service" )), OUString( "pyuno: couldn't instantiate invocation adapter factory service" ),
Reference< XInterface > () ); Reference< XInterface > () );
c->xIntrospection = Reference< XIntrospection > ( c->xIntrospection = Reference< XIntrospection > (
ctx->getServiceManager()->createInstanceWithContext( ctx->getServiceManager()->createInstanceWithContext(
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.beans.Introspection" ) ), OUString( "com.sun.star.beans.Introspection" ),
ctx ), ctx ),
UNO_QUERY ); UNO_QUERY );
if( ! c->xIntrospection.is() ) if( ! c->xIntrospection.is() )
throw RuntimeException( throw RuntimeException(
OUString( RTL_CONSTASCII_USTRINGPARAM( "pyuno: couldn't instantiate introspection service" )), OUString( "pyuno: couldn't instantiate introspection service" ),
Reference< XInterface > () ); Reference< XInterface > () );
Any a = ctx->getValueByName(OUString( Any a = ctx->getValueByName(OUString( "/singletons/com.sun.star.reflection.theTypeDescriptionManager" ) );
RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.reflection.theTypeDescriptionManager" )) );
a >>= c->xTdMgr; a >>= c->xTdMgr;
if( ! c->xTdMgr.is() ) if( ! c->xTdMgr.is() )
throw RuntimeException( throw RuntimeException(
OUString( RTL_CONSTASCII_USTRINGPARAM( "pyuno: couldn't retrieve typedescriptionmanager" )), OUString( "pyuno: couldn't retrieve typedescriptionmanager" ),
Reference< XInterface > () ); Reference< XInterface > () );
me->cargo =c; me->cargo =c;
@@ -338,8 +335,7 @@ void Runtime::initialize( const Reference< XComponentContext > & ctx )
if( runtime.is() && impl->cargo->valid ) if( runtime.is() && impl->cargo->valid )
{ {
throw RuntimeException( OUString( RTL_CONSTASCII_USTRINGPARAM( throw RuntimeException( OUString( "pyuno runtime has already been initialized before" ),
"pyuno runtime has already been initialized before" ) ),
Reference< XInterface > () ); Reference< XInterface > () );
} }
PyRef keep( RuntimeImpl::create( ctx ) ); PyRef keep( RuntimeImpl::create( ctx ) );
@@ -364,8 +360,8 @@ Runtime::Runtime() throw( RuntimeException )
if( ! runtime.is() ) if( ! runtime.is() )
{ {
throw RuntimeException( throw RuntimeException(
OUString( RTL_CONSTASCII_USTRINGPARAM("pyuno runtime is not initialized, " OUString( "pyuno runtime is not initialized, "
"(the pyuno.bootstrap needs to be called before using any uno classes)")), "(the pyuno.bootstrap needs to be called before using any uno classes")),
Reference< XInterface > () ); Reference< XInterface > () );
} }
impl = reinterpret_cast< RuntimeImpl * > (runtime.get()); impl = reinterpret_cast< RuntimeImpl * > (runtime.get());
@@ -399,8 +395,7 @@ PyRef Runtime::any2PyObject (const Any &a ) const
{ {
if( ! impl->cargo->valid ) if( ! impl->cargo->valid )
{ {
throw RuntimeException( OUString( RTL_CONSTASCII_USTRINGPARAM( throw RuntimeException( OUString( "pyuno runtime must be initialized before calling any2PyObject" ),
"pyuno runtime must be initialized before calling any2PyObject" )),
Reference< XInterface > () ); Reference< XInterface > () );
} }
@@ -640,8 +635,7 @@ Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) con
{ {
if( ! impl->cargo->valid ) if( ! impl->cargo->valid )
{ {
throw RuntimeException( OUString( RTL_CONSTASCII_USTRINGPARAM( throw RuntimeException( OUString( "pyuno runtime must be initialized before calling any2PyObject" ),
"pyuno runtime must be initialized before calling any2PyObject" )),
Reference< XInterface > () ); Reference< XInterface > () );
} }
@@ -834,9 +828,8 @@ Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) con
else else
{ {
throw RuntimeException( throw RuntimeException(
OUString( RTL_CONSTASCII_USTRINGPARAM( OUString( "uno.Any instance not accepted during method call, "
"uno.Any instance not accepted during method call, " "use uno.invoke instead" ),
"use uno.invoke instead" ) ),
Reference< XInterface > () ); Reference< XInterface > () );
} }
} }
@@ -931,17 +924,17 @@ Any Runtime::extractUnoException( const PyRef & excType, const PyRef &excValue,
} }
else else
{ {
str = OUString(RTL_CONSTASCII_USTRINGPARAM("Couldn't find uno._uno_extract_printable_stacktrace")); str = OUString("Couldn't find uno._uno_extract_printable_stacktrace");
} }
} }
else else
{ {
str = OUString(RTL_CONSTASCII_USTRINGPARAM("Could not load uno.py, no stacktrace available")); str = OUString("Could not load uno.py, no stacktrace available");
if ( !e.Message.isEmpty() ) if ( !e.Message.isEmpty() )
{ {
str += OUString (RTL_CONSTASCII_USTRINGPARAM(" (Error loading uno.py: ")); str += OUString (" (Error loading uno.py: ");
str += e.Message; str += e.Message;
str += OUString (RTL_CONSTASCII_USTRINGPARAM(")")); str += OUString (")");
} }
} }
@@ -949,7 +942,7 @@ Any Runtime::extractUnoException( const PyRef & excType, const PyRef &excValue,
else else
{ {
// it may occur, that no traceback is given (e.g. only native code below) // it may occur, that no traceback is given (e.g. only native code below)
str = OUString( RTL_CONSTASCII_USTRINGPARAM( "no traceback available" ) ); str = OUString( "no traceback available" );
} }
if( isInstanceOfStructOrException( excValue.get() ) ) if( isInstanceOfStructOrException( excValue.get() ) )
@@ -1026,7 +1019,7 @@ PyThreadAttach::PyThreadAttach( PyInterpreterState *interp)
tstate = PyThreadState_New( interp ); tstate = PyThreadState_New( interp );
if( !tstate ) if( !tstate )
throw RuntimeException( throw RuntimeException(
OUString(RTL_CONSTASCII_USTRINGPARAM( "Couldn't create a pythreadstate" ) ), OUString( "Couldn't create a pythreadstate" ),
Reference< XInterface > () ); Reference< XInterface > () );
PyEval_AcquireThread( tstate); PyEval_AcquireThread( tstate);
// set LC_NUMERIC to "C" // set LC_NUMERIC to "C"

View File

@@ -92,7 +92,7 @@ void OfficeClientMain::testWriter( const Reference< XComponent > & rComponent )
Reference< XTextCursor > rCursor = rText->createTextCursor(); Reference< XTextCursor > rCursor = rText->createTextCursor();
Reference< XTextRange > rRange ( rCursor , UNO_QUERY ); Reference< XTextRange > rRange ( rCursor , UNO_QUERY );
rText->insertString( rRange, OUString(RTL_CONSTASCII_USTRINGPARAM("This text has been posted by the officeclient component")), sal_False ); rText->insertString( rRange, OUString("This text has been posted by the officeclient component"), sal_False );
} }
/******************** /********************
@@ -105,7 +105,7 @@ void OfficeClientMain::registerServices( )
Reference < XImplementationRegistration > rImplementationRegistration( Reference < XImplementationRegistration > rImplementationRegistration(
m_xSMgr->createInstance( m_xSMgr->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration"))), OUString("com.sun.star.registry.ImplementationRegistration")),
UNO_QUERY ); UNO_QUERY );
if( ! rImplementationRegistration.is() ) if( ! rImplementationRegistration.is() )
@@ -116,13 +116,13 @@ void OfficeClientMain::registerServices( )
OUString aSharedLibrary[4]; OUString aSharedLibrary[4];
aSharedLibrary[0] = aSharedLibrary[0] =
OUString(RTL_CONSTASCII_USTRINGPARAM( "connector.uno" SAL_DLLEXTENSION )); OUString( "connector.uno" SAL_DLLEXTENSION );
aSharedLibrary[1] = aSharedLibrary[1] =
OUString(RTL_CONSTASCII_USTRINGPARAM( "remotebridge.uno" SAL_DLLEXTENSION )); OUString( "remotebridge.uno" SAL_DLLEXTENSION );
aSharedLibrary[2] = aSharedLibrary[2] =
OUString(RTL_CONSTASCII_USTRINGPARAM( "bridgefac.uno" SAL_DLLEXTENSION )); OUString( "bridgefac.uno" SAL_DLLEXTENSION );
aSharedLibrary[3] = aSharedLibrary[3] =
OUString(RTL_CONSTASCII_USTRINGPARAM( "uuresolver.uno" SAL_DLLEXTENSION )); OUString( "uuresolver.uno" SAL_DLLEXTENSION );
sal_Int32 i; sal_Int32 i;
for( i = 0 ; i < 4 ; i ++ ) for( i = 0 ; i < 4 ; i ++ )
@@ -135,7 +135,7 @@ void OfficeClientMain::registerServices( )
{ {
// register the needed services in the servicemanager // register the needed services in the servicemanager
rImplementationRegistration->registerImplementation( rImplementationRegistration->registerImplementation(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")), OUString("com.sun.star.loader.SharedLibrary"),
aDllName, aDllName,
Reference< XSimpleRegistry > () ); Reference< XSimpleRegistry > () );
} }
@@ -156,7 +156,7 @@ sal_Int32 OfficeClientMain::run( const Sequence< OUString > & aArguments ) throw
try { try {
registerServices(); registerServices();
Reference < XInterface > r = Reference < XInterface > r =
m_xSMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.UnoUrlResolver")) ); m_xSMgr->createInstance( OUString("com.sun.star.bridge.UnoUrlResolver") );
Reference < XUnoUrlResolver > rResolver( r , UNO_QUERY ); Reference < XUnoUrlResolver > rResolver( r , UNO_QUERY );
r = rResolver->resolve( aArguments.getConstArray()[0] ); r = rResolver->resolve( aArguments.getConstArray()[0] );
@@ -165,12 +165,12 @@ sal_Int32 OfficeClientMain::run( const Sequence< OUString > & aArguments ) throw
{ {
printf( "got the remote NamingService\n" ); printf( "got the remote NamingService\n" );
r = rNamingService->getRegisteredObject(OUString(RTL_CONSTASCII_USTRINGPARAM("StarOffice.ServiceManager"))); r = rNamingService->getRegisteredObject(OUString("StarOffice.ServiceManager"));
Reference< XMultiServiceFactory > rRemoteSMgr( r , UNO_QUERY ); Reference< XMultiServiceFactory > rRemoteSMgr( r , UNO_QUERY );
Reference < XComponentLoader > rLoader( Reference < XComponentLoader > rLoader(
rRemoteSMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop" ))), rRemoteSMgr->createInstance( OUString( "com.sun.star.frame.Desktop" )),
UNO_QUERY ); UNO_QUERY );
if( rLoader.is() ) if( rLoader.is() )
@@ -198,7 +198,7 @@ sal_Int32 OfficeClientMain::run( const Sequence< OUString > & aArguments ) throw
Reference< XComponent > rComponent = Reference< XComponent > rComponent =
rLoader->loadComponentFromURL( rLoader->loadComponentFromURL(
OUString::createFromAscii( urls[i] ) , OUString::createFromAscii( urls[i] ) ,
OUString( RTL_CONSTASCII_USTRINGPARAM("_blank")), OUString( "_blank"),
0 , 0 ,
Sequence < ::com::sun::star::beans::PropertyValue >() ); Sequence < ::com::sun::star::beans::PropertyValue >() );
@@ -262,7 +262,7 @@ Sequence< OUString > getSupportedServiceNames()
if( !pNames ) if( !pNames )
{ {
static Sequence< OUString > seqNames(2); static Sequence< OUString > seqNames(2);
seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.example.OfficeClientExample")); seqNames.getArray()[0] = OUString("com.sun.star.bridge.example.OfficeClientExample");
pNames = &seqNames; pNames = &seqNames;
} }
} }
@@ -287,7 +287,7 @@ sal_Bool SAL_CALL component_writeInfo(
{ {
Reference< XRegistryKey > xNewKey( Reference< XRegistryKey > xNewKey(
reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
OUString(RTL_CONSTASCII_USTRINGPARAM( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" )) ) ); OUString( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
const Sequence< OUString > & rSNL = getSupportedServiceNames(); const Sequence< OUString > & rSNL = getSupportedServiceNames();
const OUString * pArray = rSNL.getConstArray(); const OUString * pArray = rSNL.getConstArray();

View File

@@ -172,7 +172,7 @@ DirectoryTraveller::DirectoryTraveller (
m_nCount (0) m_nCount (0)
{ {
m_aPath += rName; m_aPath += rName;
m_aPath += OUString(RTL_CONSTASCII_USTRINGPARAM("/")); m_aPath += OUString("/");
} }
/* /*
@@ -344,7 +344,7 @@ int SAL_CALL main (int argc, char **argv)
} }
// Stream Read/Write. // Stream Read/Write.
OUString aPath (RTL_CONSTASCII_USTRINGPARAM("/")); OUString aPath ("/");
if ((nOptions & OPTION_READ) || (nOptions & OPTION_WRITE)) if ((nOptions & OPTION_READ) || (nOptions & OPTION_WRITE))
{ {
// Mode. // Mode.
@@ -366,9 +366,9 @@ int SAL_CALL main (int argc, char **argv)
for (int i = 0; i < _DEMOSTOR_LOOPS; i++) for (int i = 0; i < _DEMOSTOR_LOOPS; i++)
{ {
OUString aName (RTL_CONSTASCII_USTRINGPARAM("demostor-")); OUString aName ("demostor-");
aName += OUString::valueOf ((sal_Int32)(i + 1), 10); aName += OUString::valueOf ((sal_Int32)(i + 1), 10);
aName += OUString(RTL_CONSTASCII_USTRINGPARAM (".dat")); aName += OUString(".dat");
#if (_DEMOSTOR_REMOVE == 1) #if (_DEMOSTOR_REMOVE == 1)
eErrCode = aFile.remove (aPath, aName); eErrCode = aFile.remove (aPath, aName);
@@ -456,7 +456,7 @@ int SAL_CALL main (int argc, char **argv)
{ {
// Create symlink to (root) directory. // Create symlink to (root) directory.
eErrCode = aFile.symlink ( eErrCode = aFile.symlink (
aPath, OUString(RTL_CONSTASCII_USTRINGPARAM("000000/")), aPath, OUString("000000/"),
OUString(), aPath); OUString(), aPath);
OSL_POSTCOND( OSL_POSTCOND(
((eErrCode == store_E_None ) || ((eErrCode == store_E_None ) ||
@@ -464,11 +464,11 @@ int SAL_CALL main (int argc, char **argv)
"t_store::main(): store_symlink() failed"); "t_store::main(): store_symlink() failed");
// Create symlink to file. // Create symlink to file.
OUString aLinkName (RTL_CONSTASCII_USTRINGPARAM("demostor-1.lnk")); OUString aLinkName ("demostor-1.lnk");
eErrCode = aFile.symlink ( eErrCode = aFile.symlink (
aPath, aLinkName, aPath, aLinkName,
aPath, OUString(RTL_CONSTASCII_USTRINGPARAM("demostor-1.dat"))); aPath, OUString("demostor-1.dat"));
OSL_POSTCOND( OSL_POSTCOND(
((eErrCode == store_E_None ) || ((eErrCode == store_E_None ) ||
(eErrCode == store_E_AlreadyExists) ), (eErrCode == store_E_AlreadyExists) ),
@@ -477,7 +477,7 @@ int SAL_CALL main (int argc, char **argv)
(eErrCode == store_E_AlreadyExists) ) (eErrCode == store_E_AlreadyExists) )
{ {
OUString aShortcut ( OUString aShortcut (
RTL_CONSTASCII_USTRINGPARAM("Shortcut to demostor-1.dat")); "Shortcut to demostor-1.dat");
eErrCode = aFile.rename ( eErrCode = aFile.rename (
aPath, aLinkName, aPath, aLinkName,
aPath, aShortcut); aPath, aShortcut);
@@ -488,7 +488,7 @@ int SAL_CALL main (int argc, char **argv)
} }
// Create directory. // Create directory.
OUString aDirName (RTL_CONSTASCII_USTRINGPARAM("demostor-1.dir")); OUString aDirName ("demostor-1.dir");
store::OStoreDirectory aDir; store::OStoreDirectory aDir;
eErrCode = aDir.create ( eErrCode = aDir.create (
@@ -515,7 +515,7 @@ int SAL_CALL main (int argc, char **argv)
{ {
// Open symlink entry. // Open symlink entry.
eErrCode = aRootDir.create ( eErrCode = aRootDir.create (
aFile, aPath, OUString(RTL_CONSTASCII_USTRINGPARAM("000000")), aFile, aPath, OUString("000000"),
store_AccessReadOnly); store_AccessReadOnly);
} }
else else