diff options
Diffstat (limited to 'jvmfwk')
41 files changed, 373 insertions, 373 deletions
diff --git a/jvmfwk/distributions/OpenOfficeorg/javavendors_freebsd.xml b/jvmfwk/distributions/OpenOfficeorg/javavendors_freebsd.xml index 2dd5fe35f555..c4653b94f6ca 100644 --- a/jvmfwk/distributions/OpenOfficeorg/javavendors_freebsd.xml +++ b/jvmfwk/distributions/OpenOfficeorg/javavendors_freebsd.xml @@ -2,10 +2,10 @@ <javaSelection xmlns="http://openoffice.org/2004/java/framework/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + <updated>2008-08-27</updated> - - <vendorInfos> + + <vendorInfos> <vendor name="Sun Microsystems Inc."> <minVersion>1.5.0</minVersion> </vendor> diff --git a/jvmfwk/distributions/OpenOfficeorg/javavendors_linux.xml b/jvmfwk/distributions/OpenOfficeorg/javavendors_linux.xml index ed329e5788d3..2422195465d9 100644 --- a/jvmfwk/distributions/OpenOfficeorg/javavendors_linux.xml +++ b/jvmfwk/distributions/OpenOfficeorg/javavendors_linux.xml @@ -2,10 +2,10 @@ <javaSelection xmlns="http://openoffice.org/2004/java/framework/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + <updated>2004-01-30</updated> - - <vendorInfos> + + <vendorInfos> <vendor name="Sun Microsystems Inc."> <minVersion>1.5.0</minVersion> </vendor> diff --git a/jvmfwk/distributions/OpenOfficeorg/javavendors_os2.xml b/jvmfwk/distributions/OpenOfficeorg/javavendors_os2.xml index 2de585472b86..2882c27a04f7 100644 --- a/jvmfwk/distributions/OpenOfficeorg/javavendors_os2.xml +++ b/jvmfwk/distributions/OpenOfficeorg/javavendors_os2.xml @@ -2,10 +2,10 @@ <javaSelection xmlns="http://openoffice.org/2004/java/framework/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + <updated>2004-01-30</updated> - - <vendorInfos> + + <vendorInfos> <vendor name="Sun Microsystems Inc."> <minVersion>1.4.2</minVersion> </vendor> diff --git a/jvmfwk/distributions/OpenOfficeorg/javavendors_template.xml b/jvmfwk/distributions/OpenOfficeorg/javavendors_template.xml index d18dc66585a5..f5040f83c8ee 100644 --- a/jvmfwk/distributions/OpenOfficeorg/javavendors_template.xml +++ b/jvmfwk/distributions/OpenOfficeorg/javavendors_template.xml @@ -1,17 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- -This is a template for the javavendors.xml. It shows how the file could +This is a template for the javavendors.xml. It shows how the file could look like. --> <javaSelection xmlns="http://openoffice.org/2004/java/framework/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openoffice.org/2004/java/framework/1.0 file:/D:/cws-jl6/jvmfwk/source/javavendors.xsd" > - + <updated>2004-01-30</updated> - - <vendorInfos> + + <vendorInfos> <vendor name="Sun Microsystems Inc."> <minVersion>1.3.1</minVersion> <maxVersion>1.5.0</maxVersion> diff --git a/jvmfwk/distributions/OpenOfficeorg/javavendors_unx.xml b/jvmfwk/distributions/OpenOfficeorg/javavendors_unx.xml index 3b1f53fc4fce..ffcf9682c620 100755 --- a/jvmfwk/distributions/OpenOfficeorg/javavendors_unx.xml +++ b/jvmfwk/distributions/OpenOfficeorg/javavendors_unx.xml @@ -2,10 +2,10 @@ <javaSelection xmlns="http://openoffice.org/2004/java/framework/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + <updated>2004-01-30</updated> - - <vendorInfos> + + <vendorInfos> <vendor name="Sun Microsystems Inc."> <minVersion>1.5.0</minVersion> </vendor> diff --git a/jvmfwk/distributions/OpenOfficeorg/javavendors_wnt.xml b/jvmfwk/distributions/OpenOfficeorg/javavendors_wnt.xml index a72216d66646..267f02fb7570 100644 --- a/jvmfwk/distributions/OpenOfficeorg/javavendors_wnt.xml +++ b/jvmfwk/distributions/OpenOfficeorg/javavendors_wnt.xml @@ -2,10 +2,10 @@ <javaSelection xmlns="http://openoffice.org/2004/java/framework/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + <updated>2004-01-30</updated> - - <vendorInfos> + + <vendorInfos> <vendor name="Sun Microsystems Inc."> <minVersion>1.5.0</minVersion> </vendor> diff --git a/jvmfwk/inc/jvmfwk/framework.h b/jvmfwk/inc/jvmfwk/framework.h index 11cca539cb05..8736bf46f226 100644 --- a/jvmfwk/inc/jvmfwk/framework.h +++ b/jvmfwk/inc/jvmfwk/framework.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,7 +47,7 @@ extern "C" { /** @file <p>This library can operate in two modes, application mode and direct mode.</p> - + <h2>Application Mode</h2> In application mode the Java related settings are stored in files. @@ -68,7 +68,7 @@ extern "C" { <dd>The file contains settings valid for all users. If a user changes a setting then it takes precedence over the setting from UNO_JAVA_JFW_SHARED_DATA. The content of this file is an implementation detail and may change in the future.</dd> - + <dt>UNO_JAVA_JFW_INSTALL_DATA</dt> <dd><b>DEPRECATED. Support for this variable will soon be removed.</b><br> The file contains settings for all users. A user cannot override these settings. @@ -79,7 +79,7 @@ extern "C" { default one hour. This value can be overridden by the bootstrap parameter UNO_JAVA_JFW_INSTALL_EXPIRE (<b>DEPRECATED</b>). Setting this variable to 1000 means the settings file is only valid for 1000 seconds. - + <p>If one would not use UNO_JAVA_JFW_INSTALL_DATA during setup then most probably a user installation directory would be created in the home directory of root. This is because, java settings are determined and stored on behalf of the current user. In other @@ -89,11 +89,11 @@ extern "C" { only people with root rights can install OOo. Then one has to take care that the installer removes this file when uninstalling. </p> - + The content of this file is an implementation detail and may change in the future.</dd> </dl> - + <p>The values for these parameters must be file URLs and include the file name, for example:<br> file:///d:/MyApp/javavendors.xml<br> @@ -118,7 +118,7 @@ extern "C" { the bootrap parameter UNO_JAVA_JFW_CLASSPATH_URLS. The value contains of file URLs which must be separated by spaces.</p> - + <h2>Direct Mode</h2> <p>The direct mode is intended for a scenario where no configuration files @@ -128,7 +128,7 @@ extern "C" { For example, tools, such as regcomp, may use this framework in a build environment. Then one would want to use settings which have been specified by the build environment. The framework would automatically use the - current settings when they change in the environment. + current settings when they change in the environment. </p> <p> Here are examples how regcomp could be invoked using bootstrap parameters: @@ -174,7 +174,7 @@ extern "C" { causes the framework to use the environment variable CLASSPATH. If this variable and UNO_JAVA_JFW_CLASSPATH are set then the class path is composed from UNO_JAVA_JFW_CLASSPATH and the environment - variable CLASSPATH.</dd> + variable CLASSPATH.</dd> <dt>UNO_JAVA_JFW_PLUGIN</dt> <dd>Specified a file URL to a plugin library. If this variable is provided then a javavendors.xml is ignored. It must be provided if no @@ -189,22 +189,22 @@ extern "C" { escape characters. Thats why the Windows path contain double back-slashes. One should also take into account that a console may have also special escape characters.</p> - + <h2>What mode is used</h2> <p> The default mode is application mode. If at least one bootstrap parameter for the direct mode is provided then direct mode is used. </p> - <p> + <p> All settings made by this API are done for the current user if not - mentioned differently.</p> + mentioned differently.</p> <h2>Other bootstrap variables</h2> <dl> <dt>JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY</dt> - <dd>This is a unofficial variable which was introduced to workaround external issues. - It may be removed in the future. By setting it to 1, the framework will not try to - find out if the system is configured to use accessibility tools or if a JRE has an + <dd>This is a unofficial variable which was introduced to workaround external issues. + It may be removed in the future. By setting it to 1, the framework will not try to + find out if the system is configured to use accessibility tools or if a JRE has an accessibiliy bridge installed</dd> </dl> */ @@ -333,7 +333,7 @@ sal_Bool SAL_CALL jfw_areEqualJavaInfo( JavaInfo const * pInfoA,JavaInfo const * pInfoB); /** determines if a Java Virtual Machine is already running. - + <p>As long as the the office and the JREs only support one Virtual Machine per process the Java settings, particulary the selected Java, are not effective immediatly after changing when @@ -400,7 +400,7 @@ javaFrameworkError SAL_CALL jfw_isVMRunning(sal_Bool *bRunning); the first <code>JavaInfo</code> object from the list obtained by the first plug-in is used. If this plug-in does not find any JREs then the next plug-in is used, and so on.</p> - + @param ppInfo [out] a <code>JavaInfo</code> pointer, representing the selected JRE. The caller has to free it by calling <code>jfw_freeJavaInfo<code>. The @@ -462,13 +462,13 @@ javaFrameworkError SAL_CALL jfw_findAllJREs( The functions only checks if a JRE exists but does not modify any settings. To make the found JRE the "selected JRE" one has to call <code>jfw_setSelectedJRE</code>.</p> - + @param pPath [in] a file URL to a directory. @param pInfo [out] the <code>JavaInfo</code> object which represents a JRE found at the location specified by <code>pPath</code> - + @return JFW_E_NONE function ran successfully.<br/> JFW_E_INVALID_ARG at least on of the parameters was NULL<br/> @@ -522,7 +522,7 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath( [out] the <code>JavaVM</code> pointer. @param ppEnv [out] the <code>JNIenv</code> pointer. - + @return JFW_E_NONE function ran successfully.<br/> JFW_E_INVALID_ARG <code>ppVM</code>, <code>ppEnv</code> are NULL or @@ -645,14 +645,14 @@ javaFrameworkError SAL_CALL jfw_setEnabled(sal_Bool bEnabled); javaFrameworkError SAL_CALL jfw_getEnabled(sal_Bool *pbEnabled); /** determines parameters which are passed to VM during its creation. - + <p>The strings must be exactly as they are passed on the command line. For example, one could pass<br/> -Xdebug <br/> -Xrunjdw:transport=dt_socket,server=y,address=8000<br/> in order to enable debugging support. </p> - + @param arParameters [in] contains the arguments. It can be NULL if nSize is 0. @param nSize @@ -670,7 +670,7 @@ javaFrameworkError SAL_CALL jfw_setVMParameters( rtl_uString ** arArgs, sal_Int32 nSize); /** obtains the currently used start parameters. - + <p>The caller needs to free the returned array with <code>rtl_freeMemory</code>. The contained strings must be released with <code>rtl_uString_release</code>. @@ -682,7 +682,7 @@ javaFrameworkError SAL_CALL jfw_setVMParameters( @param pSize [out] on return contains the size of array returned in <code>parParameters</code> - + @return JFW_E_NONE function ran successfully.<br/> JFW_E_INVALIDARG parParameters or pSize are NULL<br/> @@ -704,7 +704,7 @@ javaFrameworkError SAL_CALL jfw_getVMParameters( @param pCP [in] the user class path. - + @return JFW_E_NONE function ran successfully.<br/> JFW_E_INVALIDARG pCP is NULL.<br/> @@ -718,7 +718,7 @@ javaFrameworkError SAL_CALL jfw_setUserClassPath(rtl_uString * pCP); <p>The function returns an empty string if no user class path is set. </p> - + @param ppCP [out] contains the user class path on return. If <code>*ppCP</code> was not NULL then the value is overwritten. No attempt at freeing that string @@ -748,7 +748,7 @@ javaFrameworkError SAL_CALL jfw_getUserClassPath(rtl_uString ** ppCP); </p> <p> Adding a path that is already stored causes no error.</p> - + @param sLocation [in] file URL to a directory which contains a JRE. @@ -802,7 +802,7 @@ javaFrameworkError SAL_CALL jfw_setJRELocations( [out] on return it contains the array of paths. @param pSize [out] on return it contains the size of the array <code>parLocations</code>. - + @return JFW_E_NONE function ran successfully.<br/> JFW_E_INVALIDARG parLocation is NULL or pSize is NULL.<br/> @@ -826,7 +826,7 @@ javaFrameworkError SAL_CALL jfw_getJRELocations( @param pp_exist [out] the parameter is set to either sal_True or sal_False. The value is only valid if the function returns JFW_E_NONE. - + @return JFW_E_NONE the function ran successfully.</br> JFW_E_ERROR an error occurred during execution.</br> @@ -858,7 +858,7 @@ void SAL_CALL jfw_lock(); <p>This function is called after <code>jfw_lock</code>. It allows other threads to use this API concurrently.</p> */ -void SAL_CALL jfw_unlock(); +void SAL_CALL jfw_unlock(); #ifdef __cplusplus diff --git a/jvmfwk/inc/jvmfwk/vendorplugin.h b/jvmfwk/inc/jvmfwk/vendorplugin.h index 3ccbb0e487f4..2fbfa44ba0a8 100644 --- a/jvmfwk/inc/jvmfwk/vendorplugin.h +++ b/jvmfwk/inc/jvmfwk/vendorplugin.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -100,7 +100,7 @@ typedef enum a vendor string. That is, the string it is not empty. @param sMinVersion [in] represents the minimum version of a JRE. The string can be empty but - a null pointer is not allowed. + a null pointer is not allowed. @param sMaxVersion [in] represents the maximum version of a JRE. The string can be empty but a null pointer is not allowed. @@ -115,7 +115,7 @@ typedef enum @param nSizeJavaInfo [out] the number of <code>JavaInfo</code> pointers contained in <code>parJavaInfo</code>. - + @return JFW_PLUGIN_E_NONE the function ran successfully.</br> JFW_PLUGIN_E_ERROR an error occurred during execution.</br> @@ -149,9 +149,9 @@ javaPluginError jfw_plugin_getAllJavaInfos( [in] a name of a vendor. This parameter always contains a vendor string. That is, the string it is not empty. @param sMinVersion - [in] represents the minimum version of a JRE. + [in] represents the minimum version of a JRE. @param sMaxVersion - [in] represents the maximum version of a JRE. + [in] represents the maximum version of a JRE. @param arExcludeList [in] contains a list of "bad" versions. JREs which have one of these versions must not be returned by this function. It can be NULL. @@ -206,7 +206,7 @@ javaPluginError jfw_plugin_getJavaInfoByPath( Therefore the functions which create the <code>JavaInfo</code> can store all necessary information which are needed for starting the VM into that structure. </p> - + @param pInfo [in] the JavaInfo object with information about the JRE. @param arOptions @@ -231,7 +231,7 @@ javaPluginError jfw_plugin_getJavaInfoByPath( by the JRE. */ javaPluginError jfw_plugin_startJavaVirtualMachine( - const JavaInfo *pInfo, + const JavaInfo *pInfo, const JavaVMOption *arOptions, sal_Int32 nSizeOptions, JavaVM ** ppVM, @@ -250,7 +250,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( @param pp_exist [out] the parameter is set to either sal_True or sal_False. The value is only valid if the function returns JFW_E_NONE. - + @return JFW_PLUGIN_E_NONE the function ran successfully.</br> JFW_PLUGIN_E_ERROR an error occurred during execution.</br> diff --git a/jvmfwk/inc/pch/precompiled_jvmfwk.cxx b/jvmfwk/inc/pch/precompiled_jvmfwk.cxx index 80c3bb3ee344..f0364dd413e2 100644 --- a/jvmfwk/inc/pch/precompiled_jvmfwk.cxx +++ b/jvmfwk/inc/pch/precompiled_jvmfwk.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/jvmfwk/inc/pch/precompiled_jvmfwk.hxx b/jvmfwk/inc/pch/precompiled_jvmfwk.hxx index 8b4018782e42..9b7cd9ddfa8f 100644 --- a/jvmfwk/inc/pch/precompiled_jvmfwk.hxx +++ b/jvmfwk/inc/pch/precompiled_jvmfwk.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx index 2c13780ad421..3f9fb9fca345 100644 --- a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx +++ b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -78,7 +78,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) return -1; } - + JavaInfo * pInfo = NULL; errcode = jfw_getSelectedJRE( & pInfo); @@ -92,7 +92,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) fprintf(stderr,"javaldx failed! \n"); return -1; } - + if (pInfo == NULL) { if (false == findAndSelect(&pInfo)) @@ -114,7 +114,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) return -1; } } - + //Only do something if the sunjavaplugin created this JavaInfo rtl::OUString sVendor1(RTL_CONSTASCII_USTRINGPARAM("Sun Microsystems Inc.")); rtl::OUString sVendor2(RTL_CONSTASCII_USTRINGPARAM("IBM Corporation")); @@ -133,11 +133,11 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) || sVendor7.equals(pInfo->sVendor) == sal_True || sVendor8.equals(pInfo->sVendor) == sal_True)) return 0; - + rtl::OString sPaths = getLD_LIBRARY_PATH(pInfo->arVendorData); fprintf(stdout, "%s\n", sPaths.getStr()); jfw_freeJavaInfo(pInfo); - + return 0; } diff --git a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java index b0930e1c93f3..28b67945ac78 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java +++ b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java @@ -30,8 +30,8 @@ public class JREProperties //#i44608. boolean bW98 = false; String os = System.getProperty("os.name"); - - if (os != null) + + if (os != null) { os = os.trim(); if (os.equalsIgnoreCase("Windows 98") || @@ -48,7 +48,7 @@ public class JREProperties if (bNoAccess == false && ! bW98) { try{ - //This line is needed to get the accessibility properties + //This line is needed to get the accessibility properties Toolkit tk = java.awt.Toolkit.getDefaultToolkit(); } catch(Throwable e) @@ -81,5 +81,5 @@ public class JREProperties } - + } diff --git a/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h b/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h index 6a8ef3232bc4..ae7796d94065 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h +++ b/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx index f97fba340cc4..4fb35d49c4af 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -79,7 +79,7 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props) { //get java.vendor, java.version, java.home, //javax.accessibility.assistive_technologies from system properties - + OUString sVendor; OUString sJavaLibraryPath; typedef vector<pair<OUString, OUString> >::const_iterator it_prop; @@ -164,11 +164,11 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props) // init m_sRuntimeLibrary OSL_ASSERT(m_sHome.getLength()); //call virtual function to get the possible paths to the runtime library. - + int size = 0; char const* const* arRtPaths = getRuntimePaths( & size); vector<OUString> libpaths = getVectorFromCharArray(arRtPaths, size); - + bool bRt = false; typedef vector<OUString>::const_iterator i_path; for(i_path ip = libpaths.begin(); ip != libpaths.end(); ip++) @@ -276,7 +276,7 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props) } if (bLdPath == false) return false; - + return true; } diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx index 413ff4bd1c38..80bca6c29628 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx index 9da3df2a2fdc..152d4431e8bc 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -93,7 +93,7 @@ char const* const* OtherInfo::getRuntimePaths(int * size) char const* const* OtherInfo::getLibraryPaths(int* size) { -#ifdef UNX +#ifdef UNX static char const * ar[] = { #ifdef MACOSX //mac version does not have a ld library path anymore @@ -121,7 +121,7 @@ char const* const* OtherInfo::getLibraryPaths(int* size) int OtherInfo::compareVersions(const rtl::OUString& /*sSecond*/) const { - //Need to provide an own algorithm for comparing version. + //Need to provide an own algorithm for comparing version. //Because this function returns always 0, which means the version of //this JRE and the provided version "sSecond" are equal, one cannot put //any excludeVersion entries in the javavendors.xml file. diff --git a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx index 9f54cf0ea5eb..7211ad11f679 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx index cff9cdfa05af..1ff9766af6c3 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -65,13 +65,13 @@ using namespace jfw_plugin; namespace { -struct PluginMutex: public ::rtl::Static<osl::Mutex, PluginMutex> {}; +struct PluginMutex: public ::rtl::Static<osl::Mutex, PluginMutex> {}; #if defined UNX OString getPluginJarPath( const OUString & sVendor, const OUString& sLocation, - const OUString& sVersion) + const OUString& sVersion) { OString ret; OUString sName1(RTL_CONSTASCII_USTRINGPARAM("javaplugin.jar")); @@ -83,7 +83,7 @@ OString getPluginJarPath( SunVersion ver150("1.5.0-ea"); SunVersion ver(sVersion); OSL_ASSERT(ver142 && ver150 && ver); - + OUString sName; if (ver < ver142) { @@ -116,12 +116,12 @@ OString getPluginJarPath( == osl_File_E_None) { sPath = sPath1 + OUString::createFromAscii(sep) + sPath2; - } + } } OSL_ASSERT(sPath.getLength()); } ret = rtl::OUStringToOString(sPath, osl_getThreadTextEncoding()); - + return ret; } #endif // UNX @@ -151,7 +151,7 @@ JavaInfo* createJavaInfo(const rtl::Reference<VendorBase> & info) buf.append(info->getLibraryPaths()); buf.appendAscii("\n"); } - + rtl::OUString sVendorData = buf.makeStringAndClear(); rtl::ByteSequence byteSeq( (sal_Int8*) sVendorData.pData->buffer, sVendorData.getLength() * sizeof(sal_Unicode)); @@ -159,7 +159,7 @@ JavaInfo* createJavaInfo(const rtl::Reference<VendorBase> & info) rtl_byte_sequence_acquire(pInfo->arVendorData); return pInfo; -} +} rtl::OUString getRuntimeLib(const rtl::ByteSequence & data) { @@ -169,7 +169,7 @@ rtl::OUString getRuntimeLib(const rtl::ByteSequence & data) //the runtime lib is on the first line sal_Int32 index = 0; rtl::OUString aToken = sData.getToken( 0, '\n', index); - + return aToken; } @@ -228,14 +228,14 @@ javaPluginError jfw_plugin_getAllJavaInfos( getAllJREInfos(); vector<rtl::Reference<VendorBase> > vecVerifiedInfos; - typedef vector<rtl::Reference<VendorBase> >::iterator it; + typedef vector<rtl::Reference<VendorBase> >::iterator it; for (it i= vecInfos.begin(); i != vecInfos.end(); i++) { const rtl::Reference<VendorBase>& cur = *i; - + if (ouVendor.equals(cur->getVendor()) == sal_False) continue; - + if (ouMinVer.getLength() > 0) { try @@ -249,11 +249,11 @@ javaPluginError jfw_plugin_getAllJavaInfos( JFW_ENSURE( 0,OUSTR("[Java framework]sunjavaplugin does not know version: ") + ouMinVer + OUSTR(" for vendor: ") + cur->getVendor() - + OUSTR(" .Check minimum Version.") ); + + OUSTR(" .Check minimum Version.") ); return JFW_PLUGIN_E_WRONG_VERSION_FORMAT; } } - + if (ouMaxVer.getLength() > 0) { try @@ -271,7 +271,7 @@ javaPluginError jfw_plugin_getAllJavaInfos( return JFW_PLUGIN_E_WRONG_VERSION_FORMAT; } } - + if (arExcludeList > 0) { bool bExclude = false; @@ -328,7 +328,7 @@ javaPluginError jfw_plugin_getJavaInfoByPath( JavaInfo ** ppInfo) { javaPluginError errcode = JFW_PLUGIN_E_NONE; - + OSL_ASSERT(path); OSL_ASSERT(sVendor); OSL_ASSERT(sMinVersion); @@ -345,7 +345,7 @@ javaPluginError jfw_plugin_getJavaInfoByPath( OSL_ASSERT( ! (arExcludeList == NULL && nLenList > 0)); if (arExcludeList == NULL && nLenList > 0) return JFW_PLUGIN_E_INVALID_ARG; - + OUString ouVendor(sVendor); OUString ouMinVer(sMinVersion); OUString ouMaxVer(sMaxVersion); @@ -353,15 +353,15 @@ javaPluginError jfw_plugin_getJavaInfoByPath( OSL_ASSERT(ouVendor.getLength() > 0); if (ouVendor.getLength() == 0) return JFW_PLUGIN_E_INVALID_ARG; - + rtl::Reference<VendorBase> aVendorInfo = getJREInfoByPath(ouPath); if (aVendorInfo.is() == sal_False) return JFW_PLUGIN_E_NO_JRE; - + //Check if the detected JRE matches the version requirements if (ouVendor.equals(aVendorInfo->getVendor()) == sal_False) return JFW_PLUGIN_E_NO_JRE; - + if (ouMinVer.getLength() > 0) { int nRes = 0; @@ -381,7 +381,7 @@ javaPluginError jfw_plugin_getJavaInfoByPath( if (nRes < 0) return JFW_PLUGIN_E_FAILED_VERSION; } - + if (ouMaxVer.getLength() > 0) { int nRes = 0; @@ -401,7 +401,7 @@ javaPluginError jfw_plugin_getJavaInfoByPath( if (nRes > 0) return JFW_PLUGIN_E_FAILED_VERSION; } - + if (arExcludeList > 0) { for (int i = 0; i < nLenList; i++) @@ -438,7 +438,7 @@ javaPluginError jfw_plugin_getJavaInfoByPath( */ extern "C" javaPluginError jfw_plugin_startJavaVirtualMachine( - const JavaInfo *pInfo, + const JavaInfo *pInfo, const JavaVMOption* arOptions, sal_Int32 cOptions, JavaVM ** ppVm, @@ -493,7 +493,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( typedef jint JNICALL JNI_CreateVM_Type(JavaVM **, JNIEnv **, void *); rtl::OUString sSymbolCreateJava( RTL_CONSTASCII_USTRINGPARAM("JNI_CreateJavaVM")); - + JNI_CreateVM_Type * pCreateJavaVM = (JNI_CreateVM_Type *) osl_getFunctionSymbol( moduleRt, sSymbolCreateJava.pData); if (!pCreateJavaVM) @@ -516,7 +516,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( boost::scoped_array<JavaVMOption> sarOptions( new JavaVMOption[cOptions + 1]); JavaVMOption * options = sarOptions.get(); - + // We set an abort handler which is called when the VM calls _exit during // JNI_CreateJavaVM. This happens when the LD_LIBRARY_PATH does not contain // all some directories of the Java installation. This is necessary for @@ -544,7 +544,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( } else { -#endif +#endif options[i+1].optionString = arOptions[i].optionString; options[i+1].extraInfo = arOptions[i].extraInfo; #ifdef UNX @@ -588,7 +588,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( // set err to a positive number, so as or recognize that an abort (longjmp) //occurred err= 1; - + if(err != 0) { rtl::OUString message; @@ -610,8 +610,8 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( *ppVm = pJavaVM; JFW_TRACE2("[Java framework] sunjavaplugin"SAL_DLLEXTENSION " has created a VM.\n"); } - - + + return errcode; } @@ -647,7 +647,7 @@ javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, sal_Bool *exist) { rtl::OUString sRuntimeLib = getRuntimeLib(pInfo->arVendorData); JFW_TRACE2(OUSTR("[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) diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.map b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.map index 901867f0a43d..c08817d69cff 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.map +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.map @@ -9,5 +9,5 @@ UDK_3_0_0 { UDK_3.1 { # OOo 3.3 global: - jfw_plugin_existJRE; + jfw_plugin_existJRE; } UDK_3_0_0; diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx index 81355dda210c..852c7cbfa638 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -85,14 +85,14 @@ char const* const* SunInfo::getRuntimePaths(int * size) char const* const* SunInfo::getLibraryPaths(int* size) { -#ifdef UNX +#ifdef UNX static char const * ar[] = { "/lib/" JFW_PLUGIN_ARCH "/client", #if defined(OPENBSD) "/lib/" JFW_PLUGIN_ARCH "/server", #endif - "/lib/" JFW_PLUGIN_ARCH "/native_threads", + "/lib/" JFW_PLUGIN_ARCH "/native_threads", "/lib/" JFW_PLUGIN_ARCH }; @@ -107,7 +107,7 @@ char const* const* SunInfo::getLibraryPaths(int* size) int SunInfo::compareVersions(const rtl::OUString& sSecond) const { OUString sFirst = getVersion(); - + SunVersion version1(sFirst); JFW_ENSURE(version1, OUSTR("[Java framework] sunjavaplugin"SAL_DLLEXTENSION " does not know the version: ") diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx index 5851b16c8143..f862a616b535 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx index 53051c905d41..5f71afbd42b0 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,9 +50,9 @@ class SelfTest public: SelfTest(); } test; -#endif +#endif -SunVersion::SunVersion(const rtl::OUString &usVer): +SunVersion::SunVersion(const rtl::OUString &usVer): m_nUpdateSpecial(0), m_preRelease(Rel_NONE), usVersion(usVer) { @@ -60,7 +60,7 @@ SunVersion::SunVersion(const rtl::OUString &usVer): rtl::OString sVersion= rtl::OUStringToOString(usVer, osl_getThreadTextEncoding()); m_bValid = init(sVersion.getStr()); } -SunVersion::SunVersion(const char * szVer): +SunVersion::SunVersion(const char * szVer): m_nUpdateSpecial(0), m_preRelease(Rel_NONE) { memset(m_arVersionParts, 0, sizeof(m_arVersionParts)); @@ -75,7 +75,7 @@ bool SunVersion::init(const char *szVersion) { if ( ! szVersion || strlen(szVersion) == 0) return false; - + //first get the major,minor,maintainance const char * pLast = szVersion; const char * pCur = szVersion; @@ -110,26 +110,26 @@ bool SunVersion::init(const char *szVersion) pCur + 1 == pEnd ? isdigit(*(pCur)) : 1) ) { int len = pCur - pLast; - if (len >= 127) + if (len >= 127) return false; strncpy(buf, pLast, len); buf[len] = 0; - pCur ++; + pCur ++; pLast = pCur; - + m_arVersionParts[nPart] = atoi(buf); nPart ++; nPartPos = 0; if (nPart == 3) break; - + //check next character - if (! ( (pCur < pEnd) + if (! ( (pCur < pEnd) && ( (nPart < 3) && isdigit(*pCur)))) //(*pCur >= 48 && *pCur <=57)))) - return false; + return false; } - else + else { return false; } @@ -183,9 +183,9 @@ bool SunVersion::init(const char *szVersion) if (pCur < pEnd) pCur ++; else - break; + break; } - } + } } // 1.4.1-ea else if (*(pCur - 1) == '-') @@ -193,7 +193,7 @@ bool SunVersion::init(const char *szVersion) m_preRelease = getPreRelease(pCur); if (m_preRelease == Rel_NONE) return false; -#if defined(FREEBSD) +#if defined(FREEBSD) if (m_preRelease == Rel_FreeBSD) { pCur++; //elemnate `p' @@ -207,7 +207,7 @@ bool SunVersion::init(const char *szVersion) m_nUpdateSpecial = atoi(buf)+100; //hack for FBSD #i56953# return true; } -#endif +#endif } else { @@ -247,7 +247,7 @@ SunVersion::PreRelease SunVersion::getPreRelease(const char *szRelease) #if defined (FREEBSD) else if (! strncmp(szRelease, "p", 1)) return Rel_FreeBSD; -#endif +#endif else return Rel_NONE; } @@ -261,14 +261,14 @@ SunVersion::~SunVersion() a) 1.0 < 1.1 b) 1.0 < 1.0.0 c) 1.0 < 1.0_00 - + returns false if both values are equal */ bool SunVersion::operator > (const SunVersion& ver) const { if( &ver == this) return false; - + //compare major.minor.maintainance for( int i= 0; i < 4; i ++) { @@ -284,13 +284,13 @@ bool SunVersion::operator > (const SunVersion& ver) const } //major.minor.maintainance_update are equal. test for a trailing char if (m_nUpdateSpecial > ver.m_nUpdateSpecial) - { + { return true; } //Until here the versions are equal //compare pre -release values - if ((m_preRelease == Rel_NONE && ver.m_preRelease == Rel_NONE) + if ((m_preRelease == Rel_NONE && ver.m_preRelease == Rel_NONE) || (m_preRelease != Rel_NONE && ver.m_preRelease == Rel_NONE)) return false; @@ -298,12 +298,12 @@ bool SunVersion::operator > (const SunVersion& ver) const return true; else if (m_preRelease > ver.m_preRelease) return true; - + return false; } bool SunVersion::operator < (const SunVersion& ver) const -{ +{ return (! operator > (ver)) && (! operator == (ver)); } @@ -336,7 +336,7 @@ SelfTest::SelfTest() char const * versions[] = {"1.4.0", "1.4.1", "1.0.0", "10.0.0", "10.10.0", "10.2.2", "10.10.0", "10.10.10", "111.0.999", "1.4.1_01", "9.90.99_09", "1.4.1_99", - "1.4.1_00a", + "1.4.1_00a", "1.4.1-ea", "1.4.1-beta", "1.4.1-rc1", "1.5.0_01-ea", "1.5.0_01-rc2"}; char const * badVersions[] = {".4.0", "..1", "", "10.0", "10.10.0.", "10.10.0-", "10.10.0.", @@ -359,10 +359,10 @@ SelfTest::SelfTest() { bRet = false; break; - } + } } OSL_ENSURE(bRet, "SunVersion selftest failed"); - //Parsing test (negative) + //Parsing test (negative) for ( int i = 0; i < numBad; i++) { SunVersion ver(badVersions[i]); @@ -394,7 +394,7 @@ SelfTest::SelfTest() { bRet = false; break; - } + } } else if ( i == j) { diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx index 4e51f7a0a7a6..448100bbc327 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,7 +31,7 @@ #include "rtl/ustring.hxx" -namespace jfw_plugin { +namespace jfw_plugin { // Define OSL_DEBUG_LEVEL >= 2 to run a test when this lib is loaded /* SunVersion is used to compare java versions based on a string, as taken @@ -46,7 +46,7 @@ namespace jfw_plugin { This class supports also a FreeBSD Java. This is currently necessary because it also has the vendor string "Sun Microsystems Inc.". - + An object acts as holder for the version string. That string may be present even if the version could not be parsed. Then the version may not be compatible to a SUN Java version. @@ -54,7 +54,7 @@ namespace jfw_plugin { An invalid object, that is, operator bool returns false, will always be the lower version in a comparison. If two invalid objects are compared then they are considered equal. - + To test if the version is ok, that is this object can be compared to others, use the bool conversion operator. */ @@ -104,7 +104,7 @@ public: /** Test if the version is compatible tu SUN's versioning scheme */ - operator bool (); + operator bool (); /** Will always contain a value if the object has been constructed with a version string. @@ -123,7 +123,7 @@ protected: PreRelease getPreRelease(const char *szRel); }; -} +} #endif // INCLUDED_JVMACCESS_SUNVERSION_HXX diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index 75c1a96de7bf..3612169e6ed3 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -74,11 +74,11 @@ using namespace std; namespace { char const *g_arJavaNames[] = { "", - "j2re", - "j2se", + "j2re", + "j2se", "j2sdk", "jdk", - "jre", + "jre", "java", "Home", "IBMJava2-ppc-142" @@ -87,11 +87,11 @@ char const *g_arJavaNames[] = { */ char const *g_arCollectDirs[] = { "", - "j2re/", - "j2se/", + "j2re/", + "j2se/", "j2sdk/", "jdk/", - "jre/", + "jre/", "java/", "jvm/" }; @@ -133,7 +133,7 @@ namespace { rtl::OUString getLibraryLocation() { - rtl::OUString libraryFileUrl; + rtl::OUString libraryFileUrl; OSL_VERIFY(osl::Module::getUrlFromAddress((void *)(sal_IntPtr)getLibraryLocation, libraryFileUrl)); return getDirFromFile(libraryFileUrl); } @@ -144,7 +144,7 @@ namespace { static rtl::Bootstrap aInstance(sIni); return & aInstance; - + } }; @@ -289,7 +289,7 @@ class AsynchReader: public Thread { size_t m_nDataSize; boost::scoped_array<sal_Char> m_arData; - + bool m_bError; bool m_bDone; FileHandleGuard m_aGuard; @@ -302,7 +302,7 @@ public: /** only call this function after this thread has finished. That is, call join on this instance and then call getData. - + */ OString getData(); #endif @@ -335,12 +335,12 @@ void AsynchReader::run() case osl_File_E_PIPE: //HACK! for windows nRead = 0; case osl_File_E_None: - break; + break; default: m_bError = true; return; } - + if (nRead == 0) { m_bDone = true; @@ -390,7 +390,7 @@ bool getJavaProps(const OUString & exePath, //that it calls java.awt.Toolkit.getDefaultToolkit(); OUString sValue; getBootstrap()->getFrom(OUSTR("JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY"), sValue); - + //prepare the arguments sal_Int32 cArgs = 3; OUString arg1 = OUString(RTL_CONSTASCII_USTRINGPARAM("-classpath"));// + sClassPath; @@ -405,7 +405,7 @@ bool getJavaProps(const OUString & exePath, args[3] = arg4.pData; cArgs = 4; } - + oslProcess javaProcess= 0; oslFileHandle fileOut= 0; oslFileHandle fileErr= 0; @@ -477,7 +477,7 @@ bool getJavaProps(const OUString & exePath, stderrReader.join(); JFW_TRACE2(OString("[Java framework] Java wrote to stderr:\" ") + stderrReader.getData() + OString(" \".\n")); - + TimeValue waitMax= {5 ,0}; procErr = osl_joinProcessWithTimeout(javaProcess, &waitMax); OSL_ASSERT(procErr == osl_Process_E_None); @@ -544,7 +544,7 @@ void createJavaInfoFromWinReg(std::vector<rtl::Reference<VendorBase> > & vecInfo } -bool getJavaInfoFromRegistry(const wchar_t* szRegKey, +bool getJavaInfoFromRegistry(const wchar_t* szRegKey, vector<OUString>& vecJavaHome) { HKEY hRoot; @@ -554,8 +554,8 @@ bool getJavaInfoFromRegistry(const wchar_t* szRegKey, DWORD dwIndex = 0; const DWORD BUFFSIZE = 1024; wchar_t bufVersion[BUFFSIZE]; -// char bufVersion[BUFFSIZE]; - DWORD nNameLen = BUFFSIZE; +// char bufVersion[BUFFSIZE]; + DWORD nNameLen = BUFFSIZE; FILETIME fileTime; nNameLen = sizeof(bufVersion); @@ -648,7 +648,7 @@ void bubbleSortVersion(vector<rtl::Reference<VendorBase> >& vec) // valid version //check if version of current is recognized, by comparing it with itself - try + try { cur->compareVersions(cur->getVersion()); } @@ -660,13 +660,13 @@ void bubbleSortVersion(vector<rtl::Reference<VendorBase> >& vec) if (nCmp == 0) { try - { + { nCmp = cur->compareVersions(next->getVersion()); } catch (MalformedVersionException & ) { //The second version is invalid, therefor it is regardes less. - nCmp = 1; + nCmp = 1; } } if(nCmp == 1) // cur > next @@ -722,7 +722,7 @@ bool getJREInfoFromBinPath( // jre/bin/jre -> jre/bin OUString sMapPath(i->getStr(), index); index = sBinPath.lastIndexOf(sMapPath); - if (index != -1 + if (index != -1 && (index + sMapPath.getLength() == sBinPath.getLength()) && sBinPath[index - 1] == '/') { @@ -764,7 +764,7 @@ vector<Reference<VendorBase> > getAllJREInfos() return vecInfos; } - + vector<OUString> getVectorFromCharArray(char const * const * ar, int size) { vector<OUString> vec; @@ -779,7 +779,7 @@ bool getJREInfoByPath(const rtl::OUString& path, std::vector<rtl::Reference<VendorBase> > & vecInfos) { bool ret = false; - + rtl::Reference<VendorBase> aInfo = getJREInfoByPath(path); if (aInfo.is()) { @@ -814,7 +814,7 @@ OUString resolveDirPath(const OUString & path) FileStatus status(FileStatusMask_Type | FileStatusMask_LinkTargetURL | FileStatusMask_FileURL); - + if (item.getFileStatus(status) == File::E_None && status.getFileType() == FileStatus::Directory) { @@ -826,7 +826,7 @@ OUString resolveDirPath(const OUString & path) return ret; } /** Checks if the path is a file. If it is a link to a file than - it is resolved. + it is resolved. */ OUString resolveFilePath(const OUString & path) { @@ -848,11 +848,11 @@ OUString resolveFilePath(const OUString & path) && status.getFileType() == FileStatus::Regular) { ret = sResolved; - } + } } else return OUString(); - + return ret; } @@ -873,7 +873,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( // If this path is invalid then there is no chance to find a JRE here if (sResolvedDir.getLength() == 0) return 0; - + //check if the directory path is good, that is a JRE was already recognized. //Then we need not detect it again //For example, a sun JKD contains <jdk>/bin/java and <jdk>/jre/bin/java. @@ -884,7 +884,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( if (entry2 != mapJREs.end()) { JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin"SAL_DLLEXTENSION ": ") - + OUSTR("JRE found again (detected before): ") + sResolvedDir + + OUSTR("JRE found again (detected before): ") + sResolvedDir + OUSTR(".\n")); return entry2->second; } @@ -905,7 +905,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( { //if the path is a link, then resolve it //check if the executable exists at all - + //path can be only "file:///". Then do not append a '/' //sizeof counts the terminating 0 OUString sFullPath; @@ -917,7 +917,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( sFilePath = resolveFilePath(sFullPath); - + if (sFilePath.getLength() == 0) { //The file path (to java exe) is not valid @@ -935,7 +935,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( if (entry != mapJREs.end()) { JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin"SAL_DLLEXTENSION ": ") - + OUSTR("JRE found again (detected before): ") + sFilePath + + OUSTR("JRE found again (detected before): ") + sFilePath + OUSTR(".\n")); return entry->second; @@ -962,7 +962,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( //then it tries to start a jdk/.../native_threads/.java_wrapper. Therefore the link, which //is named java, must be used to start the script. getJavaProps(sFullPath, props, & bProcessRun); - // Either we found a working 1.3.1 + // Either we found a working 1.3.1 //Or the java is broken. In both cases we stop searchin under this "root" directory bBreak = true; break; @@ -988,12 +988,12 @@ rtl::Reference<VendorBase> getJREInfoByPath( if (props.size() == 0) return rtl::Reference<VendorBase>(); - + //find java.vendor property typedef vector<pair<OUString, OUString> >::const_iterator c_ip; OUString sVendor(RTL_CONSTASCII_USTRINGPARAM("java.vendor")); OUString sVendorName; - + for (c_ip i = props.begin(); i != props.end(); i++) { if (sVendor.equals(i->first)) @@ -1002,9 +1002,9 @@ rtl::Reference<VendorBase> getJREInfoByPath( break; } } - + if (sVendorName.getLength() > 0) - { + { //find the creator func for the respective vendor name for ( sal_Int32 c = 0; gVendorMap[c].sVendorName != NULL; ++c ) @@ -1017,17 +1017,17 @@ rtl::Reference<VendorBase> getJREInfoByPath( break; } } - } + } if (ret.is() == false) vecBadPaths.push_back(sFilePath); else { JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin"SAL_DLLEXTENSION ": ") - + OUSTR("Found JRE: ") + sResolvedDir + + OUSTR("Found JRE: ") + sResolvedDir + OUSTR(" \n at: ") + path + OUSTR(".\n")); - + mapJREs.insert(MAPJRE::value_type(sResolvedDir, ret)); - mapJREs.insert(MAPJRE::value_type(sFilePath, ret)); + mapJREs.insert(MAPJRE::value_type(sFilePath, ret)); } return ret; @@ -1036,7 +1036,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( Reference<VendorBase> createInstance(createInstance_func pFunc, vector<pair<OUString, OUString> > properties) { - + Reference<VendorBase> aBase = (*pFunc)(); if (aBase.is()) { @@ -1137,7 +1137,7 @@ 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); + getJREInfoByPath(OUSTR("file:////usr/jdk/latest"), vecInfos); } #else @@ -1166,7 +1166,7 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos) arCollectDirs[d] = OUString(g_arCollectDirs[d], strlen(g_arCollectDirs[d]), RTL_TEXTENCODING_UTF8); - + OUString usFile(RTL_CONSTASCII_USTRINGPARAM("file:///")); for( int ii = 0; ii < cSearchPaths; ii ++) @@ -1224,7 +1224,7 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos) getJREInfoByPath(aStatus.getFileURL(),vecInfos); } - + JFW_ENSURE(errNext == File::E_None || errNext == File::E_NOENT, OUSTR("[Java framework] sunjavaplugin: " "Error while iterating over contens of ") @@ -1244,7 +1244,7 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos) { // /usr/java/j2re1.4.0 OUString usDir3(usDir2 + arNames[k]); - + DirectoryItem item3; if(DirectoryItem::get(usDir3, item) == File::E_None) { diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx index eedd51c16e33..ff54c00ce7c8 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -65,7 +65,7 @@ struct InfoFindSame { rtl::OUString sJava; InfoFindSame(const rtl::OUString& sJavaHome):sJava(sJavaHome){} - + bool operator () (const rtl::Reference<VendorBase> & aVendorInfo) { return aVendorInfo->getHome().equals(sJava) == sal_True ? true : false; diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx index fc11a040dce0..f3ca071b6baf 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -98,7 +98,7 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props) { //get java.vendor, java.version, java.home, //javax.accessibility.assistive_technologies from system properties - + OUString sVendor; typedef vector<pair<OUString, OUString> >::const_iterator it_prop; OUString sVendorProperty( @@ -114,7 +114,7 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props) bool bVendor = false; bool bHome = false; bool bAccess = false; - + typedef vector<pair<OUString, OUString> >::const_iterator it_prop; for (it_prop i = props.begin(); i != props.end(); i++) { @@ -158,15 +158,15 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props) } if (!bVersion || !bVendor || !bHome) return false; - + // init m_sRuntimeLibrary OSL_ASSERT(m_sHome.getLength()); //call virtual function to get the possible paths to the runtime library. - + int size = 0; char const* const* arRtPaths = getRuntimePaths( & size); vector<OUString> libpaths = getVectorFromCharArray(arRtPaths, size); - + bool bRt = false; typedef vector<OUString>::const_iterator i_path; for(i_path ip = libpaths.begin(); ip != libpaths.end(); ip++) @@ -215,7 +215,7 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props) } if (bLdPath == false) return false; - + return true; } @@ -272,7 +272,7 @@ int VendorBase::compareVersions(const rtl::OUString& /*sSecond*/) const } - + } diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx index ae204e227ac0..997793f8c8e6 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -81,11 +81,11 @@ class MalformedVersionException { public: MalformedVersionException(); - + MalformedVersionException(const MalformedVersionException &); - + virtual ~MalformedVersionException(); - + MalformedVersionException & operator =(const MalformedVersionException &); }; @@ -103,7 +103,7 @@ public: The paths are relative file URLs. That is, they always contain '/' even on windows. The paths are relative to the installation directory of a JRE. - + The signature of this function must correspond to getJavaExePaths_func. @@ -149,7 +149,7 @@ public: if so, needsRestart returns true. */ virtual bool needsRestart() const; - + /* compares versions of this vendor. MUST be overridden in a derived class. #################################################### @@ -159,7 +159,7 @@ public: 0 this.version == sSecond 1 this.version > sSecond -1 this.version < sSEcond - + @throw MalformedVersionException if the version string was not recognized. */ diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx index 44bfeed7c9bc..2d976b3e8da5 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -55,7 +55,7 @@ BEGIN_VENDOR_MAP() VENDOR_MAP_ENTRY("BEA Systems, Inc.", OtherInfo) VENDOR_MAP_ENTRY("Free Software Foundation, Inc.", GnuInfo) VENDOR_MAP_ENTRY("The FreeBSD Foundation", OtherInfo) -END_VENDOR_MAP() +END_VENDOR_MAP() Sequence<OUString> getVendorNames() @@ -75,7 +75,7 @@ bool isVendorSupported(const rtl::OUString& sVendor) Sequence<OUString> seqNames = getVendorNames(); const OUString * arNames = seqNames.getConstArray(); sal_Int32 count = seqNames.getLength(); - + for (int i = 0; i < count; i++) { if (sVendor.equals(arNames[i])) @@ -85,7 +85,7 @@ bool isVendorSupported(const rtl::OUString& sVendor) OString sVendorName = OUStringToOString(sVendor, osl_getThreadTextEncoding()); fprintf(stderr, "[Java frameworksunjavaplugin.so]sunjavaplugin does not support vendor: %s.\n", sVendorName.getStr()); -#endif +#endif return false; } diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx index f1987ef42961..dd021ad87779 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -56,7 +56,7 @@ struct VendorSupportMapEntry #define BEGIN_VENDOR_MAP() \ VendorSupportMapEntry gVendorMap[] ={ - + #define VENDOR_MAP_ENTRY(x,y) \ {x, & y::getJavaExePaths, & y::createInstance}, diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx index bd8c9678cf5f..a9829643e7c7 100644 --- a/jvmfwk/source/elements.cxx +++ b/jvmfwk/source/elements.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -113,7 +113,7 @@ void createSettingsStructure(xmlDoc * document, bool * bNeedsSave) //Get xsi:nil namespace xmlNs* nsXsi = xmlSearchNsByHref( document, root,(xmlChar*) NS_SCHEMA_INSTANCE); - + //<enabled xsi:nil="true" xmlNode * nodeEn = xmlNewTextChild( root,NULL, (xmlChar*) "enabled", (xmlChar*) ""); @@ -139,7 +139,7 @@ void createSettingsStructure(xmlDoc * document, bool * bNeedsSave) root,NULL, (xmlChar*) "vmParameters", (xmlChar*) ""); if (nodeVm == NULL) throw FrameworkException(JFW_E_ERROR, sExcMsg); - xmlSetNsProp(nodeVm,nsXsi,(xmlChar*) "nil",(xmlChar*) "true"); + xmlSetNsProp(nodeVm,nsXsi,(xmlChar*) "nil",(xmlChar*) "true"); //add a new line nodeCrLf = xmlNewText((xmlChar*) "\n"); xmlAddChild(root, nodeCrLf); @@ -160,13 +160,13 @@ void createSettingsStructure(xmlDoc * document, bool * bNeedsSave) if (nodeJava == NULL) throw FrameworkException(JFW_E_ERROR, sExcMsg); xmlSetNsProp(nodeJava,nsXsi,(xmlChar*) "nil",(xmlChar*) "true"); -// xmlSetProp(nodeJava,(xmlChar*) "autoSelect",(xmlChar*) "true"); +// xmlSetProp(nodeJava,(xmlChar*) "autoSelect",(xmlChar*) "true"); //add a new line nodeCrLf = xmlNewText((xmlChar*) "\n"); xmlAddChild(root, nodeCrLf); } - + //==================================================================== VersionInfo::VersionInfo(): arVersions(NULL) { @@ -207,7 +207,7 @@ sal_Int32 VersionInfo::getExcludeVersionSize() NodeJava::NodeJava(Layer layer): m_layer(layer) -{ +{ //This class reads and write to files which should only be done in //application mode if (getMode() == JFW_MODE_DIRECT) @@ -255,7 +255,7 @@ void NodeJava::load() { OSL_ASSERT("[Java framework] Unknown enum used."); } - + //Read the user elements rtl::OString sSettingsPath = getSettingsPath(); @@ -308,11 +308,11 @@ void NodeJava::load() cur, (xmlChar*) "nil", (xmlChar*) NS_SCHEMA_INSTANCE); if (sNil == NULL) throw FrameworkException(JFW_E_ERROR, sExcMsg); - + if (xmlStrcmp(sNil, (xmlChar*) "false") == 0) { - if (! m_javaInfo) - m_javaInfo = boost::optional<CNodeJavaInfo>(CNodeJavaInfo()); + if (! m_javaInfo) + m_javaInfo = boost::optional<CNodeJavaInfo>(CNodeJavaInfo()); m_javaInfo->loadFromNode(docUser, cur); } } @@ -430,7 +430,7 @@ void NodeJava::write() const CXPathObjectPtr pathObj; prepareSettingsDocument(); - + //Read the user elements rtl::OString sSettingsPath = getSettingsPath(); docUser = xmlParseFile(sSettingsPath.getStr()); @@ -443,7 +443,7 @@ void NodeJava::write() const xmlNode * root = xmlDocGetRootElement(docUser); //Get xsi:nil namespace - xmlNs* nsXsi = xmlSearchNsByHref(docUser, + xmlNs* nsXsi = xmlSearchNsByHref(docUser, root, (xmlChar*) NS_SCHEMA_INSTANCE); @@ -457,7 +457,7 @@ void NodeJava::write() const contextUser); if ( ! pathObj || xmlXPathNodeSetIsEmpty(pathObj->nodesetval)) throw FrameworkException(JFW_E_ERROR, sExcMsg); - + xmlNode * nodeEnabled = pathObj->nodesetval->nodeTab[0]; xmlSetNsProp(nodeEnabled, nsXsi, @@ -480,7 +480,7 @@ void NodeJava::write() const contextUser); if ( ! pathObj || xmlXPathNodeSetIsEmpty(pathObj->nodesetval)) throw FrameworkException(JFW_E_ERROR, sExcMsg); - + xmlNode * nodeEnabled = pathObj->nodesetval->nodeTab[0]; xmlSetNsProp(nodeEnabled, nsXsi, (xmlChar*) "nil",(xmlChar*) "false"); xmlNodeSetContent(nodeEnabled,(xmlChar*) CXmlCharPtr(*m_userClassPath)); @@ -490,7 +490,7 @@ void NodeJava::write() const if (m_javaInfo) { rtl::OString sExpression= rtl::OString( - "/jf:java/jf:javaInfo"); + "/jf:java/jf:javaInfo"); pathObj = xmlXPathEvalExpression((xmlChar*) sExpression.getStr(), contextUser); if ( ! pathObj || xmlXPathNodeSetIsEmpty(pathObj->nodesetval)) @@ -503,7 +503,7 @@ void NodeJava::write() const if (m_vmParameters) { rtl::OString sExpression= rtl::OString( - "/jf:java/jf:vmParameters"); + "/jf:java/jf:vmParameters"); pathObj = xmlXPathEvalExpression((xmlChar*) sExpression.getStr(), contextUser); if ( ! pathObj || xmlXPathNodeSetIsEmpty(pathObj->nodesetval)) @@ -544,7 +544,7 @@ void NodeJava::write() const if (m_JRELocations) { rtl::OString sExpression= rtl::OString( - "/jf:java/jf:jreLocations"); + "/jf:java/jf:jreLocations"); pathObj = xmlXPathEvalExpression((xmlChar*) sExpression.getStr(), contextUser); if ( ! pathObj || xmlXPathNodeSetIsEmpty(pathObj->nodesetval)) @@ -595,7 +595,7 @@ void NodeJava::setUserClassPath(const rtl::OUString & sClassPath) m_userClassPath = boost::optional<rtl::OUString>(sClassPath); } -void NodeJava::setJavaInfo(const JavaInfo * pInfo, bool bAutoSelect) +void NodeJava::setJavaInfo(const JavaInfo * pInfo, bool bAutoSelect) { if (!m_javaInfo) m_javaInfo = boost::optional<CNodeJavaInfo>(CNodeJavaInfo()); @@ -656,7 +656,7 @@ void NodeJava::setJRELocations(rtl_uString * * arLocations, sal_Int32 size) const rtl::OUString & sLocation = static_cast<rtl_uString*>(arLocations[i]); //only add the path if not already present - std::vector<rtl::OUString>::const_iterator it = + std::vector<rtl::OUString>::const_iterator it = std::find(m_JRELocations->begin(), m_JRELocations->end(), sLocation); if (it == m_JRELocations->end()) @@ -672,7 +672,7 @@ void NodeJava::addJRELocation(rtl_uString * sLocation) m_JRELocations = boost::optional<std::vector<rtl::OUString> >( std::vector<rtl::OUString> ()); //only add the path if not already present - std::vector<rtl::OUString>::const_iterator it = + std::vector<rtl::OUString>::const_iterator it = std::find(m_JRELocations->begin(), m_JRELocations->end(), rtl::OUString(sLocation)); if (it == m_JRELocations->end()) @@ -708,7 +708,7 @@ const boost::optional<CNodeJavaInfo> & NodeJava::getJavaInfo() const jfw::FileStatus NodeJava::checkSettingsFileStatus() const { jfw::FileStatus ret = FILE_DOES_NOT_EXIST; - + const rtl::OUString sURL = getSettingsURL(); //check the file time ::osl::DirectoryItem item; @@ -760,7 +760,7 @@ jfw::FileStatus NodeJava::checkSettingsFileStatus() const ret = FILE_OK; } } - else // osl_getSystemTime + else // osl_getSystemTime { ret = FILE_INVALID; } @@ -799,27 +799,27 @@ void NodeJava::createSettingsDocument() const // check if javasettings.xml already exist if (FILE_OK == checkSettingsFileStatus()) return; - + //make sure that the directories are created in case they do not exist FileBase::RC rcFile = Directory::createPath(getDirFromFile(sURL)); if (rcFile != FileBase::E_EXIST && rcFile != FileBase::E_None) throw FrameworkException(JFW_E_ERROR, sExcMsg); - + //javasettings.xml does not exist yet CXmlDocPtr doc(xmlNewDoc((xmlChar *)"1.0")); if (! doc) throw FrameworkException(JFW_E_ERROR, sExcMsg); //Create a comment xmlNewDocComment( - doc, (xmlChar *) "This is a generated file. Do not alter this file!"); - + doc, (xmlChar *) "This is a generated file. Do not alter this file!"); + //Create the root element and name spaces - xmlNodePtr root = xmlNewDocNode( + xmlNodePtr root = xmlNewDocNode( doc, NULL, (xmlChar *) "java", (xmlChar *) "\n"); if (root == NULL) throw FrameworkException(JFW_E_ERROR, sExcMsg); - + if (xmlNewNs(root, (xmlChar *) NS_JAVA_FRAMEWORK,NULL) == NULL) throw FrameworkException(JFW_E_ERROR, sExcMsg); if (xmlNewNs(root,(xmlChar*) NS_SCHEMA_INSTANCE,(xmlChar*)"xsi") == NULL) @@ -831,7 +831,7 @@ void NodeJava::createSettingsDocument() const (xmlChar *) "This is a generated file. Do not alter this file!"); if (com == NULL) throw FrameworkException(JFW_E_ERROR, sExcMsg); - + if (xmlAddPrevSibling(root, com) == NULL) throw FrameworkException(JFW_E_ERROR, sExcMsg); @@ -865,7 +865,7 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo) pJavaInfo, (xmlChar*) "nil", (xmlChar*) NS_SCHEMA_INSTANCE); if ( ! sNil) throw FrameworkException(JFW_E_ERROR, sExcMsg); - + if (xmlStrcmp(sNil, (xmlChar*) "true") == 0) bNil = true; else if (xmlStrcmp(sNil, (xmlChar*) "false") == 0) @@ -881,14 +881,14 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo) pJavaInfo, (xmlChar*) "autoSelect"); if ( ! sAutoSelect) throw FrameworkException(JFW_E_ERROR, sExcMsg); - + if (xmlStrcmp(sAutoSelect, (xmlChar*) "true") == 0) bAutoSelect = true; else if (xmlStrcmp(sAutoSelect, (xmlChar*) "false") == 0) bAutoSelect = false; else throw FrameworkException(JFW_E_ERROR, sExcMsg); - + xmlNode * cur = pJavaInfo->children; while (cur != NULL) @@ -940,7 +940,7 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo) //jvm of the new selected JRE will be started. Old settings (before //OOo 3.3) still contain the flag which can be safely ignored. nRequirements &= ~JFW_REQUIRE_NEEDRESTART; -#endif +#endif } else if (xmlStrcmp(cur->name, (xmlChar*) "vendorData") == 0) { @@ -971,7 +971,7 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo) void CNodeJavaInfo::writeToNode(xmlDoc* pDoc, xmlNode* pJavaInfoNode) const - + { OSL_ASSERT(pJavaInfoNode && pDoc); rtl::OString sExcMsg("[Java framework] Error in function NodeJavaInfo::writeToNode " @@ -992,7 +992,7 @@ void CNodeJavaInfo::writeToNode(xmlDoc* pDoc, //Set xsi:nil in javaInfo element to false //the xmlNs pointer must not be destroyed - xmlNs* nsXsi = xmlSearchNsByHref((xmlDoc*) pDoc, + xmlNs* nsXsi = xmlSearchNsByHref((xmlDoc*) pDoc, pJavaInfoNode, (xmlChar*) NS_SCHEMA_INSTANCE); @@ -1010,7 +1010,7 @@ void CNodeJavaInfo::writeToNode(xmlDoc* pDoc, xmlUnlinkNode(lastNode); xmlFreeNode(lastNode); } - + //If the JavaInfo was set with an empty value, //then we are done. if (m_bEmptyNode) @@ -1019,7 +1019,7 @@ void CNodeJavaInfo::writeToNode(xmlDoc* pDoc, //add a new line after <javaInfo> xmlNode * nodeCrLf = xmlNewText((xmlChar*) "\n"); xmlAddChild(pJavaInfoNode, nodeCrLf); - + //Create the vendor element xmlNewTextChild(pJavaInfoNode, NULL, (xmlChar*) "vendor", CXmlCharPtr(sVendor)); @@ -1033,14 +1033,14 @@ void CNodeJavaInfo::writeToNode(xmlDoc* pDoc, //add a new line for better readability nodeCrLf = xmlNewText((xmlChar*) "\n"); xmlAddChild(pJavaInfoNode, nodeCrLf); - + //Create the version element xmlNewTextChild(pJavaInfoNode, NULL, (xmlChar*) "version", CXmlCharPtr(sVersion)); //add a new line for better readability nodeCrLf = xmlNewText((xmlChar*) "\n"); xmlAddChild(pJavaInfoNode, nodeCrLf); - + //Create the features element rtl::OUString sFeatures = rtl::OUString::valueOf( (sal_Int64)nFeatures, 16); @@ -1049,7 +1049,7 @@ void CNodeJavaInfo::writeToNode(xmlDoc* pDoc, //add a new line for better readability nodeCrLf = xmlNewText((xmlChar*) "\n"); xmlAddChild(pJavaInfoNode, nodeCrLf); - + //Create the requirements element rtl::OUString sRequirements = rtl::OUString::valueOf( @@ -1059,7 +1059,7 @@ void CNodeJavaInfo::writeToNode(xmlDoc* pDoc, //add a new line for better readability nodeCrLf = xmlNewText((xmlChar*) "\n"); xmlAddChild(pJavaInfoNode, nodeCrLf); - + //Create the features element rtl::ByteSequence data = encodeBase16(arVendorData); @@ -1105,11 +1105,11 @@ MergedSettings::MergedSettings(): { NodeJava settings(NodeJava::USER_OR_INSTALL); settings.load(); - + //Check if UNO_JAVA_JFW_INSTALL_DATA is set. If so, then we need not use user and //shared data. const ::rtl::OUString sInstall = BootParams::getInstallData(); - + if (sInstall.getLength() == 0) { NodeJava sharedSettings(NodeJava::SHARED); @@ -1171,7 +1171,7 @@ const rtl::OUString& MergedSettings::getUserClassPath() const typedef ::std::vector< ::rtl::OUString>::const_iterator cit; for (cit i = m_vmParams.begin(); i < m_vmParams.end(); i++) { - ret.push_back( ::rtl::OUStringToOString(*i, RTL_TEXTENCODING_UTF8)); + ret.push_back( ::rtl::OUStringToOString(*i, RTL_TEXTENCODING_UTF8)); } return ret; } @@ -1197,12 +1197,12 @@ void MergedSettings::getVmParametersArray( { osl::MutexGuard guard(FwkMutex::get()); OSL_ASSERT(parParams != NULL && size != NULL); - + *parParams = (rtl_uString **) rtl_allocateMemory(sizeof(rtl_uString*) * m_vmParams.size()); if (*parParams == NULL) return; - + int j=0; typedef std::vector<rtl::OUString>::const_iterator it; for (it i = m_vmParams.begin(); i != m_vmParams.end(); @@ -1219,12 +1219,12 @@ void MergedSettings::getJRELocations( { osl::MutexGuard guard(FwkMutex::get()); OSL_ASSERT(parLocations != NULL && size != NULL); - + *parLocations = (rtl_uString **) rtl_allocateMemory(sizeof(rtl_uString*) * m_JRELocations.size()); if (*parLocations == NULL) return; - + int j=0; typedef std::vector<rtl::OUString>::const_iterator it; for (it i = m_JRELocations.begin(); i != m_JRELocations.end(); diff --git a/jvmfwk/source/elements.hxx b/jvmfwk/source/elements.hxx index 93aec47718e1..4641d3bbee14 100644 --- a/jvmfwk/source/elements.hxx +++ b/jvmfwk/source/elements.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -137,7 +137,7 @@ private: (UNO_JAVA_JFW_USER_DATA, UNO_JAVA_JFW_SHARED_DATA, UNO_JAVA_JFW_INSTALL_DATA) and m_layer, unless the file already exists (see createSettingsDocument). - + @return JFW_E_CONFIG_READWRITE */ @@ -146,7 +146,7 @@ private: /** helper function for prepareSettingsDocument. */ void createSettingsDocument() const; - + /** returns the system path to the data file which is to be used. The value depends on the the member m_layer and the bootstrap paramters UNO_JAVA_JFW_USER_DATA, @@ -155,7 +155,7 @@ private: ::rtl::OString getSettingsPath() const; /** returns the file URL to the data file which is to be used. See getSettingsPath. - */ + */ ::rtl::OUString getSettingsURL() const; /** Verifies if the respective settings file exist. In case UNO_JAVA_JFW_INSTALL_DATA @@ -163,7 +163,7 @@ private: exist and wipe its contents. Then still FILE_DOES_NOT_EXIST is returned. */ jfw::FileStatus checkSettingsFileStatus() const; - + /** Determines the layer for which the instance the loads and writes the data. */ @@ -265,8 +265,8 @@ public: }; /** merges the settings for shared, user and installation during construction. - The class uses a simple merge mechanism for the javasettings.xml files in share and - user. The following elements completly overwrite the corresponding elements + The class uses a simple merge mechanism for the javasettings.xml files in share and + user. The following elements completly overwrite the corresponding elements from share: /java/enabled /java/userClassPath @@ -300,7 +300,7 @@ private: ::std::vector< ::rtl::OUString> m_vmParams; ::std::vector< ::rtl::OUString> m_JRELocations; - + CNodeJavaInfo m_javaInfo; public: @@ -358,7 +358,7 @@ public: ~VersionInfo(); void addExcludeVersion(const ::rtl::OUString& sVersion); - + ::rtl::OUString sMinVersion; ::rtl::OUString sMaxVersion; @@ -366,7 +366,7 @@ public: does not need to release the strings. The array exists as long as this object exists. */ - + rtl_uString** getExcludeVersions(); sal_Int32 getExcludeVersionSize(); }; diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx index 3c353e44491e..5c1364c4d7eb 100644 --- a/jvmfwk/source/framework.cxx +++ b/jvmfwk/source/framework.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -98,7 +98,7 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi const jfw::MergedSettings settings; const std::vector<rtl::OUString>& vecJRELocations = settings.getJRELocations(); - //Use every plug-in library to get Java installations. + //Use every plug-in library to get Java installations. typedef std::vector<jfw::PluginLibrary>::const_iterator ci_pl; int cModule = 0; for (ci_pl i = vecPlugins.begin(); i != vecPlugins.end(); i++, cModule++) @@ -114,7 +114,7 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi rtl::OString msg = rtl::OUStringToOString( library.sPath, osl_getThreadTextEncoding()); fprintf(stderr,"[jvmfwk] Could not load plugin %s\n" \ - "Modify the javavendors.xml accordingly!\n", msg.getStr()); + "Modify the javavendors.xml accordingly!\n", msg.getStr()); return JFW_E_NO_PLUGIN; } jfw_plugin_getAllJavaInfos_ptr getAllJavaFunc = @@ -136,7 +136,7 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi versionInfo.getExcludeVersions(), versionInfo.getExcludeVersionSize(), & arInfos, - & cInfos); + & cInfos); if (plerr != JFW_PLUGIN_E_NONE) return JFW_E_ERROR; @@ -162,8 +162,8 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi for (citLoc ii = vecJRELocations.begin(); ii != vecJRELocations.end(); ii++) { -// rtl::OUString sLocation = -// rtl::OStringToOUString(*ii, RTL_TEXTENCODING_UTF8); +// rtl::OUString sLocation = +// rtl::OStringToOUString(*ii, RTL_TEXTENCODING_UTF8); jfw::CJavaInfo aInfo; plerr = (*jfw_plugin_getJavaInfoByPathFunc)( ii->pData, @@ -213,7 +213,7 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi //vecInfoManual2 for (it_info j = vecInfo.begin(); j != vecInfo.end(); j++) { - it_info it_duplicate = + it_info it_duplicate = std::find_if(vecInfoManual2.begin(), vecInfoManual2.end(), std::bind2nd(std::ptr_fun(areEqualJavaInfo), *j)); if (it_duplicate != vecInfoManual2.end()) @@ -234,7 +234,7 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi //Add the manually detected JREs for (it l = vecInfoManual2.begin(); l != vecInfoManual2.end(); l++) (*pparInfo)[index++] = l->detach(); - + *pSize = nSize; return errcode; } @@ -265,7 +265,7 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti //been created. if (g_pJavaVM != NULL) return JFW_E_RUNNING_JVM; - + if (ppVM == NULL) return JFW_E_INVALID_ARG; @@ -304,7 +304,7 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti //without accessibility support. We return JFW_E_NO_SELECT //to cause that we search for another JRE. The search code will //then prefer a JRE with accessibility support. - return JFW_E_NO_SELECT; + return JFW_E_NO_SELECT; } } } @@ -314,7 +314,7 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti if (sVendorUpdate != settings.getJavaInfoAttrVendorUpdate()) return JFW_E_INVALID_SETTINGS; - + //check if JAVA is disabled //If Java is enabled, but it was disabled when this process was started // then no preparational work, such as setting the LD_LIBRARY_PATH, was @@ -322,7 +322,7 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti if (g_bEnabledSwitchedOn && (aInfo->nRequirements & JFW_REQUIRE_NEEDRESTART)) return JFW_E_NEED_RESTART; - + //Check if the selected Java was set in this process. If so it //must not have the requirments flag JFW_REQUIRE_NEEDRESTART if ((aInfo->nRequirements & JFW_REQUIRE_NEEDRESTART) @@ -341,12 +341,12 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti //In direct mode the options are specified by bootstrap variables //of the form UNO_JAVA_JFW_PARAMETER_1 .. UNO_JAVA_JFW_PARAMETER_n vmParams = jfw::BootParams::getVMParameters(); - sUserClassPath = + sUserClassPath = "-Djava.class.path=" + jfw::BootParams::getClasspath(); } else OSL_ASSERT(0); - + //get the function jfw_plugin_startJavaVirtualMachine jfw::VendorSettings aVendorSettings; rtl::OUString sLibPath = aVendorSettings.getPluginLibrary(aInfo.getVendor()); @@ -371,7 +371,7 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti JavaVMOption * arOpt = sarJOptions.get(); if (! arOpt) return JFW_E_ERROR; - + //The first argument is the classpath arOpt[0].optionString= (char*) sUserClassPath.getStr(); arOpt[0].extraInfo = NULL; @@ -397,7 +397,7 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti arOpt[index].extraInfo = arOptions[ii].extraInfo; index++; } - + //start Java JavaVM *pVm = NULL; javaPluginError plerr = (*pFunc)(aInfo, arOpt, index, & pVm, ppEnv); @@ -422,7 +422,7 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti fprintf(stderr, "%s\n", e.message.getStr()); OSL_ENSURE(0, e.message.getStr()); } - + return errcode; #endif } @@ -447,7 +447,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) bool bSupportAccessibility = jfw::isAccessibilitySupportDesired(); nFeatureFlags = bSupportAccessibility ? JFW_FEATURE_ACCESSBRIDGE : 0L; - + //Get a list of services which provide Java information jfw::VendorSettings aVendorSettings; std::vector<jfw::PluginLibrary> vecPlugins = @@ -457,7 +457,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) boost::scoped_array<osl::Module> sarModules; sarModules.reset(new osl::Module[vecPlugins.size()]); osl::Module * arModules = sarModules.get(); - + //Use every plug-in library to get Java installations. At the first usable //Java the loop will break typedef std::vector<jfw::PluginLibrary>::const_iterator ci_pl; @@ -492,7 +492,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) versionInfo.getExcludeVersions(), versionInfo.getExcludeVersionSize(), & arInfos, - & cInfos); + & cInfos); if (plerr != JFW_PLUGIN_E_NONE) continue; @@ -514,14 +514,14 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) // compare features // If the user does not require any features (nFeatureFlags = 0) // then the first installation is used - if ((pJInfo->nFeatures & nFeatureFlags) == nFeatureFlags) + if ((pJInfo->nFeatures & nFeatureFlags) == nFeatureFlags) { //the just found Java implements all required features //currently there is only accessibility!!! aCurrentInfo = pJInfo; bInfoFound = true; break; - } + } } //The array returned by jfw_plugin_getAllJavaInfos must be freed as well as //its contents @@ -563,7 +563,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) OSL_ASSERT(jfw_plugin_getJavaInfoByPathFunc); if (jfw_plugin_getJavaInfoByPathFunc == NULL) return JFW_E_ERROR; - + typedef std::vector<rtl::OUString>::const_iterator citLoc; for (citLoc it = vecJRELocations.begin(); it != vecJRELocations.end(); it++) @@ -592,7 +592,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) // compare features // If the user does not require any features (nFeatureFlags = 0) // then the first installation is used - if ((aInfo.getFeatures() & nFeatureFlags) == nFeatureFlags) + if ((aInfo.getFeatures() & nFeatureFlags) == nFeatureFlags) { //the just found Java implements all required features //currently there is only accessibility!!! @@ -618,7 +618,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) *pInfo = aCurrentInfo.cloneJavaInfo(); //remember that this JRE was selected in this process jfw::setJavaSelected(); - } + } } else { @@ -631,7 +631,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) fprintf(stderr, "%s\n", e.message.getStr()); OSL_ENSURE(0, e.message.getStr()); } - + return errcode; } sal_Bool SAL_CALL jfw_areEqualJavaInfo( @@ -697,7 +697,7 @@ javaFrameworkError SAL_CALL jfw_getSelectedJRE(JavaInfo **ppInfo) return JFW_E_NONE; } - const jfw::MergedSettings settings; + const jfw::MergedSettings settings; jfw::CJavaInfo aInfo; aInfo.attach(settings.createJavaInfo()); if (! aInfo) @@ -709,7 +709,7 @@ javaFrameworkError SAL_CALL jfw_getSelectedJRE(JavaInfo **ppInfo) //Java is not valid anymore // /java/javaInfo/@vendorUpdate != javaSelection/updated (javavendors.xml) rtl::OString sUpdated = jfw::getElementUpdated(); - + if (sUpdated.equals(settings.getJavaInfoAttrVendorUpdate()) == sal_False) return JFW_E_INVALID_SETTINGS; *ppInfo = aInfo.detach(); @@ -758,7 +758,7 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath( typedef std::vector<rtl::OUString>::const_iterator CIT_VENDOR; std::vector<rtl::OUString> vecVendors = aVendorSettings.getSupportedVendors(); - + //Use every plug-in library to determine if the path represents a //JRE. If a plugin recognized it then the loop will break typedef std::vector<jfw::PluginLibrary>::const_iterator ci_pl; @@ -776,7 +776,7 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath( rtl::OString msg = rtl::OUStringToOString( library.sPath, osl_getThreadTextEncoding()); fprintf(stderr,"[jvmfwk] Could not load plugin %s\n" \ - "Modify the javavendors.xml accordingly!\n", msg.getStr()); + "Modify the javavendors.xml accordingly!\n", msg.getStr()); return JFW_E_NO_PLUGIN; } @@ -800,7 +800,7 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath( versionInfo.getExcludeVersions(), versionInfo.getExcludeVersionSize(), & pInfo); - + if (plerr == JFW_PLUGIN_E_NONE) { //check if the vendor of the found JRE is supported @@ -848,7 +848,7 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath( fprintf(stderr, "%s\n", e.message.getStr()); OSL_ENSURE(0, e.message.getStr()); } - + return errcode; } @@ -866,7 +866,7 @@ javaFrameworkError SAL_CALL jfw_setSelectedJRE(JavaInfo const *pInfo) errcode = jfw_getSelectedJRE( & currentInfo); if (errcode != JFW_E_NONE && errcode != JFW_E_INVALID_SETTINGS) return errcode; - + if (jfw_areEqualJavaInfo(currentInfo, pInfo) == sal_False) { jfw::NodeJava node; @@ -892,7 +892,7 @@ javaFrameworkError SAL_CALL jfw_setEnabled(sal_Bool bEnabled) osl::MutexGuard guard(jfw::FwkMutex::get()); if (jfw::getMode() == jfw::JFW_MODE_DIRECT) return JFW_E_DIRECT_MODE; - + if (g_bEnabledSwitchedOn == false && bEnabled == sal_True) { //When the process started then Enabled was false. @@ -1057,9 +1057,9 @@ javaFrameworkError SAL_CALL jfw_addJRELocation(rtl_uString * sLocation) fprintf(stderr, "%s\n", e.message.getStr()); OSL_ENSURE(0, e.message.getStr()); } - + return errcode; - + } javaFrameworkError SAL_CALL jfw_setJRELocations( @@ -1096,7 +1096,7 @@ javaFrameworkError SAL_CALL jfw_getJRELocations( osl::MutexGuard guard(jfw::FwkMutex::get()); if (jfw::getMode() == jfw::JFW_MODE_DIRECT) return JFW_E_DIRECT_MODE; - + if (parLocations == NULL || pLen == NULL) return JFW_E_INVALID_ARG; const jfw::MergedSettings settings; @@ -1108,8 +1108,8 @@ javaFrameworkError SAL_CALL jfw_getJRELocations( fprintf(stderr, "%s\n", e.message.getStr()); OSL_ENSURE(0, e.message.getStr()); } - - return errcode; + + return errcode; } @@ -1211,7 +1211,7 @@ JavaInfo * CJavaInfo::copyJavaInfo(const JavaInfo * pInfo) (JavaInfo*) rtl_allocateMemory(sizeof(JavaInfo)); if (newInfo) { - rtl_copyMemory(newInfo, pInfo, sizeof(JavaInfo)); + rtl_copyMemory(newInfo, pInfo, sizeof(JavaInfo)); rtl_uString_acquire(pInfo->sVendor); rtl_uString_acquire(pInfo->sLocation); rtl_uString_acquire(pInfo->sVersion); diff --git a/jvmfwk/source/framework.hxx b/jvmfwk/source/framework.hxx index 89859d4806ed..086906251a68 100644 --- a/jvmfwk/source/framework.hxx +++ b/jvmfwk/source/framework.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -59,14 +59,14 @@ typedef javaPluginError (*jfw_plugin_getJavaInfoByPath_ptr)( </p> */ typedef javaPluginError (*jfw_plugin_startJavaVirtualMachine_ptr)( - const JavaInfo *info, - const JavaVMOption* options, + const JavaInfo *info, + const JavaVMOption* options, sal_Int32 cOptions, JavaVM ** ppVM, JNIEnv ** ppEnv); typedef javaPluginError (*jfw_plugin_existJRE_ptr)( - const JavaInfo *info, + const JavaInfo *info, sal_Bool *exist); @@ -86,8 +86,8 @@ class CJavaInfo public: ::JavaInfo * pInfo; - - + + CJavaInfo(); CJavaInfo(const CJavaInfo &); ~CJavaInfo(); @@ -106,7 +106,7 @@ public: const ::JavaInfo* operator ->() const; // ::JavaInfo** operator & (); operator ::JavaInfo* (); - operator ::JavaInfo const * () const; + operator ::JavaInfo const * () const; ::JavaInfo* cloneJavaInfo() const; rtl::OUString getVendor() const; diff --git a/jvmfwk/source/framework.map b/jvmfwk/source/framework.map index c95cc83aa826..4f5b3381d993 100644 --- a/jvmfwk/source/framework.map +++ b/jvmfwk/source/framework.map @@ -8,7 +8,7 @@ UDK_3_0_0 { jfw_startVM; jfw_isVMRunning; jfw_getJavaInfoByPath; - jfw_setSelectedJRE; + jfw_setSelectedJRE; jfw_getSelectedJRE; jfw_setEnabled; jfw_getEnabled; @@ -20,7 +20,7 @@ UDK_3_0_0 { jfw_getJRELocations; jfw_addJRELocation; jfw_lock; - jfw_unlock; + jfw_unlock; local: *; }; diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx index aab2201ee07d..ecc60eb2190e 100644 --- a/jvmfwk/source/fwkbase.cxx +++ b/jvmfwk/source/fwkbase.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -131,7 +131,7 @@ VendorSettings::VendorSettings(): JFW_E_ERROR, OString("[Java framework] Error while parsing file: ") + sSettingsPath + OString(".")); - + m_xmlPathContextVendorSettings = xmlXPathNewContext(m_xmlDocVendorSettings); int res = xmlXPathRegisterNs( m_xmlPathContextVendorSettings, (xmlChar*) "jf", @@ -145,7 +145,7 @@ std::vector<PluginLibrary> VendorSettings::getPluginData() { OString sExcMsg("[Java framework] Error in function VendorSettings::getVendorPluginURLs " "(fwkbase.cxx)."); - std::vector<PluginLibrary> vecPlugins; + std::vector<PluginLibrary> vecPlugins; CXPathObjectPtr result(xmlXPathEvalExpression( (xmlChar*)"/jf:javaSelection/jf:plugins/jf:library", m_xmlPathContextVendorSettings)); @@ -180,7 +180,7 @@ std::vector<PluginLibrary> VendorSettings::getPluginData() "[Java framework] The file: " + sPlugin + " does not exist."); } plugin.sPath = sUrl; - + vecPlugins.push_back(plugin); } cur = cur->next; @@ -195,11 +195,11 @@ VersionInfo VendorSettings::getVersionInformation(const rtl::OUString & sVendor) OString osVendor = OUStringToOString(sVendor, RTL_TEXTENCODING_UTF8); //Get minVersion OString sExpresion = OString( - "/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") + + "/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") + osVendor + OString("\"]/jf:minVersion"); - + CXPathObjectPtr xPathObjectMin; - xPathObjectMin = + xPathObjectMin = xmlXPathEvalExpression((xmlChar*) sExpresion.getStr(), m_xmlPathContextVendorSettings); if (xmlXPathNodeSetIsEmpty(xPathObjectMin->nodesetval)) @@ -218,7 +218,7 @@ VersionInfo VendorSettings::getVersionInformation(const rtl::OUString & sVendor) } //Get maxVersion - sExpresion = OString("/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") + + sExpresion = OString("/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") + osVendor + OString("\"]/jf:maxVersion"); CXPathObjectPtr xPathObjectMax; xPathObjectMax = xmlXPathEvalExpression( @@ -240,7 +240,7 @@ VersionInfo VendorSettings::getVersionInformation(const rtl::OUString & sVendor) } //Get excludeVersions - sExpresion = OString("/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") + + sExpresion = OString("/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") + osVendor + OString("\"]/jf:excludeVersions/jf:version"); CXPathObjectPtr xPathObjectVersions; xPathObjectVersions = @@ -282,7 +282,7 @@ std::vector<OUString> VendorSettings::getSupportedVendors() throw FrameworkException( JFW_E_ERROR, rtl::OString("[Java framework] Error in function getSupportedVendors (fwkutil.cxx).")); - + //get the values of the library elements + vendor attribute xmlNode* cur = result->nodesetval->nodeTab[0]; while (cur != NULL) @@ -394,7 +394,7 @@ rtl::OString BootParams::getClasspath() UNO_JAVA_JFW_CLASSPATH " = %s.\n", sClassPath.getStr()); #endif } - + rtl::OUString sEnvCP; if (Bootstrap::get()->getFrom( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_JAVA_JFW_ENV_CLASSPATH)), @@ -513,7 +513,7 @@ rtl::OUString BootParams::getJREHome() fprintf(stderr,"[Java framework] Using bootstrap parameter " UNO_JAVA_JFW_JREHOME" = %s.\n", sValue.getStr()); } -#endif +#endif return sJRE; } @@ -604,7 +604,7 @@ JFW_MODE getMode() g_mode = JFW_MODE_APPLICATION; g_bMode = true; } - + return g_mode; } @@ -647,11 +647,11 @@ rtl::OString makeClassPathOption(OUString const & sUserClassPath) rtl::OString sPaths; rtl::OUStringBuffer sBufCP(4096); char szSep[] = {SAL_PATHSEPARATOR,0}; - + // append all user selected jars to the class path if (sUserClassPath.getLength() > 0) sBufCP.append(sUserClassPath); - + //append all jar libraries and components to the class path OUString sAppCP = getApplicationClassPath(); if (sAppCP.getLength()) @@ -660,10 +660,10 @@ rtl::OString makeClassPathOption(OUString const & sUserClassPath) sBufCP.appendAscii(szSep); sBufCP.append(sAppCP); } - + sPaths = rtl::OUStringToOString( sBufCP.makeStringAndClear(), osl_getThreadTextEncoding()); - + rtl::OString sOptionClassPath("-Djava.class.path="); sOptionClassPath += sPaths; return sOptionClassPath; diff --git a/jvmfwk/source/fwkbase.hxx b/jvmfwk/source/fwkbase.hxx index 0a15f7628e8e..49dd2257889a 100644 --- a/jvmfwk/source/fwkbase.hxx +++ b/jvmfwk/source/fwkbase.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,7 +42,7 @@ public: VendorSettings(); /** Gets all plugin library URLs with the corresponding vendor name. - + It uses the /javaSelection/plugins/library element from the javavendors.xml to locate the library. Is is verified that the plug-in exist. If a plug-in does not exist then an @@ -56,7 +56,7 @@ public: VersionInfo getVersionInformation(const ::rtl::OUString & sVendor); - ::std::vector< ::rtl::OUString> getSupportedVendors(); + ::std::vector< ::rtl::OUString> getSupportedVendors(); }; /* The class offers functions to retrieve verified bootstrap parameters. @@ -70,7 +70,7 @@ namespace BootParams In direct mode either of them must be set. If not an exception is thrown. */ ::rtl::OUString getJREHome(); - + ::std::vector< ::rtl::OString> getVMParameters(); ::rtl::OUString getUserData(); diff --git a/jvmfwk/source/fwkutil.cxx b/jvmfwk/source/fwkutil.cxx index 63402bef98d4..eee75cd8d21a 100644 --- a/jvmfwk/source/fwkutil.cxx +++ b/jvmfwk/source/fwkutil.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -45,7 +45,7 @@ #include "osl/module.hxx" #include "osl/thread.hxx" #include "rtl/ustring.hxx" -#include "rtl/ustrbuf.hxx" +#include "rtl/ustrbuf.hxx" #include "rtl/bootstrap.hxx" #include "osl/file.hxx" #include "osl/process.h" @@ -83,7 +83,7 @@ bool isAccessibilitySupportDesired() DWORD dwType = 0; DWORD dwLen = 16; unsigned char arData[16]; - if( RegQueryValueEx(hKey, "SupportAssistiveTechnology", NULL, &dwType, arData, + if( RegQueryValueEx(hKey, "SupportAssistiveTechnology", NULL, &dwType, arData, & dwLen)== ERROR_SUCCESS) { if (dwType == REG_SZ) @@ -97,7 +97,7 @@ bool isAccessibilitySupportDesired() #if OSL_DEBUG_LEVEL > 1 else OSL_ASSERT(0); -#endif +#endif } else if (dwType == REG_DWORD) { @@ -108,7 +108,7 @@ bool isAccessibilitySupportDesired() #if OSL_DEBUG_LEVEL > 1 else OSL_ASSERT(0); -#endif +#endif } } } @@ -156,7 +156,7 @@ rtl::ByteSequence encodeBase16(const rtl::ByteSequence& rawData) *pCurBuf = EncodingTable[curChar]; pCurBuf++; } - + rtl::ByteSequence ret((sal_Int8*) pBuf, lenRaw * 2); delete [] pBuf; return ret; @@ -199,7 +199,7 @@ rtl::ByteSequence decodeBase16(const rtl::ByteSequence& data) } rtl::ByteSequence ret((sal_Int8*) pBuf, lenBuf ); delete [] pBuf; - return ret; + return ret; } rtl::OUString getDirFromFile(const rtl::OUString& usFilePath) @@ -215,10 +215,10 @@ rtl::OUString getExecutableDirectory() throw FrameworkException( JFW_E_ERROR, "[Java framework] Error in function getExecutableDirectory (fwkutil.cxx)"); - + rtl::OUString ouExe(sExe, SAL_NO_ACQUIRE); return getDirFromFile(ouExe); -} +} rtl::OUString findPlugin( const rtl::OUString & baseUrl, const rtl::OUString & plugin) @@ -311,7 +311,7 @@ rtl::OUString getLibraryLocation() rtl::OString sExcMsg("[Java framework] Error in function getLibraryLocation " "(fwkutil.cxx)."); rtl::OUString libraryFileUrl; - + if (!osl::Module::getUrlFromAddress( reinterpret_cast< oslGenericFunction >(getLibraryLocation), libraryFileUrl)) @@ -328,7 +328,7 @@ jfw::FileStatus checkFileURL(const rtl::OUString & sURL) if (File::E_None == rc_item) { osl::FileStatus status(FileStatusMask_Validate); - + File::RC rc_stat = item.getFileStatus(status); if (File::E_None == rc_stat) { diff --git a/jvmfwk/source/fwkutil.hxx b/jvmfwk/source/fwkutil.hxx index 483cdf648220..bdd4d9b46f02 100644 --- a/jvmfwk/source/fwkutil.hxx +++ b/jvmfwk/source/fwkutil.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -108,18 +108,18 @@ enum FileStatus FILE_DOES_NOT_EXIST, FILE_INVALID }; - + /** checks if the URL is a file. If it is a link to a file than it is resolved. Assuming that the argument represents a relative URL then FILE_INVALID is returned. - + @return one of the values of FileStatus. - + @exception Errors occured during determining if the file exists */ @@ -134,7 +134,7 @@ bool isAccessibilitySupportDesired(); rtl::OUString buildClassPathFromDirectory(const rtl::OUString & relPath); -rtl::OUString retrieveClassPath( ::rtl::OUString const & macro ); +rtl::OUString retrieveClassPath( ::rtl::OUString const & macro ); } #endif diff --git a/jvmfwk/source/javasettings_template.xml b/jvmfwk/source/javasettings_template.xml index 3512501d3ee4..5cb41c98bd99 100644 --- a/jvmfwk/source/javasettings_template.xml +++ b/jvmfwk/source/javasettings_template.xml @@ -2,8 +2,8 @@ <!-- This file shows what elements the javasettings_platform.xml can contain. -The children of javaInfo are only created when a JRE is selected. The children of -vmParameters are only created when parameters are added and the children of +The children of javaInfo are only created when a JRE is selected. The children of +vmParameters are only created when parameters are added and the children of jreLocations are only created when the paths are added. See CNodeJava::loadFromSettings and CNodeJava::writeSettings for details. When extending the javavendors.xml then use the schema to verify it. diff --git a/jvmfwk/source/libxmlutil.cxx b/jvmfwk/source/libxmlutil.cxx index e121712d8672..d44ff28d87c8 100644 --- a/jvmfwk/source/libxmlutil.cxx +++ b/jvmfwk/source/libxmlutil.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,7 +50,7 @@ CXPathObjectPtr & CXPathObjectPtr::operator = (xmlXPathObject* pObj) { if (_object == pObj) return *this; - + xmlXPathFreeObject(_object); _object = pObj; return *this; diff --git a/jvmfwk/source/libxmlutil.hxx b/jvmfwk/source/libxmlutil.hxx index 5ac245afc3c7..0a6a50afabc3 100644 --- a/jvmfwk/source/libxmlutil.hxx +++ b/jvmfwk/source/libxmlutil.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -56,7 +56,7 @@ public: class CXPathContextPtr { xmlXPathContext* _object; - + CXPathContextPtr(const jfw::CXPathContextPtr&); CXPathContextPtr & operator = (const CXPathContextPtr&); public: @@ -72,7 +72,7 @@ public: class CXmlDocPtr { xmlDoc* _object; - + CXmlDocPtr(const CXmlDocPtr&); public: @@ -91,7 +91,7 @@ public: // class CXmlNsPtr // { // xmlNs* _object; - + // CXmlNsPtr(const CXmlNsPtr&); // CXmlNsPtr & operator = (const CXmlNsPtr&); // public: @@ -109,7 +109,7 @@ public: class CXmlCharPtr { xmlChar* _object; - + CXmlCharPtr(const CXmlCharPtr&); CXmlCharPtr & operator = (const CXmlCharPtr&); public: |