diff options
author | Gert Faller <gertfaller@aliceadsl.fr> | 2010-12-10 18:31:39 +0100 |
---|---|---|
committer | Gert Faller <gertfaller@aliceadsl.fr> | 2010-12-10 18:31:39 +0100 |
commit | 3a18c3d97abfb60a09cc6a8bd5dd163fe2cfafa3 (patch) | |
tree | 02ef980b5d6440ebbacf6f8801bea9d27f62b7a5 /io | |
parent | 377a56fb1b9825ec5dc71ba9ae81b6e27cfabffb (diff) |
RTL_CONSTASCII_USTRINGPARAM in ure 1
Diffstat (limited to 'io')
-rw-r--r-- | io/test/stm/datatest.cxx | 30 | ||||
-rw-r--r-- | io/test/stm/marktest.cxx | 4 | ||||
-rw-r--r-- | io/test/stm/pumptest.cxx | 6 | ||||
-rw-r--r-- | io/test/testcomponent.cxx | 10 | ||||
-rw-r--r-- | io/test/testconnection.cxx | 22 |
5 files changed, 36 insertions, 36 deletions
diff --git a/io/test/stm/datatest.cxx b/io/test/stm/datatest.cxx index 6b1f5c59e556..d865288d6de3 100644 --- a/io/test/stm/datatest.cxx +++ b/io/test/stm/datatest.cxx @@ -122,7 +122,7 @@ void ODataStreamTest::testInvariant( throw ( IllegalArgumentException, RuntimeException) { - if( OUString::createFromAscii("com.sun.star.io.DataInputStream") == TestName ) { + if( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.DataInputStream")) == TestName ) { Reference < XConnectable > connect( TestObject , UNO_QUERY ); Reference < XActiveDataSink > active( TestObject , UNO_QUERY ); Reference < XInputStream > input( TestObject , UNO_QUERY ); @@ -135,7 +135,7 @@ void ODataStreamTest::testInvariant( } - else if( OUString::createFromAscii("com.sun.star.io.DataInputStream") == TestName ) { + else if( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.DataInputStream")) == TestName ) { Reference < XConnectable > connect( TestObject , UNO_QUERY ); Reference < XActiveDataSource > active( TestObject , UNO_QUERY ); Reference < XOutputStream > output( TestObject , UNO_QUERY ); @@ -153,7 +153,7 @@ void ODataStreamTest::testInvariant( if( info.is() ) { ERROR_ASSERT( info->supportsService( TestName ), "XServiceInfo test failed" ); - ERROR_ASSERT( ! info->supportsService( OUString::createFromAscii("bla bluzb") ) , "XServiceInfo test failed" ); + ERROR_ASSERT( ! info->supportsService( OUString(RTL_CONSTASCII_USTRINGPARAM("bla bluzb")) ) , "XServiceInfo test failed" ); } } @@ -166,8 +166,8 @@ sal_Int32 ODataStreamTest::test( throw ( IllegalArgumentException, RuntimeException) { - if( OUString::createFromAscii("com.sun.star.io.DataInputStream") == TestName || - OUString::createFromAscii("com.sun.star.io.DataOutputStream") == TestName ) { + if( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.DataInputStream")) == TestName || + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.DataOutputStream")) == TestName ) { try { @@ -292,8 +292,8 @@ void ODataStreamTest::testSimple( const Reference < XDataInputStream > &rInput rOutput->writeHyper( 0x123456789abcdefLL ); ERROR_ASSERT( rInput->readHyper() == 0x123456789abcdefLL , "int64 read/write mismatch" ); - rOutput->writeUTF( OUString::createFromAscii("Live long and prosper !") ); - ERROR_ASSERT( rInput->readUTF() == OUString::createFromAscii("Live long and prosper !") , + rOutput->writeUTF( OUString(RTL_CONSTASCII_USTRINGPARAM("Live long and prosper !")) ); + ERROR_ASSERT( rInput->readUTF() == OUString(RTL_CONSTASCII_USTRINGPARAM("Live long and prosper !")) , "UTF read/write mismatch" ); Sequence<sal_Unicode> wc(0x10001); @@ -706,7 +706,7 @@ void OObjectStreamTest::testInvariant( const OUString& TestName, if( info.is() ) { ERROR_ASSERT( info->supportsService( TestName ), "XServiceInfo test failed" ); - ERROR_ASSERT( ! info->supportsService( OUString::createFromAscii("bla bluzb") ) , "XServiceInfo test failed" ); + ERROR_ASSERT( ! info->supportsService( OUString(RTL_CONSTASCII_USTRINGPARAM("bla bluzb")) ) , "XServiceInfo test failed" ); } } @@ -824,8 +824,8 @@ sal_Bool compareMyPropertySet( Reference< XPropertySet > &r1 , Reference < XProp { sal_Bool b = sal_True; - if( r1->getPropertyValue( OUString::createFromAscii("long") ).getValueType() == getCppuVoidType() || - r2->getPropertyValue( OUString::createFromAscii("long") ).getValueType() == getCppuVoidType() ) { + if( r1->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("long")) ).getValueType() == getCppuVoidType() || + r2->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("long")) ).getValueType() == getCppuVoidType() ) { // one of the objects is not the correct propertyset ! fprintf( stderr, "compareMyPropertySet: 1\n" ); @@ -993,8 +993,8 @@ void OObjectStreamTest::testObject( const Reference< XObjectOutputStream > ERROR_ASSERT( compareMyPropertySet( rProp , rPropRead ) , "objects has not been read properly !" ); // destroy selfreferences - rProp->setPropertyValue( OUString::createFromAscii("object"), Any() ); - rPropRead->setPropertyValue( OUString::createFromAscii("object"), Any() ); + rProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("object")), Any() ); + rPropRead->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("object")), Any() ); } { @@ -1005,7 +1005,7 @@ void OObjectStreamTest::testObject( const Reference< XObjectOutputStream > // buffering and marks work correctly for( int i = 0 ; i < 2000 ; i ++ ) { - Reference < XInterface > x = m_rFactory->createInstance(OUString::createFromAscii("test.com.sun.star.io.PersistTest")); + Reference < XInterface > x = m_rFactory->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("test.com.sun.star.io.PersistTest"))); Reference< XPersistObject > persistRef( x , UNO_QUERY ); Reference < XPropertySet > rProp( persistRef , UNO_QUERY ); @@ -1040,13 +1040,13 @@ void OObjectStreamTest::testObject( const Reference< XObjectOutputStream > any <<= str; rProp->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("string")) , any ); - x = m_rFactory->createInstance(OUString::createFromAscii("test.com.sun.star.io.PersistTest")); + x = m_rFactory->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("test.com.sun.star.io.PersistTest"))); Reference <XPersistObject > persist2ndRef( x , UNO_QUERY ); // Note : persist2ndRef contains coincident values, but also coincident values must be // saved properly ! any <<= persist2ndRef; - rProp->setPropertyValue( OUString::createFromAscii("object") , any ); + rProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("object")) , any ); // simply test, if markable operations and object operations do not interfere sal_Int32 nMark = markableOut->createMark(); diff --git a/io/test/stm/marktest.cxx b/io/test/stm/marktest.cxx index ecd3ad30366b..dca626a797ba 100644 --- a/io/test/stm/marktest.cxx +++ b/io/test/stm/marktest.cxx @@ -142,7 +142,7 @@ sal_Int32 OMarkableOutputStreamTest::test( } else { - Reference < XInterface > x = m_rFactory->createInstance( OUString::createFromAscii("com.sun.star.io.Pipe")); + Reference < XInterface > x = m_rFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.Pipe"))); Reference< XOutputStream > rPipeOutput( x , UNO_QUERY ); Reference < XInputStream > rPipeInput( x , UNO_QUERY ); @@ -509,7 +509,7 @@ sal_Int32 OMarkableInputStreamTest::test( testInvariant( TestName , TestObject ); } else { - Reference < XInterface > x = m_rFactory->createInstance( OUString::createFromAscii("com.sun.star.io.Pipe")); + Reference < XInterface > x = m_rFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.Pipe"))); Reference< XOutputStream > rPipeOutput( x , UNO_QUERY ); Reference < XInputStream > rPipeInput( x , UNO_QUERY ); diff --git a/io/test/stm/pumptest.cxx b/io/test/stm/pumptest.cxx index e8723375cc26..012df7bec5b2 100644 --- a/io/test/stm/pumptest.cxx +++ b/io/test/stm/pumptest.cxx @@ -323,7 +323,7 @@ private: Reference< XOutputStream > createPipe() { Reference< XOutputStream > rOut( m_rSmgr->createInstance( - OUString::createFromAscii( "com.sun.star.io.Pipe" )),UNO_QUERY); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.Pipe"))),UNO_QUERY); return rOut; } }; @@ -415,9 +415,9 @@ void OPumpTest::testWrongUsage( const Reference< XInterface > &r ) Reference< XActiveDataControl > rControl( r, UNO_QUERY ); Reference< XInputStream > rIn( m_rSmgr->createInstance( - OUString::createFromAscii( "com.sun.star.io.DataInputStream" )),UNO_QUERY); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.DataInputStream"))),UNO_QUERY); Reference< XOutputStream > rOut( m_rSmgr->createInstance( - OUString::createFromAscii( "com.sun.star.io.DataOutputStream" )),UNO_QUERY); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.DataOutputStream"))),UNO_QUERY); rSink->setInputStream( rIn ); rSource->setOutputStream( rOut ); diff --git a/io/test/testcomponent.cxx b/io/test/testcomponent.cxx index 419fdf7021ab..b111e4df66b6 100644 --- a/io/test/testcomponent.cxx +++ b/io/test/testcomponent.cxx @@ -73,7 +73,7 @@ int main (int argc, char **argv) { // Create registration service Reference < XInterface > x = xSMgr->createInstance( - OUString::createFromAscii( "com.sun.star.registry.ImplementationRegistration" ) ); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration")) ); xReg = Reference< XImplementationRegistration > ( x , UNO_QUERY ); } catch( Exception & ) { @@ -90,7 +90,7 @@ int main (int argc, char **argv) for( int n = 2 ; n <argc ; n ++ ) { OUString aDllName = OStringToOUString( argv[n] , RTL_TEXTENCODING_ASCII_US ); xReg->registerImplementation( - OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ), + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")), aDllName, xSimpleReg ); } @@ -111,13 +111,13 @@ int main (int argc, char **argv) #if defined(SAL_W32) || defined(SAL_OS2) OUString aDllName = OStringToOUString( sTestName , RTL_TEXTENCODING_ASCII_US ); #else - OUString aDllName = OUString::createFromAscii("lib"); + OUString aDllName(RTL_CONSTASCII_USTRINGPARAM("lib")); aDllName += OStringToOUString( sTestName , RTL_TEXTENCODING_ASCII_US ); - aDllName += OUString::createFromAscii(".so"); + aDllName += OUString(RTL_CONSTASCII_USTRINGPARAM(".so")); #endif xReg->registerImplementation( - OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ) , + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")) , aDllName, xSimpleReg ); } diff --git a/io/test/testconnection.cxx b/io/test/testconnection.cxx index 2afdd2915525..6b03859a4389 100644 --- a/io/test/testconnection.cxx +++ b/io/test/testconnection.cxx @@ -189,43 +189,43 @@ int __cdecl main( int argc, char * argv[] ) createRegistryServiceFactory( OUString( RTL_CONSTASCII_USTRINGPARAM("applicat.rdb")) ) ); Reference< XImplementationRegistration > xImplReg( - xMgr->createInstance( OUString::createFromAscii("com.sun.star.registry.ImplementationRegistration") ), UNO_QUERY ); + xMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration")) ), UNO_QUERY ); OSL_ENSURE( xImplReg.is(), "### no impl reg!" ); OUString aLibName = OUString::createFromAscii( "connector.uno" SAL_DLLEXTENSION ); xImplReg->registerImplementation( - OUString::createFromAscii("com.sun.star.loader.SharedLibrary"), aLibName, Reference< XSimpleRegistry >() ); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")), aLibName, Reference< XSimpleRegistry >() ); aLibName = OUString::createFromAscii( "acceptor.uno" SAL_DLLEXTENSION ); xImplReg->registerImplementation( - OUString::createFromAscii("com.sun.star.loader.SharedLibrary"), aLibName, Reference< XSimpleRegistry >() ); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")), aLibName, Reference< XSimpleRegistry >() ); Reference < XAcceptor > rAcceptor( xMgr->createInstance( - OUString::createFromAscii("com.sun.star.connection.Acceptor" ) ) , UNO_QUERY ); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.Acceptor")) ) , UNO_QUERY ); Reference < XAcceptor > rAcceptorPipe( xMgr->createInstance( - OUString::createFromAscii("com.sun.star.connection.Acceptor" ) ) , UNO_QUERY ); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.Acceptor")) ) , UNO_QUERY ); Reference < XConnector > rConnector( - xMgr->createInstance( OUString::createFromAscii("com.sun.star.connection.Connector") ) , UNO_QUERY ); + xMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.Connector")) ) , UNO_QUERY ); printf( "Testing sockets" ); fflush( stdout ); - testConnection( OUString::createFromAscii("socket,host=localhost,port=2001"), rAcceptor , rConnector ); + testConnection( OUString(RTL_CONSTASCII_USTRINGPARAM("socket,host=localhost,port=2001")), rAcceptor , rConnector ); printf( " Done\n" ); printf( "Testing pipe" ); fflush( stdout ); - testConnection( OUString::createFromAscii("pipe,name=bla") , rAcceptorPipe , rConnector ); + testConnection( OUString(RTL_CONSTASCII_USTRINGPARAM("pipe,name=bla")) , rAcceptorPipe , rConnector ); printf( " Done\n" ); // check, if errornous strings make any problem rAcceptor = Reference< XAcceptor > ( - xMgr->createInstance( OUString::createFromAscii( "com.sun.star.connection.Acceptor" ) ), + xMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.Acceptor")) ), UNO_QUERY ); try @@ -257,14 +257,14 @@ int __cdecl main( int argc, char * argv[] ) } - MyThread thread( rAcceptor , OUString::createFromAscii("socket,host=localhost,port=2001") ); + MyThread thread( rAcceptor , OUString(RTL_CONSTASCII_USTRINGPARAM("socket,host=localhost,port=2001")) ); thread.create(); TimeValue value = {0,1}; osl_waitThread( &value ); try { - rAcceptor->accept( OUString::createFromAscii("socket,host=localhost,port=2001") ); + rAcceptor->accept( OUString(RTL_CONSTASCII_USTRINGPARAM("socket,host=localhost,port=2001")) ); OSL_ENSURE( 0 , "already existing exception expected" ); } catch( AlreadyAcceptingException & e) |