Kaydet (Commit) cd30747b authored tarafından Noel Grandin's avatar Noel Grandin

remove unnecessary use of OUString constructor in STOC module

Change-Id: I980223cedb6d0054ef71cbd81691f70a24f506ad
üst c3e55a1f
......@@ -737,7 +737,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > &
InvocationTargetException aExc;
aExc.Context = *(const Reference< XInterface > *)rObj.getValue();
aExc.Message = OUString("exception occurred during invocation!");
aExc.Message = "exception occurred during invocation!";
uno_any_destruct(
&aExc.TargetException,
reinterpret_cast< uno_ReleaseFunc >(cpp_release) );
......
......@@ -2312,7 +2312,7 @@ rtl::Reference< IntrospectionAccessStatic_Impl > ImplIntrospection::implInspect(
}
else
{
if( aMethName != OUString("queryInterface") )
if( aMethName != "queryInterface" )
{
rMethodConcept_i |= MethodConcept::DANGEROUS;
continue;
......
......@@ -70,7 +70,7 @@ namespace stoc_inv
static Sequence< OUString > inv_getSupportedServiceNames()
{
Sequence< OUString > seqNames(1);
seqNames.getArray()[0] = OUString(SERVICENAME);
seqNames.getArray()[0] = SERVICENAME;
return seqNames;
}
......@@ -668,7 +668,7 @@ Any Invocation_Impl::invoke( const OUString& FunctionName, const Sequence<Any>&
{
CannotConvertException aExc;
aExc.Context = *this;
aExc.Message = OUString("invocation type mismatch!");
aExc.Message = "invocation type mismatch!";
throw aExc;
}
}
......@@ -708,7 +708,7 @@ Any Invocation_Impl::invoke( const OUString& FunctionName, const Sequence<Any>&
RuntimeException aExc;
aExc.Context = *this;
aExc.Message = OUString("invocation lacking of introspection access!");
aExc.Message = "invocation lacking of introspection access!";
throw aExc;
}
......
......@@ -294,13 +294,13 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
// read ftp proxy name
css::uno::Reference<css::registry::XRegistryKey> ftpProxy_name = xRegistryRootKey->openKey("Settings/ooInetFTPProxyName");
if(ftpProxy_name.is() && !ftpProxy_name->getStringValue().isEmpty()) {
OUString ftpHost = OUString("ftp.proxyHost=");
OUString ftpHost = "ftp.proxyHost=";
ftpHost += ftpProxy_name->getStringValue();
// read ftp proxy port
css::uno::Reference<css::registry::XRegistryKey> ftpProxy_port = xRegistryRootKey->openKey("Settings/ooInetFTPProxyPort");
if(ftpProxy_port.is() && ftpProxy_port->getLongValue()) {
OUString ftpPort = OUString("ftp.proxyPort=");
OUString ftpPort = "ftp.proxyPort=";
ftpPort += OUString::number(ftpProxy_port->getLongValue());
pjvm->pushProp(ftpHost);
......@@ -311,13 +311,13 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
// read http proxy name
css::uno::Reference<css::registry::XRegistryKey> httpProxy_name = xRegistryRootKey->openKey("Settings/ooInetHTTPProxyName");
if(httpProxy_name.is() && !httpProxy_name->getStringValue().isEmpty()) {
OUString httpHost = OUString("http.proxyHost=");
OUString httpHost = "http.proxyHost=";
httpHost += httpProxy_name->getStringValue();
// read http proxy port
css::uno::Reference<css::registry::XRegistryKey> httpProxy_port = xRegistryRootKey->openKey("Settings/ooInetHTTPProxyPort");
if(httpProxy_port.is() && httpProxy_port->getLongValue()) {
OUString httpPort = OUString("http.proxyPort=");
OUString httpPort = "http.proxyPort=";
httpPort += OUString::number(httpProxy_port->getLongValue());
pjvm->pushProp(httpHost);
......@@ -328,13 +328,13 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
// read https proxy name
css::uno::Reference<css::registry::XRegistryKey> httpsProxy_name = xRegistryRootKey->openKey("Settings/ooInetHTTPSProxyName");
if(httpsProxy_name.is() && !httpsProxy_name->getStringValue().isEmpty()) {
OUString httpsHost = OUString("https.proxyHost=");
OUString httpsHost = "https.proxyHost=";
httpsHost += httpsProxy_name->getStringValue();
// read https proxy port
css::uno::Reference<css::registry::XRegistryKey> httpsProxy_port = xRegistryRootKey->openKey("Settings/ooInetHTTPSProxyPort");
if(httpsProxy_port.is() && httpsProxy_port->getLongValue()) {
OUString httpsPort = OUString("https.proxyPort=");
OUString httpsPort = "https.proxyPort=";
httpsPort += OUString::number(httpsProxy_port->getLongValue());
pjvm->pushProp(httpsHost);
......@@ -345,8 +345,8 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
// read nonProxyHosts
css::uno::Reference<css::registry::XRegistryKey> nonProxies_name = xRegistryRootKey->openKey("Settings/ooInetNoProxy");
if(nonProxies_name.is() && !nonProxies_name->getStringValue().isEmpty()) {
OUString httpNonProxyHosts = OUString("http.nonProxyHosts=");
OUString ftpNonProxyHosts= OUString("ftp.nonProxyHosts=");
OUString httpNonProxyHosts = "http.nonProxyHosts=";
OUString ftpNonProxyHosts = "ftp.nonProxyHosts=";
OUString value= nonProxies_name->getStringValue();
// replace the separator ";" by "|"
value= value.replace((sal_Unicode)';', (sal_Unicode)'|');
......@@ -449,11 +449,11 @@ void getJavaPropsFromSafetySettings(
OUString sVal;
switch( val)
{
case 0: sVal= OUString("host");
case 0: sVal = "host";
break;
case 1: sVal= OUString("unrestricted");
case 1: sVal = "unrestricted";
break;
case 3: sVal= OUString("none");
case 3: sVal = "none";
break;
}
OUString sProperty("appletviewer.security.mode=");
......@@ -1077,62 +1077,62 @@ void SAL_CALL JavaVirtualMachine::elementReplaced(
}
else if ( aAccessor == "ooInetHTTPProxyName" )
{
aPropertyName = OUString("http.proxyHost");
aPropertyName = "http.proxyHost";
rEvent.Element >>= aPropertyValue;
}
else if ( aAccessor == "ooInetHTTPProxyPort" )
{
aPropertyName = OUString("http.proxyPort");
aPropertyName = "http.proxyPort";
sal_Int32 n = 0;
rEvent.Element >>= n;
aPropertyValue = OUString::number(n);
}
else if ( aAccessor == "ooInetHTTPSProxyName" )
{
aPropertyName = OUString("https.proxyHost");
aPropertyName = "https.proxyHost";
rEvent.Element >>= aPropertyValue;
}
else if ( aAccessor == "ooInetHTTPSProxyPort" )
{
aPropertyName = OUString("https.proxyPort");
aPropertyName = "https.proxyPort";
sal_Int32 n = 0;
rEvent.Element >>= n;
aPropertyValue = OUString::number(n);
}
else if ( aAccessor == "ooInetFTPProxyName" )
{
aPropertyName = OUString("ftp.proxyHost");
aPropertyName = "ftp.proxyHost";
rEvent.Element >>= aPropertyValue;
}
else if ( aAccessor == "ooInetFTPProxyPort" )
{
aPropertyName = OUString("ftp.proxyPort");
aPropertyName = "ftp.proxyPort";
sal_Int32 n = 0;
rEvent.Element >>= n;
aPropertyValue = OUString::number(n);
}
else if ( aAccessor == "ooInetNoProxy" )
{
aPropertyName = OUString("http.nonProxyHosts");
aPropertyName2 = OUString("ftp.nonProxyHosts");
aPropertyName = "http.nonProxyHosts";
aPropertyName2 = "ftp.nonProxyHosts";
rEvent.Element >>= aPropertyValue;
aPropertyValue = aPropertyValue.replace(';', '|');
}
else if ( aAccessor == "NetAccess" )
{
aPropertyName = OUString("appletviewer.security.mode");
aPropertyName = "appletviewer.security.mode";
sal_Int32 n = 0;
if (rEvent.Element >>= n)
switch (n)
{
case 0:
aPropertyValue = OUString("host");
aPropertyValue = "host";
break;
case 1:
aPropertyValue = OUString("unrestricted");
aPropertyValue = "unrestricted";
break;
case 3:
aPropertyValue = OUString("none");
aPropertyValue = "none";
break;
}
else
......@@ -1141,13 +1141,13 @@ void SAL_CALL JavaVirtualMachine::elementReplaced(
}
else if ( aAccessor == "Security" )
{
aPropertyName = OUString("stardiv.security.disableSecurity");
aPropertyName = "stardiv.security.disableSecurity";
sal_Bool b = sal_Bool();
if (rEvent.Element >>= b)
if (b)
aPropertyValue = OUString("false");
aPropertyValue = "false";
else
aPropertyValue = OUString("true");
aPropertyValue = "true";
else
return;
bSecurityChanged = true;
......
......@@ -73,7 +73,7 @@ namespace stoc_bootstrap
Sequence< OUString > smgr_wrapper_getSupportedServiceNames()
{
Sequence< OUString > seqNames(1);
seqNames.getArray()[0] = OUString("com.sun.star.lang.MultiServiceFactory");
seqNames.getArray()[0] = "com.sun.star.lang.MultiServiceFactory";
return seqNames;
}
......@@ -85,8 +85,8 @@ OUString smgr_wrapper_getImplementationName()
Sequence< OUString > smgr_getSupportedServiceNames()
{
Sequence< OUString > seqNames(2);
seqNames.getArray()[0] = OUString("com.sun.star.lang.MultiServiceFactory");
seqNames.getArray()[1] = OUString("com.sun.star.lang.ServiceManager");
seqNames.getArray()[0] = "com.sun.star.lang.MultiServiceFactory";
seqNames.getArray()[1] = "com.sun.star.lang.ServiceManager";
return seqNames;
}
......@@ -98,8 +98,8 @@ OUString smgr_getImplementationName()
Sequence< OUString > regsmgr_getSupportedServiceNames()
{
Sequence< OUString > seqNames(2);
seqNames.getArray()[0] = OUString("com.sun.star.lang.MultiServiceFactory");
seqNames.getArray()[1] = OUString("com.sun.star.lang.RegistryServiceManager");
seqNames.getArray()[0] = "com.sun.star.lang.MultiServiceFactory";
seqNames.getArray()[1] = "com.sun.star.lang.RegistryServiceManager";
return seqNames;
}
......@@ -864,8 +864,7 @@ Any OServiceManager::getPropertyValue(const OUString& PropertyName)
else
{
UnknownPropertyException except;
except.Message = OUString( "ServiceManager : unknown property " );
except.Message += PropertyName;
except.Message = "ServiceManager : unknown property " + PropertyName;
throw except;
}
}
......@@ -1507,7 +1506,7 @@ Reference<XInterface > ORegistryServiceManager::loadWithImplementationName(
try
{
OUString implementationName = OUString("/IMPLEMENTATIONS/") + name;
OUString implementationName = "/IMPLEMENTATIONS/" + name;
Reference<XRegistryKey > xImpKey = m_xRootKey->openKey(implementationName);
if( xImpKey.is() )
......
......@@ -1131,7 +1131,7 @@ css::uno::Reference< css::uno::XInterface > SimpleRegistry_CreateInstance(
css::uno::Sequence< OUString > simreg_getSupportedServiceNames() {
css::uno::Sequence< OUString > names(1);
names[0] = OUString("com.sun.star.registry.SimpleRegistry");
names[0] = "com.sun.star.registry.SimpleRegistry";
return names;
}
......
......@@ -217,7 +217,7 @@ OUString getImplementationName() {
css::uno::Sequence< OUString > getSupportedServiceNames() {
css::uno::Sequence< OUString > s(1);
s[0] = OUString("com.sun.star.uri.ExternalUriReferenceTranslator");
s[0] = "com.sun.star.uri.ExternalUriReferenceTranslator";
return s;
}
......
......@@ -460,7 +460,7 @@ OUString getImplementationName() {
css::uno::Sequence< OUString > getSupportedServiceNames() {
css::uno::Sequence< OUString > s(1);
s[0] = OUString("com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript");
s[0] = "com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript";
return s;
}
......
......@@ -144,7 +144,7 @@ OUString getImplementationName() {
css::uno::Sequence< OUString > getSupportedServiceNames() {
css::uno::Sequence< OUString > s(1);
s[0] = OUString("com.sun.star.uri.VndSunStarPkgUrlReferenceFactory");
s[0] = "com.sun.star.uri.VndSunStarPkgUrlReferenceFactory";
return s;
}
......
......@@ -855,7 +855,7 @@ test::TestData Test_Impl::raiseException( sal_Bool& /*bBool*/, sal_Unicode& /*cC
{
IllegalArgumentException aExc;
aExc.ArgumentPosition = 5;
aExc.Message = OUString("dum dum dum ich tanz im kreis herum...");
aExc.Message = "dum dum dum ich tanz im kreis herum...";
aExc.Context = *this;
throw aExc;
}
......@@ -863,7 +863,7 @@ test::TestData Test_Impl::raiseException( sal_Bool& /*bBool*/, sal_Unicode& /*cC
sal_Int32 Test_Impl::getRuntimeException() throw(::com::sun::star::uno::RuntimeException)
{
RuntimeException aExc;
aExc.Message = OUString("dum dum dum ich tanz im kreis herum...");
aExc.Message = "dum dum dum ich tanz im kreis herum...";
aExc.Context = *this;
throw aExc;
}
......@@ -871,7 +871,7 @@ sal_Int32 Test_Impl::getRuntimeException() throw(::com::sun::star::uno::RuntimeE
void Test_Impl::setRuntimeException( sal_Int32 /*_runtimeexception*/ ) throw(::com::sun::star::uno::RuntimeException)
{
RuntimeException aExc;
aExc.Message = OUString("dum dum dum ich tanz im kreis herum...");
aExc.Message = "dum dum dum ich tanz im kreis herum...";
aExc.Context = *this;
throw aExc;
}
......
......@@ -102,19 +102,19 @@ OUString AnyToString( const Any& aValue, sal_Bool bIncludeType, const Reference<
OUString aRetStr;
switch( eType )
{
case TypeClass_TYPE: aRetStr = OUString("TYPE TYPE"); break;
case TypeClass_INTERFACE: aRetStr = OUString("TYPE INTERFACE"); break;
case TypeClass_SERVICE: aRetStr = OUString("TYPE SERVICE"); break;
case TypeClass_STRUCT: aRetStr = OUString("TYPE STRUCT"); break;
case TypeClass_TYPEDEF: aRetStr = OUString("TYPE TYPEDEF"); break;
case TypeClass_UNION: aRetStr = OUString("TYPE UNION"); break;
case TypeClass_ENUM: aRetStr = OUString("TYPE ENUM"); break;
case TypeClass_EXCEPTION: aRetStr = OUString("TYPE EXCEPTION"); break;
case TypeClass_ARRAY: aRetStr = OUString("TYPE ARRAY"); break;
case TypeClass_SEQUENCE: aRetStr = OUString("TYPE SEQUENCE"); break;
case TypeClass_VOID: aRetStr = OUString("TYPE void"); break;
case TypeClass_ANY: aRetStr = OUString("TYPE any"); break;
case TypeClass_UNKNOWN: aRetStr = OUString("TYPE unknown"); break;
case TypeClass_TYPE: aRetStr = "TYPE TYPE"; break;
case TypeClass_INTERFACE: aRetStr = "TYPE INTERFACE"; break;
case TypeClass_SERVICE: aRetStr = "TYPE SERVICE"; break;
case TypeClass_STRUCT: aRetStr = "TYPE STRUCT"; break;
case TypeClass_TYPEDEF: aRetStr = "TYPE TYPEDEF"; break;
case TypeClass_UNION: aRetStr = "TYPE UNION"; break;
case TypeClass_ENUM: aRetStr = "TYPE ENUM"; break;
case TypeClass_EXCEPTION: aRetStr = "TYPE EXCEPTION"; break;
case TypeClass_ARRAY: aRetStr = "TYPE ARRAY"; break;
case TypeClass_SEQUENCE: aRetStr = "TYPE SEQUENCE"; break;
case TypeClass_VOID: aRetStr = "TYPE void"; break;
case TypeClass_ANY: aRetStr = "TYPE any"; break;
case TypeClass_UNKNOWN: aRetStr = "TYPE unknown"; break;
case TypeClass_BOOLEAN:
{
sal_Bool b = *(sal_Bool*)aValue.getValue();
......@@ -215,17 +215,17 @@ Sequence< Property > ImplPropertySetInfo::getProperties(void)
pSeq = new Sequence<Property>( 3 );
Property * pAry = pSeq->getArray();
pAry[0].Name = OUString("Factor");
pAry[0].Name = "Factor";
pAry[0].Handle = -1;
pAry[0].Type = getCppuType( (double*) NULL );
pAry[0].Attributes = BOUND | TRANSIENT;
pAry[1].Name = OUString("MyCount");
pAry[1].Name = "MyCount";
pAry[1].Handle = -1;
pAry[1].Type = getCppuType( (sal_Int32*) NULL );
pAry[1].Attributes = BOUND | TRANSIENT;
pAry[2].Name = OUString("Info");
pAry[2].Name = "Info";
pAry[2].Handle = -1;
pAry[2].Type = getCppuType( (OUString*) NULL );
pAry[2].Attributes = TRANSIENT;
......@@ -439,7 +439,7 @@ void ImplIntroTest::Init( void )
// Properties initialization
aAnyArray[0] <<= 3.14;
aAnyArray[1] <<= (sal_Int32)42;
aAnyArray[2] <<= OUString( OUString("Hallo") );
aAnyArray[2] <<= OUString( "Hallo" );
// Einmal fuer den internen Gebrauch die PropertySetInfo abholen
m_xMyInfo = getPropertySetInfo();
......@@ -457,13 +457,12 @@ void ImplIntroTest::Init( void )
// String-Sequence initialization
aStringSeq.realloc( 3 );
OUString* pStr = aStringSeq.getArray();
pStr[ 0 ] = OUString( OUString("String 0") );
pStr[ 1 ] = OUString( OUString("String 1") );
pStr[ 2 ] = OUString( OUString("String 2") );
aStringSeq[ 0 ] = "String 0";
aStringSeq[ 1 ] = "String 1";
aStringSeq[ 2 ] = "String 2";
// structs initialization
m_aFirstStruct.Name = OUString("FirstStruct-Name");
m_aFirstStruct.Name = "FirstStruct-Name";
m_aFirstStruct.Handle = 77777;
//XIdlClassRef Type;
m_aFirstStruct.Attributes = -222;
......@@ -1199,8 +1198,7 @@ SAL_IMPLEMENT_MAIN()
OSL_ENSURE( xRefl.is(), "### no corereflection!" );
// Introspection
libName = OUString(
"introspection.uno" SAL_DLLEXTENSION);
libName = OUString( "introspection.uno" SAL_DLLEXTENSION);
fprintf(stderr, "3\n" );
xImplReg->registerImplementation(OUString("com.sun.star.loader.SharedLibrary"),
libName, Reference< XSimpleRegistry >() );
......
......@@ -155,8 +155,8 @@ Sequence< OUString > Test_Manager_Impl::getSupportedServiceNames(void) throw ()
Sequence< OUString > Test_Manager_Impl::getSupportedServiceNames_Static(void) throw ()
{
Sequence< OUString > aSNS( 2 );
aSNS.getArray()[0] = OUString(SERVICE_NAME);
aSNS.getArray()[1] = OUString("com.sun.star.bridge.Bridge");
aSNS.getArray()[0] = SERVICE_NAME;
aSNS.getArray()[1] = "com.sun.star.bridge.Bridge";
return aSNS;
}
......@@ -179,7 +179,7 @@ extern "C" void SAL_CALL test_ServiceManager()
#if ! defined SAL_DLLPREFIX
#define SAL_DLLPREFIX ""
#endif
OUString atUModule2 = OUString( SAL_DLLPREFIX "testsmgr_component" SAL_DLLEXTENSION );
OUString atUModule2 = SAL_DLLPREFIX "testsmgr_component" SAL_DLLEXTENSION ;
// expand shared library name
OString atModule2( OUStringToOString(atUModule2, RTL_TEXTENCODING_ASCII_US) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment