From 26c20675d0c36cb1c606970df2d638e05325e02c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 25 Oct 2010 12:43:57 +0100 Subject: micro optimizations --- cpputools/source/regcomplazy/regcomplazy.cxx | 11 +++++------ cpputools/source/registercomponent/registercomponent.cxx | 12 ++++++------ cpputools/source/unoexe/unoexe.cxx | 6 +++--- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/cpputools/source/regcomplazy/regcomplazy.cxx b/cpputools/source/regcomplazy/regcomplazy.cxx index 71c2fada867d..3b5b6421e9e4 100644 --- a/cpputools/source/regcomplazy/regcomplazy.cxx +++ b/cpputools/source/regcomplazy/regcomplazy.cxx @@ -40,7 +40,6 @@ #include -#define OUSTR(x) ::rtl::OUString::createFromAscii( x ) #define OSToOUS(x) ::rtl::OStringToOUString(x, osl_getThreadTextEncoding()) #define OUSToOS(x) ::rtl::OUStringToOString(x, osl_getThreadTextEncoding()) using namespace ::rtl; @@ -95,7 +94,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) ++nPos; } - OUString sys_path( OUSTR( argv[ nPos ] ) ); + OUString sys_path( ::rtl::OUString::createFromAscii( argv[ nPos ] ) ); OUString reg_url; oslFileError rc = osl_getFileURLFromSystemPath( sys_path.pData, ®_url.pData ); if (osl_File_E_None != rc) @@ -207,21 +206,21 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) } OString sLoaderName = (*comp_iter).sLoaderName; - OUString usKeyName(OUSTR("UNO/ACTIVATOR")); + OUString usKeyName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UNO/ACTIVATOR"))); key.createKey(usKeyName, subKey); subKey.setValue(OUString(), RG_VALUETYPE_STRING, (sal_Char*)sLoaderName.getStr(), sLoaderName.getLength()+1); OString sCompName = (*comp_iter).sComponentName; - usKeyName = OUSTR("UNO/LOCATION"); + usKeyName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UNO/LOCATION")); key.createKey(usKeyName, subKey); subKey.setValue(OUString(), RG_VALUETYPE_STRING, (sal_Char*)sCompName.getStr(), sCompName.getLength()+1); - usKeyName = OUSTR("UNO/SERVICES"); + usKeyName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UNO/SERVICES")); key.createKey(usKeyName, subKey); - rootKey.createKey(OUSTR("/SERVICES"), serviceKey); + rootKey.createKey(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/SERVICES")), serviceKey); OSVector::const_iterator serv_iter = ((*comp_iter).vSupportedServices).begin(); OUString usServiceKeyName; diff --git a/cpputools/source/registercomponent/registercomponent.cxx b/cpputools/source/registercomponent/registercomponent.cxx index 23f83bf8ccdf..cc9d22e42a96 100644 --- a/cpputools/source/registercomponent/registercomponent.cxx +++ b/cpputools/source/registercomponent/registercomponent.cxx @@ -83,7 +83,7 @@ OUString replacePrefix(OUString const & url, OUString const & prefix) { sal_Bool isFileUrl(const OUString& fileName) { - if (fileName.indexOf(OUString::createFromAscii("file://")) == 0 ) + if (fileName.indexOf(OUString(RTL_CONSTASCII_USTRINGPARAM("file://"))) == 0 ) return sal_True; return sal_False; } @@ -694,7 +694,7 @@ static void bootstrap( } reg = Reference< XSimpleRegistry >( xSMgr->createInstance( - rtl::OUString::createFromAscii("com.sun.star.registry.SimpleRegistry")), UNO_QUERY); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.SimpleRegistry"))), UNO_QUERY); if (reg.is()) { @@ -727,15 +727,15 @@ static void bootstrap( // we know our java loader, so we check, whether a java-loader is // registered Reference< XInterface > r = loadSharedLibComponentFactory( - OUString::createFromAscii( "javavm.uno" SAL_DLLEXTENSION ), + OUString(RTL_CONSTASCII_USTRINGPARAM("javavm.uno" SAL_DLLEXTENSION)), OUString(), - OUString::createFromAscii( "com.sun.star.comp.stoc.JavaVirtualMachine" ), + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.stoc.JavaVirtualMachine")), xSMgr, Reference< XRegistryKey > () ); Reference< XInterface > r2 = loadSharedLibComponentFactory( - OUString::createFromAscii( "javaloader.uno" SAL_DLLEXTENSION ), + OUString(RTL_CONSTASCII_USTRINGPARAM("javaloader.uno" SAL_DLLEXTENSION)), OUString(), - OUString::createFromAscii(( "com.sun.star.comp.stoc.JavaComponentLoader" ) ), + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.stoc.JavaComponentLoader")), xSMgr, Reference< XRegistryKey > () ); Reference xSet( xSMgr, UNO_QUERY ); diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx index 68089ea07cdf..940b3a67cae3 100644 --- a/cpputools/source/unoexe/unoexe.cxx +++ b/cpputools/source/unoexe/unoexe.cxx @@ -90,7 +90,7 @@ namespace unoexe static sal_Bool isFileUrl(const OUString& fileName) { - if (fileName.indexOf(OUString::createFromAscii("file://")) == 0 ) + if (fileName.indexOf(OUString(RTL_CONSTASCII_USTRINGPARAM("file://"))) == 0 ) return sal_True; return sal_False; } @@ -159,7 +159,7 @@ static sal_Bool readOption( OUString * pValue, const sal_Char * pOpt, sal_Int32 * pnIndex, const OUString & aArg) throw (RuntimeException) { - const OUString dash = OUString(RTL_CONSTASCII_USTRINGPARAM("-")); + const OUString dash(RTL_CONSTASCII_USTRINGPARAM("-")); if(aArg.indexOf(dash) != 0) return sal_False; @@ -650,7 +650,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc,) rtl_getAppCommandArg(nPos, &arg.pData); - const OUString dashdash = OUString(RTL_CONSTASCII_USTRINGPARAM("--")); + const OUString dashdash(RTL_CONSTASCII_USTRINGPARAM("--")); if (dashdash == arg) { ++nPos; -- cgit v1.2.3