diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-10-25 12:43:57 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-10-25 16:59:32 +0100 |
commit | cdcbc2be88c1026ff3f6771b58357454e8e16cce (patch) | |
tree | a686f82b45b9cb017bb7636f7e23d54936a55507 | |
parent | bd4432814051ee47ce5a5b34c697fac0f17d79bc (diff) |
micro optimizations
-rw-r--r-- | cpputools/source/regcomplazy/regcomplazy.cxx | 11 | ||||
-rw-r--r-- | cpputools/source/registercomponent/registercomponent.cxx | 12 | ||||
-rw-r--r-- | 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 7b5613876..fec0f6a8e 100644 --- a/cpputools/source/regcomplazy/regcomplazy.cxx +++ b/cpputools/source/regcomplazy/regcomplazy.cxx @@ -40,7 +40,6 @@ #include <registry/registry.hxx> -#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 4f3c498d3..92f7e2f30 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> xSet( xSMgr, UNO_QUERY ); diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx index b7c936b0d..bac822b86 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; |