[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - 8 commits - connectivity/source cui/source desktop/source include/jvmfwk jvmfwk/inc jvmfwk/plugins jvmfwk/source svtools/source
Stephan Bergmann
sbergman at redhat.com
Wed Jul 13 19:40:13 UTC 2016
connectivity/source/drivers/hsqldb/HDriver.cxx | 2
connectivity/source/drivers/jdbc/JDriver.cxx | 2
cui/source/options/optjava.cxx | 4
cui/source/options/optjava.hxx | 2
desktop/source/migration/services/jvmfwk.cxx | 2
include/jvmfwk/framework.h | 781 --------------------
include/jvmfwk/framework.hxx | 767 +++++++++++++++++++
include/jvmfwk/jvmfwkdllapi.h | 23
include/jvmfwk/jvmfwkdllapi.hxx | 23
jvmfwk/inc/vendorplugin.hxx | 6
jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx | 25
jvmfwk/source/elements.cxx | 16
jvmfwk/source/elements.hxx | 2
jvmfwk/source/framework.cxx | 48 -
jvmfwk/source/framework.hxx | 2
svtools/source/java/javainteractionhandler.cxx | 4
16 files changed, 829 insertions(+), 880 deletions(-)
New commits:
commit 0f1d72377492231ae128f17e81c6592fa3c27a8d
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 29 08:04:38 2016 +0200
Avoid reserved identifier
Change-Id: I77c80c1aec96d520d1c0a3d95a2b91d3bccb3fff
(cherry picked from commit f2c2e7a71ea653993ba1349de7b36dfe92c5c62d)
diff --git a/include/jvmfwk/framework.hxx b/include/jvmfwk/framework.hxx
index 39c0512..a68bf7f 100644
--- a/include/jvmfwk/framework.hxx
+++ b/include/jvmfwk/framework.hxx
@@ -185,7 +185,7 @@
/** error codes which are returned by functions of this API.
*/
-typedef enum _javaFrameworkError
+enum javaFrameworkError
{
JFW_E_NONE,
JFW_E_ERROR,
@@ -201,7 +201,7 @@ typedef enum _javaFrameworkError
JFW_E_VM_CREATION_FAILED,
JFW_E_CONFIGURATION,
JFW_E_DIRECT_MODE
-} javaFrameworkError;
+};
/** an instance of this struct represents an installation of a Java
Runtime Environment (JRE).
commit bda666edabc390312e619df89fd9c07b55a4d064
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Mar 10 17:32:48 2016 +0100
Turn JavaInfo sal_Sequence* member into rtl::ByteSequence
Change-Id: Iecd476970b0b7a46afe223f71e95b0010048d7b1
(cherry picked from commit 8546831b3b36e29c1ee42b790cbecd3fd8d8bbaf)
diff --git a/include/jvmfwk/framework.hxx b/include/jvmfwk/framework.hxx
index e97e69d..39c0512 100644
--- a/include/jvmfwk/framework.hxx
+++ b/include/jvmfwk/framework.hxx
@@ -23,6 +23,7 @@
#define INCLUDED_JVMFWK_FRAMEWORK_HXX
#include <jvmfwk/jvmfwkdllapi.hxx>
+#include <rtl/byteseq.hxx>
#include <rtl/ustring.h>
#include <rtl/ustring.hxx>
#include <osl/mutex.h>
@@ -207,8 +208,7 @@ typedef enum _javaFrameworkError
<p>
Instances of this struct are created by the plug-in libraries which are used by
- this framework (jvmfwk/vendorplugin.h). The contained members must be
- freed individually.
+ this framework (jvmfwk/vendorplugin.h).
For convenience this API provides the function <code>jfw_freeJavaInfo</code>
which frees the objects properly. </p>
*/
@@ -254,7 +254,7 @@ struct JavaInfo
values. The plug-in libraries can put all data, necessary for
starting the java runtime into this sequence. </p>
*/
- sal_Sequence * arVendorData;
+ rtl::ByteSequence arVendorData;
};
/** frees the memory of a <code>JavaInfo</code> object.
@@ -271,7 +271,7 @@ JVMFWK_DLLPUBLIC void jfw_freeJavaInfo(JavaInfo *pInfo);
in the second <code>JavaInfo</code> object. The equality of the
<code>OUString</code> members is determined
by <code>operator ==</code>.
- Similarly the equality of the <code>sal_Sequence</code> is
+ Similarly the equality of the <code>rtl::ByteSequence</code> is
also determined by a comparison
function (see <code>rtl::ByteSequence::operator ==</code>). </p>
<p>
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index d7e7094..6499438 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -162,10 +162,9 @@ JavaInfo* createJavaInfo(const rtl::Reference<VendorBase> & info)
}
OUString sVendorData = buf.makeStringAndClear();
- rtl::ByteSequence byteSeq( reinterpret_cast<sal_Int8*>(sVendorData.pData->buffer),
- sVendorData.getLength() * sizeof(sal_Unicode));
- pInfo->arVendorData = byteSeq.get();
- rtl_byte_sequence_acquire(pInfo->arVendorData);
+ pInfo->arVendorData = rtl::ByteSequence(
+ reinterpret_cast<sal_Int8*>(sVendorData.pData->buffer),
+ sVendorData.getLength() * sizeof(sal_Unicode));
return pInfo;
}
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index afd9a7b..d407db2 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -984,8 +984,7 @@ JavaInfo * CNodeJavaInfo::makeJavaInfo() const
pInfo->sVersion = sVersion;
pInfo->nFeatures = nFeatures;
pInfo->nRequirements = nRequirements;
- pInfo->arVendorData = arVendorData.getHandle();
- rtl_byte_sequence_acquire(pInfo->arVendorData);
+ pInfo->arVendorData = arVendorData;
return pInfo;
}
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index fec33d5..9f94bec 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -631,13 +631,12 @@ bool SAL_CALL jfw_areEqualJavaInfo(
return true;
if (pInfoA == nullptr || pInfoB == nullptr)
return false;
- rtl::ByteSequence sData(pInfoA->arVendorData);
if (pInfoA->sVendor == pInfoB->sVendor
&& pInfoA->sLocation == pInfoB->sLocation
&& pInfoA->sVersion == pInfoB->sVersion
&& pInfoA->nFeatures == pInfoB->nFeatures
&& pInfoA->nRequirements == pInfoB->nRequirements
- && sData == pInfoB->arVendorData)
+ && pInfoA->arVendorData == pInfoB->arVendorData)
{
return true;
}
@@ -647,9 +646,6 @@ bool SAL_CALL jfw_areEqualJavaInfo(
void SAL_CALL jfw_freeJavaInfo(JavaInfo *pInfo)
{
- if (pInfo == nullptr)
- return;
- rtl_byte_sequence_release(pInfo->arVendorData);
delete pInfo;
}
@@ -1075,11 +1071,7 @@ CJavaInfo::~CJavaInfo()
JavaInfo * CJavaInfo::copyJavaInfo(const JavaInfo * pInfo)
{
- if (pInfo == nullptr)
- return nullptr;
- JavaInfo* newInfo = new JavaInfo(*pInfo);
- rtl_byte_sequence_acquire(newInfo->arVendorData);
- return newInfo;
+ return pInfo == nullptr ? nullptr : new JavaInfo(*pInfo);
}
commit 20d00043469901f55fb2f54a774035dfcd559dce
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Mar 10 17:11:10 2016 +0100
Turn JavaInfo rtl_uString* members into OUString
Change-Id: Ieb23b0c36ef56a4793a56cdb450df34e4d9bce1d
(cherry picked from commit 5dcdb35ab1e99dbeb283d3694ab7ebba354e9197)
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 493aa2d..9d41996 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -594,7 +594,7 @@ void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder )
if ( !bFound )
{
- jfw_addJRELocation( pInfo->sLocation );
+ jfw_addJRELocation( pInfo->sLocation.pData );
AddJRE( pInfo );
m_aAddedInfos.push_back( pInfo );
nPos = m_pJavaList->GetEntryCount() - 1;
diff --git a/include/jvmfwk/framework.hxx b/include/jvmfwk/framework.hxx
index 351da3c..e97e69d 100644
--- a/include/jvmfwk/framework.hxx
+++ b/include/jvmfwk/framework.hxx
@@ -24,6 +24,7 @@
#include <jvmfwk/jvmfwkdllapi.hxx>
#include <rtl/ustring.h>
+#include <rtl/ustring.hxx>
#include <osl/mutex.h>
#include "jni.h"
@@ -219,10 +220,10 @@ struct JavaInfo
Java system property <code>java.vendor</code>.
</p>
*/
- rtl_uString *sVendor;
+ OUString sVendor;
/** contains the file URL to the installation directory.
*/
- rtl_uString *sLocation;
+ OUString sLocation;
/** contains the version of this Java distribution.
<p>The version string must adhere to the rules
@@ -231,7 +232,7 @@ struct JavaInfo
equal the Java system property <code>java.version</code>.
</p>
*/
- rtl_uString *sVersion;
+ OUString sVersion;
/** indicates supported special features.
<p>For example, <code>JFW_FEATURE_ACCESSBRIDGE</code> indicates that
@@ -268,9 +269,8 @@ JVMFWK_DLLPUBLIC void jfw_freeJavaInfo(JavaInfo *pInfo);
<p>Two <code>JavaInfo</code> objects are said to be equal if the contained
members of the first <code>JavaInfo</code> are equal to their counterparts
in the second <code>JavaInfo</code> object. The equality of the
- <code>rtl_uString</code> members is determined
- by the respective comparison function (see
- <code>OUString::equals</code>).
+ <code>OUString</code> members is determined
+ by <code>operator ==</code>.
Similarly the equality of the <code>sal_Sequence</code> is
also determined by a comparison
function (see <code>rtl::ByteSequence::operator ==</code>). </p>
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index ca927e1..d7e7094 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -147,15 +147,9 @@ OString getPluginJarPath(
JavaInfo* createJavaInfo(const rtl::Reference<VendorBase> & info)
{
JavaInfo* pInfo = new JavaInfo;
- OUString sVendor = info->getVendor();
- pInfo->sVendor = sVendor.pData;
- rtl_uString_acquire(sVendor.pData);
- OUString sHome = info->getHome();
- pInfo->sLocation = sHome.pData;
- rtl_uString_acquire(pInfo->sLocation);
- OUString sVersion = info->getVersion();
- pInfo->sVersion = sVersion.pData;
- rtl_uString_acquire(pInfo->sVersion);
+ pInfo->sVendor = info->getVendor();
+ pInfo->sLocation = info->getHome();
+ pInfo->sVersion = info->getVersion();
pInfo->nFeatures = info->supportsAccessibility() ? 1 : 0;
pInfo->nRequirements = info->needsRestart() ? JFW_REQUIRE_NEEDRESTART : 0;
OUStringBuffer buf(1024);
@@ -692,7 +686,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
#if defined UNX && !defined MACOSX
//Setting the JAVA_HOME is needed for awt
OUString sPathLocation;
- osl_getSystemPathFromFileURL(pInfo->sLocation, & sPathLocation.pData);
+ osl::FileBase::getSystemPathFromFileURL(pInfo->sLocation, sPathLocation);
osl_setEnvironment(OUString("JAVA_HOME").pData, sPathLocation.pData);
#endif
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index 9e2f990..afd9a7b 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -979,12 +979,9 @@ JavaInfo * CNodeJavaInfo::makeJavaInfo() const
return nullptr;
JavaInfo * pInfo = new JavaInfo;
memset(pInfo, 0, sizeof(JavaInfo));
- pInfo->sVendor = sVendor.pData;
- rtl_uString_acquire(pInfo->sVendor);
- pInfo->sLocation = sLocation.pData;
- rtl_uString_acquire(pInfo->sLocation);
- pInfo->sVersion = sVersion.pData;
- rtl_uString_acquire(pInfo->sVersion);
+ pInfo->sVendor = sVendor;
+ pInfo->sLocation = sLocation;
+ pInfo->sVersion = sVersion;
pInfo->nFeatures = nFeatures;
pInfo->nRequirements = nRequirements;
pInfo->arVendorData = arVendorData.getHandle();
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 3c8725f..fec33d5 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -631,13 +631,10 @@ bool SAL_CALL jfw_areEqualJavaInfo(
return true;
if (pInfoA == nullptr || pInfoB == nullptr)
return false;
- OUString sVendor(pInfoA->sVendor);
- OUString sLocation(pInfoA->sLocation);
- OUString sVersion(pInfoA->sVersion);
rtl::ByteSequence sData(pInfoA->arVendorData);
- if (sVendor.equals(pInfoB->sVendor)
- && sLocation.equals(pInfoB->sLocation)
- && sVersion.equals(pInfoB->sVersion)
+ if (pInfoA->sVendor == pInfoB->sVendor
+ && pInfoA->sLocation == pInfoB->sLocation
+ && pInfoA->sVersion == pInfoB->sVersion
&& pInfoA->nFeatures == pInfoB->nFeatures
&& pInfoA->nRequirements == pInfoB->nRequirements
&& sData == pInfoB->arVendorData)
@@ -652,9 +649,6 @@ void SAL_CALL jfw_freeJavaInfo(JavaInfo *pInfo)
{
if (pInfo == nullptr)
return;
- rtl_uString_release(pInfo->sVendor);
- rtl_uString_release(pInfo->sLocation);
- rtl_uString_release(pInfo->sVersion);
rtl_byte_sequence_release(pInfo->arVendorData);
delete pInfo;
}
@@ -1083,12 +1077,8 @@ JavaInfo * CJavaInfo::copyJavaInfo(const JavaInfo * pInfo)
{
if (pInfo == nullptr)
return nullptr;
- JavaInfo* newInfo = new JavaInfo;
- memcpy(newInfo, pInfo, sizeof(JavaInfo));
- rtl_uString_acquire(pInfo->sVendor);
- rtl_uString_acquire(pInfo->sLocation);
- rtl_uString_acquire(pInfo->sVersion);
- rtl_byte_sequence_acquire(pInfo->arVendorData);
+ JavaInfo* newInfo = new JavaInfo(*pInfo);
+ rtl_byte_sequence_acquire(newInfo->arVendorData);
return newInfo;
}
commit edebc88629bea1bcfc64705c196ac7f8aa658d31
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Mar 10 16:47:16 2016 +0100
Manage JavaInfo instances via new/delete
Change-Id: I10a113718e525b646c51aa8a19f9f2b75a36714a
(cherry picked from commit 81dd7115e8da9a365a2d26e225f6ec4d2d8ccb5f)
diff --git a/include/jvmfwk/framework.hxx b/include/jvmfwk/framework.hxx
index 303336e..351da3c 100644
--- a/include/jvmfwk/framework.hxx
+++ b/include/jvmfwk/framework.hxx
@@ -206,10 +206,8 @@ typedef enum _javaFrameworkError
<p>
Instances of this struct are created by the plug-in libraries which are used by
- this framework (jvmfwk/vendorplugin.h). The memory of the instances is created
- by <code>rtl_allocateMemory</code> (rtl/alloc.h). Therefore, the memory must
- be freed by <code>rtl_freeMemory</code>. Also the contained members must be
- freed particularly.
+ this framework (jvmfwk/vendorplugin.h). The contained members must be
+ freed individually.
For convenience this API provides the function <code>jfw_freeJavaInfo</code>
which frees the objects properly. </p>
*/
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 667b287..ca927e1 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -146,9 +146,7 @@ OString getPluginJarPath(
JavaInfo* createJavaInfo(const rtl::Reference<VendorBase> & info)
{
- JavaInfo* pInfo = static_cast<JavaInfo*>(rtl_allocateMemory(sizeof(JavaInfo)));
- if (pInfo == nullptr)
- return nullptr;
+ JavaInfo* pInfo = new JavaInfo;
OUString sVendor = info->getVendor();
pInfo->sVendor = sVendor.pData;
rtl_uString_acquire(sVendor.pData);
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index 2c7d166..9e2f990 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -977,9 +977,7 @@ JavaInfo * CNodeJavaInfo::makeJavaInfo() const
{
if (bNil || m_bEmptyNode)
return nullptr;
- JavaInfo * pInfo = static_cast<JavaInfo*>(rtl_allocateMemory(sizeof(JavaInfo)));
- if (pInfo == nullptr)
- return nullptr;
+ JavaInfo * pInfo = new JavaInfo;
memset(pInfo, 0, sizeof(JavaInfo));
pInfo->sVendor = sVendor.pData;
rtl_uString_acquire(pInfo->sVendor);
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index f68ab2e..3c8725f 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -656,7 +656,7 @@ void SAL_CALL jfw_freeJavaInfo(JavaInfo *pInfo)
rtl_uString_release(pInfo->sLocation);
rtl_uString_release(pInfo->sVersion);
rtl_byte_sequence_release(pInfo->arVendorData);
- rtl_freeMemory(pInfo);
+ delete pInfo;
}
javaFrameworkError SAL_CALL jfw_getSelectedJRE(JavaInfo **ppInfo)
@@ -1083,16 +1083,12 @@ JavaInfo * CJavaInfo::copyJavaInfo(const JavaInfo * pInfo)
{
if (pInfo == nullptr)
return nullptr;
- JavaInfo* newInfo =
- static_cast<JavaInfo*>(rtl_allocateMemory(sizeof(JavaInfo)));
- if (newInfo)
- {
- memcpy(newInfo, pInfo, sizeof(JavaInfo));
- rtl_uString_acquire(pInfo->sVendor);
- rtl_uString_acquire(pInfo->sLocation);
- rtl_uString_acquire(pInfo->sVersion);
- rtl_byte_sequence_acquire(pInfo->arVendorData);
- }
+ JavaInfo* newInfo = new JavaInfo;
+ memcpy(newInfo, pInfo, sizeof(JavaInfo));
+ rtl_uString_acquire(pInfo->sVendor);
+ rtl_uString_acquire(pInfo->sLocation);
+ rtl_uString_acquire(pInfo->sVersion);
+ rtl_byte_sequence_acquire(pInfo->arVendorData);
return newInfo;
}
commit 6408f4c3b0b3c17057c82b47a84f3ef03a3c978a
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Mar 10 15:16:47 2016 +0100
No need for SAL_CALL here
Change-Id: Iefa38d62235eb54ed5f1ff78b49127bd7bea1f5e
(cherry picked from commit 624f9696a9d18480f04cca85c174099dbb8dbee5)
diff --git a/include/jvmfwk/framework.hxx b/include/jvmfwk/framework.hxx
index 97078a4..303336e 100644
--- a/include/jvmfwk/framework.hxx
+++ b/include/jvmfwk/framework.hxx
@@ -262,7 +262,7 @@ struct JavaInfo
@param pInfo
The object which is to be freed. It can be NULL;
*/
-JVMFWK_DLLPUBLIC void SAL_CALL jfw_freeJavaInfo(JavaInfo *pInfo);
+JVMFWK_DLLPUBLIC void jfw_freeJavaInfo(JavaInfo *pInfo);
/** compares two <code>JavaInfo</code> objects for equality.
@@ -286,7 +286,7 @@ JVMFWK_DLLPUBLIC void SAL_CALL jfw_freeJavaInfo(JavaInfo *pInfo);
true - both object represent the same JRE.</br>
false - the objects represend different JREs
*/
-JVMFWK_DLLPUBLIC bool SAL_CALL jfw_areEqualJavaInfo(
+JVMFWK_DLLPUBLIC bool jfw_areEqualJavaInfo(
JavaInfo const * pInfoA,JavaInfo const * pInfoB);
/** determines if a Java Virtual Machine is already running.
@@ -309,7 +309,7 @@ JVMFWK_DLLPUBLIC bool SAL_CALL jfw_areEqualJavaInfo(
JFW_E_NONE function ran successfully.<br/>
JFW_E_INVALID_ARG the parameter <code>bRunning</code> was NULL.
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_isVMRunning(sal_Bool *bRunning);
+JVMFWK_DLLPUBLIC javaFrameworkError jfw_isVMRunning(sal_Bool *bRunning);
/** detects a suitable JRE and configures the framework to use it.
@@ -378,7 +378,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_isVMRunning(sal_Bool *bRunning)
JFW_E_CONFIGURATION mode was not properly set or their prerequisites
were not met.
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo);
+JVMFWK_DLLPUBLIC javaFrameworkError jfw_findAndSelectJRE(JavaInfo **pInfo);
/** provides information about all available JRE installations.
@@ -406,7 +406,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pIn
JFW_E_CONFIGURATION mode was not properly set or their prerequisites
were not met.
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_findAllJREs(
+JVMFWK_DLLPUBLIC javaFrameworkError jfw_findAllJREs(
JavaInfo ***parInfo, sal_Int32 *pSize);
/** determines if a path points to a Java installation.
@@ -438,7 +438,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_findAllJREs(
JFW_E_FAILED_VERSION a JRE was detected but if failed the version
requirements as determined by the javavendors.xml
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getJavaInfoByPath(
+JVMFWK_DLLPUBLIC javaFrameworkError jfw_getJavaInfoByPath(
rtl_uString *pPath, JavaInfo **ppInfo);
@@ -506,7 +506,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getJavaInfoByPath(
JFW_E_FAILED_VERSION the "Default Mode" is active. The JRE determined by
<code>JAVA_HOME</code>does not meet the version requirements.
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_startVM(
+JVMFWK_DLLPUBLIC javaFrameworkError jfw_startVM(
JavaInfo const * pInfo, JavaVMOption * arOptions, sal_Int32 nSize,
JavaVM ** ppVM, JNIEnv ** ppEnv);
@@ -536,7 +536,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_startVM(
were not met.<br/>
JFW_E_DIRECT_MODE the function cannot be used in this mode.
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setSelectedJRE(JavaInfo const *pInfo);
+JVMFWK_DLLPUBLIC javaFrameworkError jfw_setSelectedJRE(JavaInfo const *pInfo);
/** provides information about the JRE that is to be used.
@@ -566,7 +566,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setSelectedJRE(JavaInfo const *
JFW_E_INVALID_SETTINGS the javavendors.xml has been changed and no
JRE has been selected afterwards. <br/>
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getSelectedJRE(JavaInfo **ppInfo);
+JVMFWK_DLLPUBLIC javaFrameworkError jfw_getSelectedJRE(JavaInfo **ppInfo);
/** determines if Java can be used.
@@ -585,7 +585,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getSelectedJRE(JavaInfo **ppInf
were not met.<br/>
JFW_E_DIRECT_MODE the function cannot be used in this mode.
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setEnabled(bool bEnabled);
+JVMFWK_DLLPUBLIC javaFrameworkError jfw_setEnabled(bool bEnabled);
/** provides the information if Java can be used.
@@ -600,7 +600,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setEnabled(bool bEnabled);
were not met.<br/>
JFW_E_DIRECT_MODE the function cannot be used in this mode.
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getEnabled(sal_Bool *pbEnabled);
+JVMFWK_DLLPUBLIC javaFrameworkError jfw_getEnabled(sal_Bool *pbEnabled);
/** determines parameters which are passed to VM during its creation.
@@ -624,7 +624,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getEnabled(sal_Bool *pbEnabled)
were not met.<br/>
JFW_E_DIRECT_MODE the function cannot be used in this mode.
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setVMParameters(
+JVMFWK_DLLPUBLIC javaFrameworkError jfw_setVMParameters(
rtl_uString ** arArgs, sal_Int32 nSize);
/** obtains the currently used start parameters.
@@ -649,7 +649,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setVMParameters(
were not met.<br/>
JFW_E_DIRECT_MODE the function cannot be used in this mode.
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getVMParameters(
+JVMFWK_DLLPUBLIC javaFrameworkError jfw_getVMParameters(
rtl_uString *** parParameters,
sal_Int32 * pSize);
@@ -671,7 +671,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getVMParameters(
were not met.<br/>
JFW_E_DIRECT_MODE the function cannot be used in this mode.
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setUserClassPath(rtl_uString * pCP);
+JVMFWK_DLLPUBLIC javaFrameworkError jfw_setUserClassPath(rtl_uString * pCP);
/** provides the value of the current user class path.
<p>The function returns an empty string if no user class path is set.
@@ -690,7 +690,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setUserClassPath(rtl_uString *
were not met.<br/>
JFW_E_DIRECT_MODE the function cannot be used in this mode.
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getUserClassPath(rtl_uString ** ppCP);
+JVMFWK_DLLPUBLIC javaFrameworkError jfw_getUserClassPath(rtl_uString ** ppCP);
/** saves the location of a JRE.
@@ -718,7 +718,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getUserClassPath(rtl_uString **
were not met.<br/>
JFW_E_DIRECT_MODE the function cannot be used in this mode.
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_addJRELocation(rtl_uString * sLocation);
+JVMFWK_DLLPUBLIC javaFrameworkError jfw_addJRELocation(rtl_uString * sLocation);
/** checks if the installation of the jre still exists.
@@ -737,7 +737,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_addJRELocation(rtl_uString * sL
JFW_E_ERROR an error occurred during execution.</br>
JFW_E_INVALID_ARG pInfo contains invalid data</br>
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_existJRE(const JavaInfo *pInfo, sal_Bool *exist);
+JVMFWK_DLLPUBLIC javaFrameworkError jfw_existJRE(const JavaInfo *pInfo, sal_Bool *exist);
/** locks this API so that it cannot be used by other threads.
@@ -755,14 +755,14 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_existJRE(const JavaInfo *pInfo,
The only functions which are not effected by <code>jfw_lock</code> are
<code>jfw_freeJavaInfo</code> and <code>jfw_areEqualJavaInfo</code>.
*/
-JVMFWK_DLLPUBLIC void SAL_CALL jfw_lock();
+JVMFWK_DLLPUBLIC void jfw_lock();
/** unlocks this API.
<p>This function is called after <code>jfw_lock</code>. It allows other
threads to use this API concurrently.</p>
*/
-JVMFWK_DLLPUBLIC void SAL_CALL jfw_unlock();
+JVMFWK_DLLPUBLIC void jfw_unlock();
#endif
commit 763d2d2de29139c36e14c1a22844f4f4744a4be7
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Mar 10 15:10:39 2016 +0100
No need for extern "C" here
...and fix resulting loplugin:salbool fallout
Change-Id: I5ae1497608d31c20b0d10676450a7673dee1c651
(cherry picked from commit 8471ba7b97a2a01039133674d3960c5c16803833)
diff --git a/include/jvmfwk/framework.hxx b/include/jvmfwk/framework.hxx
index e0e1d88..97078a4 100644
--- a/include/jvmfwk/framework.hxx
+++ b/include/jvmfwk/framework.hxx
@@ -27,8 +27,6 @@
#include <osl/mutex.h>
#include "jni.h"
-extern "C" {
-
/** @file
<p>This library can operate in two modes, application mode and direct mode.</p>
@@ -285,10 +283,10 @@ JVMFWK_DLLPUBLIC void SAL_CALL jfw_freeJavaInfo(JavaInfo *pInfo);
@param pInfoB
the second argument which is compared with the first.
@return
- sal_True - both object represent the same JRE.</br>
- sal_False - the objects represend different JREs
+ true - both object represent the same JRE.</br>
+ false - the objects represend different JREs
*/
-JVMFWK_DLLPUBLIC sal_Bool SAL_CALL jfw_areEqualJavaInfo(
+JVMFWK_DLLPUBLIC bool SAL_CALL jfw_areEqualJavaInfo(
JavaInfo const * pInfoA,JavaInfo const * pInfoB);
/** determines if a Java Virtual Machine is already running.
@@ -573,7 +571,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getSelectedJRE(JavaInfo **ppInf
/** determines if Java can be used.
- <p>If <code>bEnabled</code> is <code>sal_False</code> then a call
+ <p>If <code>bEnabled</code> is <code>false</code> then a call
to jfw_startVM will result in an error with the errorcode
<code>JFW_E_JAVA_DISABLED</code></p>
@@ -587,7 +585,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getSelectedJRE(JavaInfo **ppInf
were not met.<br/>
JFW_E_DIRECT_MODE the function cannot be used in this mode.
*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setEnabled(sal_Bool bEnabled);
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setEnabled(bool bEnabled);
/** provides the information if Java can be used.
@@ -766,8 +764,6 @@ JVMFWK_DLLPUBLIC void SAL_CALL jfw_lock();
*/
JVMFWK_DLLPUBLIC void SAL_CALL jfw_unlock();
-}
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 4f02abe..f68ab2e 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -624,13 +624,13 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo)
return errcode;
}
-sal_Bool SAL_CALL jfw_areEqualJavaInfo(
+bool SAL_CALL jfw_areEqualJavaInfo(
JavaInfo const * pInfoA,JavaInfo const * pInfoB)
{
if (pInfoA == pInfoB)
- return sal_True;
+ return true;
if (pInfoA == nullptr || pInfoB == nullptr)
- return sal_False;
+ return false;
OUString sVendor(pInfoA->sVendor);
OUString sLocation(pInfoA->sLocation);
OUString sVersion(pInfoA->sVersion);
@@ -642,9 +642,9 @@ sal_Bool SAL_CALL jfw_areEqualJavaInfo(
&& pInfoA->nRequirements == pInfoB->nRequirements
&& sData == pInfoB->arVendorData)
{
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
@@ -827,7 +827,7 @@ javaFrameworkError SAL_CALL jfw_setSelectedJRE(JavaInfo const *pInfo)
}
return errcode;
}
-javaFrameworkError SAL_CALL jfw_setEnabled(sal_Bool bEnabled)
+javaFrameworkError SAL_CALL jfw_setEnabled(bool bEnabled)
{
javaFrameworkError errcode = JFW_E_NONE;
try
diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx
index 464f82e..c07fcaf 100644
--- a/svtools/source/java/javainteractionhandler.cxx
+++ b/svtools/source/java/javainteractionhandler.cxx
@@ -163,7 +163,7 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
nResult = aQueryBox->Execute();
if ( nResult == RET_YES )
{
- jfw_setEnabled(sal_True);
+ jfw_setEnabled(true);
}
m_nResult_JavaDisabled = nResult;
commit 88df7efb5164cb2e7ecb8f84a1bf1707743ed980
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Mar 9 19:23:26 2016 +0100
Avoid reserved identifier, remove unnecessary typedef
Change-Id: I1172bff37539d1ffb8da7b53c0e5f1913f7b7ec7
(cherry picked from commit e01e2342fb063d5763706802657915720c5f3d0e)
diff --git a/cui/source/options/optjava.hxx b/cui/source/options/optjava.hxx
index 84fdfa4..3d5b968 100644
--- a/cui/source/options/optjava.hxx
+++ b/cui/source/options/optjava.hxx
@@ -37,7 +37,7 @@
// forward ---------------------------------------------------------------
#if HAVE_FEATURE_JAVA
-typedef struct _JavaInfo JavaInfo;
+struct JavaInfo;
#else
typedef void* JavaInfo;
#endif
diff --git a/include/jvmfwk/framework.hxx b/include/jvmfwk/framework.hxx
index 53e0726..e0e1d88 100644
--- a/include/jvmfwk/framework.hxx
+++ b/include/jvmfwk/framework.hxx
@@ -215,7 +215,7 @@ typedef enum _javaFrameworkError
For convenience this API provides the function <code>jfw_freeJavaInfo</code>
which frees the objects properly. </p>
*/
-struct _JavaInfo
+struct JavaInfo
{
/** contains the vendor.
@@ -260,8 +260,6 @@ struct _JavaInfo
sal_Sequence * arVendorData;
};
-typedef struct _JavaInfo JavaInfo;
-
/** frees the memory of a <code>JavaInfo</code> object.
@param pInfo
The object which is to be freed. It can be NULL;
commit 54668f9e4df24391579b7a555fb2024dd3293dd7
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Mar 9 18:51:57 2016 +0100
include/jvmfwk/*.h -> .hxx (only ever included from C++ code)
Change-Id: Ia912e937d5a48afb6f8f5345b20bb7bd517fc4f1
(cherry picked from commit 220d9c24d0e81668862010ed3e68e4f46fe9924b)
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index fcd14fc..fc4a2ef 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -32,7 +32,7 @@
#include <com/sun/star/embed/ElementModes.hpp>
#include "TConnection.hxx"
#include "hsqldb/HStorageMap.hxx"
-#include <jvmfwk/framework.h>
+#include <jvmfwk/framework.hxx>
#include <com/sun/star/reflection/XProxyFactory.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/frame/Desktop.hpp>
diff --git a/connectivity/source/drivers/jdbc/JDriver.cxx b/connectivity/source/drivers/jdbc/JDriver.cxx
index 611367c..ee61753 100644
--- a/connectivity/source/drivers/jdbc/JDriver.cxx
+++ b/connectivity/source/drivers/jdbc/JDriver.cxx
@@ -25,7 +25,7 @@
#include "java/util/Property.hxx"
#include "java/tools.hxx"
#include <connectivity/dbexception.hxx>
-#include <jvmfwk/framework.h>
+#include <jvmfwk/framework.hxx>
#include "resource/jdbc_log.hrc"
#include "resource/common_res.hrc"
#include "resource/sharedresources.hxx"
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 1b1a0ef..493aa2d 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -47,7 +47,7 @@
#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
#include <com/sun/star/ucb/XContentProvider.hpp>
#if HAVE_FEATURE_JAVA
-#include <jvmfwk/framework.h>
+#include <jvmfwk/framework.hxx>
#endif
// define ----------------------------------------------------------------
diff --git a/desktop/source/migration/services/jvmfwk.cxx b/desktop/source/migration/services/jvmfwk.cxx
index d18c8e1..1529b3d 100644
--- a/desktop/source/migration/services/jvmfwk.cxx
+++ b/desktop/source/migration/services/jvmfwk.cxx
@@ -36,7 +36,7 @@
#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
#include <com/sun/star/configuration/backend/MalformedDataException.hpp>
#include <com/sun/star/configuration/backend/TemplateIdentifier.hpp>
-#include <jvmfwk/framework.h>
+#include <jvmfwk/framework.hxx>
#include "jvmfwk.hxx"
#include <stack>
#include <stdio.h>
diff --git a/include/jvmfwk/framework.h b/include/jvmfwk/framework.hxx
similarity index 99%
rename from include/jvmfwk/framework.h
rename to include/jvmfwk/framework.hxx
index acd2cb1..53e0726 100644
--- a/include/jvmfwk/framework.h
+++ b/include/jvmfwk/framework.hxx
@@ -19,17 +19,15 @@
/** @HTML */
-#ifndef INCLUDED_JVMFWK_FRAMEWORK_H
-#define INCLUDED_JVMFWK_FRAMEWORK_H
+#ifndef INCLUDED_JVMFWK_FRAMEWORK_HXX
+#define INCLUDED_JVMFWK_FRAMEWORK_HXX
-#include <jvmfwk/jvmfwkdllapi.h>
+#include <jvmfwk/jvmfwkdllapi.hxx>
#include <rtl/ustring.h>
#include <osl/mutex.h>
#include "jni.h"
-#ifdef __cplusplus
extern "C" {
-#endif
/** @file
<p>This library can operate in two modes, application mode and direct mode.</p>
@@ -770,11 +768,7 @@ JVMFWK_DLLPUBLIC void SAL_CALL jfw_lock();
*/
JVMFWK_DLLPUBLIC void SAL_CALL jfw_unlock();
-
-#ifdef __cplusplus
}
-#endif
-
#endif
diff --git a/include/jvmfwk/jvmfwkdllapi.h b/include/jvmfwk/jvmfwkdllapi.hxx
similarity index 87%
rename from include/jvmfwk/jvmfwkdllapi.h
rename to include/jvmfwk/jvmfwkdllapi.hxx
index a4919bf..67be38a 100644
--- a/include/jvmfwk/jvmfwkdllapi.h
+++ b/include/jvmfwk/jvmfwkdllapi.hxx
@@ -7,8 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#ifndef INCLUDED_JVMFWK_JVMFWKDLLAPI_H
-#define INCLUDED_JVMFWK_JVMFWKDLLAPI_H
+#ifndef INCLUDED_JVMFWK_JVMFWKDLLAPI_HXX
+#define INCLUDED_JVMFWK_JVMFWKDLLAPI_HXX
#include <sal/types.h>
diff --git a/jvmfwk/inc/vendorplugin.hxx b/jvmfwk/inc/vendorplugin.hxx
index 5ebd4c4..a108cb3 100644
--- a/jvmfwk/inc/vendorplugin.hxx
+++ b/jvmfwk/inc/vendorplugin.hxx
@@ -21,7 +21,7 @@
#ifndef INCLUDED_JVMFWK_INC_VENDORPLUGIN_HXX
#define INCLUDED_JVMFWK_INC_VENDORPLUGIN_HXX
-#include <jvmfwk/framework.h>
+#include <jvmfwk/framework.hxx>
#include <rtl/ref.hxx>
#include <rtl/ustring.h>
#include "jni.h"
@@ -74,7 +74,7 @@ typedef enum
<p>
The function allocates memory for an array and all the JavaInfo objects returned
in <code>parJavaInfo</code>. The caller must free each JavaInfo object by calling
- <code>jfw_freeJavaInfo</code> (#include "jvmfwk/framework.h"). The array is to be
+ <code>jfw_freeJavaInfo</code> (#include "jvmfwk/framework.hxx"). The array is to be
freed by rtl_freeMemory.
In case an error occurred <code>parJavaInfo</code> need not be freed.
</p>
@@ -218,7 +218,7 @@ javaPluginError jfw_plugin_getJavaInfoFromJavaHome(
<p>
The function allocates memory for all the JavaInfo objects returned
in <code>vecJavaInfosFromPath</code>. The caller must free each JavaInfo object by calling
- <code>jfw_freeJavaInfo</code> (#include "jvmfwk/framework.h").
+ <code>jfw_freeJavaInfo</code> (#include "jvmfwk/framework.hxx").
</p>
@param vecVendorInfos
[in] vector specifying the vendor and version requirements that the JRE must fulfill.
diff --git a/jvmfwk/source/elements.hxx b/jvmfwk/source/elements.hxx
index 7d45791..6c233a5 100644
--- a/jvmfwk/source/elements.hxx
+++ b/jvmfwk/source/elements.hxx
@@ -20,7 +20,7 @@
#define INCLUDED_JVMFWK_SOURCE_ELEMENTS_HXX
#include <vector>
-#include "jvmfwk/framework.h"
+#include "jvmfwk/framework.hxx"
#include "fwkutil.hxx"
#include "rtl/ustring.hxx"
#include "rtl/byteseq.hxx"
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index eb16743..4f02abe 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -22,7 +22,7 @@
#include "rtl/bootstrap.hxx"
#include "osl/thread.hxx"
#include "osl/file.hxx"
-#include "jvmfwk/framework.h"
+#include "jvmfwk/framework.hxx"
#include "vendorplugin.hxx"
#include <cassert>
#include <vector>
diff --git a/jvmfwk/source/framework.hxx b/jvmfwk/source/framework.hxx
index b816343..7d4b858 100644
--- a/jvmfwk/source/framework.hxx
+++ b/jvmfwk/source/framework.hxx
@@ -21,7 +21,7 @@
#include "rtl/ustring.hxx"
#include "rtl/byteseq.hxx"
-#include "jvmfwk/framework.h"
+#include "jvmfwk/framework.hxx"
#include "vendorplugin.hxx"
/** typedefs for functions from vendorplugin.hxx
diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx
index abdafe4..464f82e 100644
--- a/svtools/source/java/javainteractionhandler.cxx
+++ b/svtools/source/java/javainteractionhandler.cxx
@@ -32,7 +32,7 @@
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
#include <tools/rcid.h>
-#include <jvmfwk/framework.h>
+#include <jvmfwk/framework.hxx>
#include <svtools/restartdialog.hxx>
#include <svtools/svtresid.hxx>
More information about the Libreoffice-commits
mailing list