summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorJean-Noël Rouvignac <jn.rouvignac@gmail.com>2013-01-30 11:44:23 +0100
committerLuboš Luňák <l.lunak@suse.cz>2013-01-30 12:54:40 +0000
commit97eb8a6e0eb830f37dcba64a51d725aab4c5ff53 (patch)
treea1a95b8249052d846a997ad1729758168d6a3b24 /jvmfwk
parentf8569cd9a28a3a8856dba4ad53218aa6cc073521 (diff)
Removed several useless macros: A2OU, A2S, C2U, C2S, OUSTR, OUSTRING
Change-Id: Ie859cb2dfdc7103c379fce56be88eef8fe390afd Reviewed-on: https://gerrit.libreoffice.org/1924 Tested-by: Luboš Luňák <l.lunak@suse.cz> Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx73
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx7
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx2
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/util.cxx66
4 files changed, 73 insertions, 75 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index fbc4eeb9a3d8..f8267c6bcc80 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -65,7 +65,6 @@
#define RUNNING_ON_VALGRIND 0
#endif
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
#define SUN_MICRO "Sun Microsystems Inc."
using namespace osl;
@@ -109,7 +108,7 @@ OString getPluginJarPath(
}
if (!sName.isEmpty())
{
- sName = sLocation + OUSTR("/lib/") + sName;
+ sName = sLocation + "/lib/" + sName;
OSL_VERIFY(
osl_getSystemPathFromFileURL(sName.pData, & sPath.pData)
== osl_File_E_None);
@@ -118,13 +117,13 @@ OString getPluginJarPath(
else
{
char sep[] = {SAL_PATHSEPARATOR, 0};
- OUString sName(sLocation + OUSTR("/lib/") + sName1);
+ OUString sName(sLocation + "/lib/" + sName1);
OUString sPath1;
OUString sPath2;
if (osl_getSystemPathFromFileURL(sName.pData, & sPath1.pData)
== osl_File_E_None)
{
- sName = sLocation + OUSTR("/lib/") + sName2;
+ sName = sLocation + "/lib/" + sName2;
if (osl_getSystemPathFromFileURL(sName.pData, & sPath2.pData)
== osl_File_E_None)
{
@@ -260,9 +259,9 @@ javaPluginError jfw_plugin_getAllJavaInfos(
{
//The minVersion was not recognized as valid for this vendor.
JFW_ENSURE(
- 0,OUSTR("[Java framework]sunjavaplugin does not know version: ")
- + ouMinVer + OUSTR(" for vendor: ") + cur->getVendor()
- + OUSTR(" .Check minimum Version.") );
+ 0,"[Java framework]sunjavaplugin does not know version: "
+ + ouMinVer + " for vendor: " + cur->getVendor()
+ + " .Check minimum Version." );
return JFW_PLUGIN_E_WRONG_VERSION_FORMAT;
}
}
@@ -278,9 +277,9 @@ javaPluginError jfw_plugin_getAllJavaInfos(
{
//The maxVersion was not recognized as valid for this vendor.
JFW_ENSURE(
- 0,OUSTR("[Java framework]sunjavaplugin does not know version: ")
- + ouMaxVer + OUSTR(" for vendor: ") + cur->getVendor()
- + OUSTR(" .Check maximum Version.") );
+ 0,"[Java framework]sunjavaplugin does not know version: "
+ + ouMaxVer + " for vendor: " + cur->getVendor()
+ + " .Check maximum Version." );
return JFW_PLUGIN_E_WRONG_VERSION_FORMAT;
}
}
@@ -301,9 +300,9 @@ javaPluginError jfw_plugin_getAllJavaInfos(
{
//The excluded version was not recognized as valid for this vendor.
JFW_ENSURE(
- 0,OUSTR("[Java framework]sunjavaplugin does not know version: ")
- + sExVer + OUSTR(" for vendor: ") + cur->getVendor()
- + OUSTR(" .Check excluded versions.") );
+ 0,"[Java framework]sunjavaplugin does not know version: "
+ + sExVer + " for vendor: " + cur->getVendor()
+ + " .Check excluded versions." );
return JFW_PLUGIN_E_WRONG_VERSION_FORMAT;
}
}
@@ -384,9 +383,9 @@ javaPluginError jfw_plugin_getJavaInfoByPath(
{
//The minVersion was not recognized as valid for this vendor.
JFW_ENSURE(
- 0,OUSTR("[Java framework]sunjavaplugin does not know version: ")
- + ouMinVer + OUSTR(" for vendor: ") + aVendorInfo->getVendor()
- + OUSTR(" .Check minimum Version.") );
+ 0,"[Java framework]sunjavaplugin does not know version: "
+ + ouMinVer + " for vendor: " + aVendorInfo->getVendor()
+ + " .Check minimum Version." );
return JFW_PLUGIN_E_WRONG_VERSION_FORMAT;
}
if (nRes < 0)
@@ -404,9 +403,9 @@ javaPluginError jfw_plugin_getJavaInfoByPath(
{
//The maxVersion was not recognized as valid for this vendor.
JFW_ENSURE(
- 0,OUSTR("[Java framework]sunjavaplugin does not know version: ")
- + ouMaxVer + OUSTR(" for vendor: ") + aVendorInfo->getVendor()
- + OUSTR(" .Check maximum Version.") );
+ 0,"[Java framework]sunjavaplugin does not know version: "
+ + ouMaxVer + " for vendor: " + aVendorInfo->getVendor()
+ + " .Check maximum Version." );
return JFW_PLUGIN_E_WRONG_VERSION_FORMAT;
}
if (nRes > 0)
@@ -425,9 +424,9 @@ javaPluginError jfw_plugin_getJavaInfoByPath(
{
//The excluded version was not recognized as valid for this vendor.
JFW_ENSURE(
- 0,OUSTR("[Java framework]sunjavaplugin does not know version: ")
- + sExVer + OUSTR(" for vendor: ") + aVendorInfo->getVendor()
- + OUSTR(" .Check excluded versions.") );
+ 0,"[Java framework]sunjavaplugin does not know version: "
+ + sExVer + " for vendor: " + aVendorInfo->getVendor()
+ + " .Check excluded versions." );
return JFW_PLUGIN_E_WRONG_VERSION_FORMAT;
}
if (nRes == 0)
@@ -571,8 +570,8 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
if ( ! isVendorSupported(pInfo->sVendor))
return JFW_PLUGIN_E_WRONG_VENDOR;
rtl::OUString sRuntimeLib = getRuntimeLib(pInfo->arVendorData);
- JFW_TRACE2(OUSTR("[Java framework] Using Java runtime library: ")
- + sRuntimeLib + OUSTR(".\n"));
+ JFW_TRACE2("[Java framework] Using Java runtime library: "
+ + sRuntimeLib + ".\n");
#ifndef ANDROID
// On linux we load jvm with RTLD_GLOBAL. This is necessary for debugging, because
@@ -589,12 +588,12 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
if ((moduleRt = osl_loadModule(sRuntimeLib.pData, SAL_LOADMODULE_DEFAULT)) == 0)
#endif
{
- JFW_ENSURE(0, OUSTR("[Java framework]sunjavaplugin" SAL_DLLEXTENSION
- " could not load Java runtime library: \n")
- + sRuntimeLib + OUSTR("\n"));
- JFW_TRACE0(OUSTR("[Java framework]sunjavaplugin" SAL_DLLEXTENSION
- " could not load Java runtime library: \n")
- + sRuntimeLib + OUSTR("\n"));
+ JFW_ENSURE(0, "[Java framework]sunjavaplugin" SAL_DLLEXTENSION
+ " could not load Java runtime library: \n"
+ + sRuntimeLib + "\n");
+ JFW_TRACE0("[Java framework]sunjavaplugin" SAL_DLLEXTENSION
+ " could not load Java runtime library: \n"
+ + sRuntimeLib + "\n");
return JFW_PLUGIN_E_VM_CREATION_FAILED;
}
@@ -784,28 +783,28 @@ javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, sal_Bool *exist)
if (ret == JFW_PLUGIN_E_NONE && *exist == sal_True)
{
rtl::OUString sRuntimeLib = getRuntimeLib(pInfo->arVendorData);
- JFW_TRACE2(OUSTR("[Java framework] Checking existence of Java runtime library.\n"));
+ JFW_TRACE2("[Java framework] Checking existence of Java runtime library.\n");
::osl::DirectoryItem itemRt;
::osl::File::RC rc_itemRt = ::osl::DirectoryItem::get(sRuntimeLib, itemRt);
if (::osl::File::E_None == rc_itemRt)
{
*exist = sal_True;
- JFW_TRACE2(OUSTR("[Java framework] Java runtime library exist: ")
- + sRuntimeLib + OUSTR("\n"));
+ JFW_TRACE2("[Java framework] Java runtime library exist: "
+ + sRuntimeLib + "\n");
}
else if (::osl::File::E_NOENT == rc_itemRt)
{
*exist = sal_False;
- JFW_TRACE2(OUSTR("[Java framework] Java runtime library does not exist: ")
- + sRuntimeLib + OUSTR("\n"));
+ JFW_TRACE2("[Java framework] Java runtime library does not exist: "
+ + sRuntimeLib + "\n");
}
else
{
ret = JFW_PLUGIN_E_ERROR;
- JFW_TRACE2(OUSTR("[Java framework] Error while looking for Java runtime library: ")
- + sRuntimeLib + OUSTR(" \n"));
+ JFW_TRACE2("[Java framework] Error while looking for Java runtime library: "
+ + sRuntimeLib + " \n");
}
}
#endif
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
index 6c2bc0f6d82d..a4ff38cdaf52 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
@@ -25,7 +25,6 @@
using namespace std;
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
namespace jfw_plugin
{
@@ -92,9 +91,9 @@ int SunInfo::compareVersions(const rtl::OUString& sSecond) const
rtl::OUString sFirst = getVersion();
SunVersion version1(sFirst);
- JFW_ENSURE(version1, OUSTR("[Java framework] sunjavaplugin" SAL_DLLEXTENSION
- " does not know the version: ")
- + sFirst + OUSTR(" as valid for a SUN/Oracle JRE."));
+ JFW_ENSURE(version1, "[Java framework] sunjavaplugin" SAL_DLLEXTENSION
+ " does not know the version: "
+ + sFirst + " as valid for a SUN/Oracle JRE.");
SunVersion version2(sSecond);
if ( ! version2)
throw MalformedVersionException();
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
index 463159cc3955..4eaff7ba6fff 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
@@ -33,8 +33,6 @@ using ::rtl::OString;
namespace jfw_plugin { //stoc_javadetect
-#define OUSTR( x ) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( x ))
-
#if OSL_DEBUG_LEVEL >= 2
class SelfTest
{
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 1f266f1ef0f2..662f66d6f2d2 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -59,7 +59,6 @@ using ::rtl::OString;
using ::rtl::OUStringBuffer;
using ::rtl::OUStringToOString;
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
#ifdef WNT
#define HKEY_SUN_JRE L"Software\\JavaSoft\\Java Runtime Environment"
#define HKEY_SUN_SDK L"Software\\JavaSoft\\Java Development Kit"
@@ -158,8 +157,8 @@ namespace
buf.append( getLibraryLocation());
buf.appendAscii( SAL_CONFIGFILE("/sunjavaplugin") );
sIni = buf.makeStringAndClear();
- JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin: "
- "Using configuration file \n") + sIni);
+ JFW_TRACE2("[Java framework] sunjavaplugin: "
+ "Using configuration file \n" + sIni);
return sIni;
}
};
@@ -391,14 +390,14 @@ bool getJavaProps(const OUString & exePath,
//"noaccessibility" to JREProperties.class. This will prevent
//that it calls java.awt.Toolkit.getDefaultToolkit();
OUString sValue;
- getBootstrap()->getFrom(OUSTR("JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY"), sValue);
+ getBootstrap()->getFrom("JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY", sValue);
//prepare the arguments
sal_Int32 cArgs = 3;
OUString arg1 = OUString(RTL_CONSTASCII_USTRINGPARAM("-classpath"));// + sClassPath;
OUString arg2 = sClassPath;
OUString arg3(RTL_CONSTASCII_USTRINGPARAM("JREProperties"));
- OUString arg4 = OUSTR("noaccessibility");
+ OUString arg4 = "noaccessibility";
rtl_uString *args[4] = {arg1.pData, arg2.pData, arg3.pData};
// Only add the fourth param if the bootstrap parameter is set.
@@ -415,7 +414,7 @@ bool getJavaProps(const OUString & exePath,
FileHandleReader stdoutReader(fileOut);
rtl::Reference< AsynchReader > stderrReader(new AsynchReader(fileErr));
- JFW_TRACE2(OUSTR("\n[Java framework] Executing: ") + exePath + OUSTR(".\n"));
+ JFW_TRACE2("\n[Java framework] Executing: " + exePath + ".\n");
oslProcessError procErr =
osl_executeProcess_WithRedirectedIO( exePath.pData,//usExe.pData,
args,
@@ -874,9 +873,10 @@ rtl::Reference<VendorBase> getJREInfoByPath(
SameOrSubDirJREMap(sResolvedDir));
if (entry2 != mapJREs.end())
{
- JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin" SAL_DLLEXTENSION ": ")
- + OUSTR("JRE found again (detected before): ") + sResolvedDir
- + OUSTR(".\n"));
+ JFW_TRACE2(OUString("[Java framework] sunjavaplugin")
+ + SAL_DLLEXTENSION + ": "
+ + "JRE found again (detected before): " + sResolvedDir
+ + ".\n");
return entry2->second;
}
@@ -925,9 +925,10 @@ rtl::Reference<VendorBase> getJREInfoByPath(
MapIt entry = mapJREs.find(sFilePath);
if (entry != mapJREs.end())
{
- JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin" SAL_DLLEXTENSION ": ")
- + OUSTR("JRE found again (detected before): ") + sFilePath
- + OUSTR(".\n"));
+ JFW_TRACE2(OUString("[Java framework] sunjavaplugin")
+ + SAL_DLLEXTENSION + ": "
+ + "JRE found again (detected before): " + sFilePath
+ + ".\n");
return entry->second;
}
@@ -1021,9 +1022,10 @@ rtl::Reference<VendorBase> getJREInfoByPath(
vecBadPaths.push_back(sFilePath);
else
{
- JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin" SAL_DLLEXTENSION ": ")
- + OUSTR("Found JRE: ") + sResolvedDir
- + OUSTR(" \n at: ") + path + OUSTR(".\n"));
+ JFW_TRACE2(OUString("[Java framework] sunjavaplugin")
+ + SAL_DLLEXTENSION + ": "
+ + "Found JRE: " + sResolvedDir
+ + " \n at: " + path + ".\n");
mapJREs.insert(MAPJRE::value_type(sResolvedDir, ret));
mapJREs.insert(MAPJRE::value_type(sFilePath, ret));
@@ -1135,15 +1137,15 @@ bool makeDriveLetterSame(OUString * fileURL)
void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
{
- JFW_TRACE2(OUSTR("\n[Java framework] Checking \"/usr/jdk/latest\"\n"));
- getJREInfoByPath(OUSTR("file:////usr/jdk/latest"), vecInfos);
+ JFW_TRACE2("\n[Java framework] Checking \"/usr/jdk/latest\"\n");
+ getJREInfoByPath("file:////usr/jdk/latest", vecInfos);
}
#else
void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
{
- OUString excMessage = OUSTR("[Java framework] sunjavaplugin: "
- "Error in function createJavaInfoDirScan in util.cxx.");
+ OUString excMessage = "[Java framework] sunjavaplugin: "
+ "Error in function createJavaInfoDirScan in util.cxx.";
int cJavaNames= sizeof(g_arJavaNames) / sizeof(char*);
boost::scoped_array<OUString> sarJavaNames(new OUString[cJavaNames]);
OUString *arNames = sarJavaNames.get();
@@ -1193,14 +1195,14 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
case File::E_NOTDIR:
continue;
case File::E_ACCES:
- JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin: "
- "Could not read directory ") + usDir2 +
- OUSTR(" because of missing access rights."));
+ JFW_TRACE2(OUString("[Java framework] sunjavaplugin: ")
+ + "Could not read directory " + usDir2
+ + " because of missing access rights.");
continue;
default:
- JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin: "
- "Could not read directory ")
- + usDir2 + OUSTR(". Osl file error: ")
+ JFW_TRACE2(OUString("[Java framework] sunjavaplugin: ")
+ + "Could not read directory "
+ + usDir2 + ". Osl file error: "
+ OUString::valueOf((sal_Int32) openErr));
continue;
}
@@ -1213,21 +1215,21 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
File::RC errStatus = File::E_None;
if ((errStatus = curIt.getFileStatus(aStatus)) != File::E_None)
{
- JFW_TRACE2(excMessage + OUSTR("getFileStatus failed with error ")
+ JFW_TRACE2(excMessage + "getFileStatus failed with error "
+ OUString::valueOf((sal_Int32) errStatus));
continue;
}
- JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin: "
- "Checking if directory: ") + aStatus.getFileURL() +
- OUSTR(" is a Java. \n"));
+ JFW_TRACE2(OUString("[Java framework] sunjavaplugin: ") +
+ "Checking if directory: " + aStatus.getFileURL() +
+ " is a Java. \n");
getJREInfoByPath(aStatus.getFileURL(),vecInfos);
}
JFW_ENSURE(errNext == File::E_None || errNext == File::E_NOENT,
- OUSTR("[Java framework] sunjavaplugin: "
- "Error while iterating over contens of ")
- + usDir2 + OUSTR(". Osl file error: ")
+ OUString("[Java framework] sunjavaplugin: ")
+ + "Error while iterating over contens of "
+ + usDir2 + ". Osl file error: "
+ OUString::valueOf((sal_Int32) openErr));
}
else