[Libreoffice-commits] core.git: jvmfwk/source

2023-10-19 Thread Stephan Bergmann (via logerrit)
 jvmfwk/source/elements.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit cbe3899ed9b0fb226bf84c19e6f312e587ce2c03
Author: Stephan Bergmann 
AuthorDate: Thu Oct 19 10:30:19 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 20 07:58:27 2023 +0200

Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: jvmfwk

Change-Id: I23ce970ad67047b0b22a9dda3dff047e5f59dff5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158203
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index ebbf8abf0fd2..57b500c56d56 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -177,8 +177,8 @@ NodeJava::NodeJava(Layer layer):
 
 void NodeJava::load()
 {
-static constexpr OStringLiteral sExcMsg("[Java framework] Error in 
function NodeJava::load"
- "(elements.cxx).");
+static constexpr OString sExcMsg("[Java framework] Error in function 
NodeJava::load"
+ "(elements.cxx)."_ostr);
 if (SHARED == m_layer)
 {
 //we do not support yet to write into the shared installation


[Libreoffice-commits] core.git: jvmfwk/source

2021-11-17 Thread Stephan Bergmann (via logerrit)
 jvmfwk/source/framework.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit b9ecede5762831ff590a33cd04dc7cb381307000
Author: Stephan Bergmann 
AuthorDate: Wed Nov 17 13:36:19 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Nov 17 15:46:44 2021 +0100

Don't fail jfw_findAllJREs for just one JRE of WrongArch

...otherwise if one such JRE had found its way into a user's configuration,
"Tools - Options... - LibreOffice - Advanced" would no longer show *any* 
JREs.

Regression introduced with 9143dd4ebe37b608e43d04434cf831624bf55b65 "Related
tdf#54443 List only matching JREs", which added WrongArch to the 
javaPluginError
enum.

Change-Id: I51fd47e585c6686be7a9282615c0978e4f6c460b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125396
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 40bbf629a36f..200724b5483f 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -101,6 +101,8 @@ javaFrameworkError 
jfw_findAllJREs(std::vector> *pparI
 continue;
 if (plerr == javaPluginError::FailedVersion)
 continue;
+if (plerr == javaPluginError::WrongArch)
+continue;
 else if (plerr != javaPluginError::NONE)
 return JFW_E_ERROR;
 


[Libreoffice-commits] core.git: jvmfwk/source

2021-08-04 Thread Samuel Mehrbrodt (via logerrit)
 jvmfwk/source/framework.cxx |   18 ++
 1 file changed, 18 insertions(+)

New commits:
commit 48c5ba19e4f4a1ad5a88b5e6f0816c080e1253ec
Author: Samuel Mehrbrodt 
AuthorDate: Mon Aug 2 12:21:17 2021 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Wed Aug 4 09:28:28 2021 +0200

Fix alternate JREs missing bin/ directory on java.library.path

Exception looks like this:

java stack trace:
java.lang.UnsatisfiedLinkError: zulu11\bin\fontmanager.dll: Can't find 
depende
nt libraries
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native 
Method)
at 
java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
at 
java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
at 
java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
at 
java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2648)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
at java.base/java.lang.System.loadLibrary(System.java:1873)
at 
java.desktop/sun.font.FontManagerNativeLibrary$1.run(FontManagerNativeLibrary.java:57)
at java.base/java.security.AccessController.doPrivileged(Native 
Method)
at 
java.desktop/sun.font.FontManagerNativeLibrary.(FontManagerNativeLibrary.java:32)
at 
java.desktop/sun.font.SunFontManager$1.run(SunFontManager.java:279)
at java.base/java.security.AccessController.doPrivileged(Native 
Method)
at 
java.desktop/sun.font.SunFontManager.(SunFontManager.java:275)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at 
java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:82)
at java.base/java.security.AccessController.doPrivileged(Native 
Method)
at 
java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
at 
java.desktop/sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.ja
va:189)
at 
java.desktop/sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnviron
ment.java:223)
at 
java.desktop/sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnviron
ment.java:251)

Change-Id: I7a16bb5813d4c089ddb4de34a250280cf6fee137
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119880
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 5a7cef449b78..ad1f636f00d0 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -26,6 +26,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -198,6 +200,22 @@ javaFrameworkError jfw_startVM(
 }
 assert(pInfo != nullptr);
 
+#ifdef _WIN32
+// Alternative JREs (AdoptOpenJDK, Azul Zulu) are missing the bin/ 
folder in
+// java.library.path. Somehow setting java.library.path accordingly 
doesn't work,
+// but the PATH gets picked up, so add it there.
+// Without this hack, some features don't work in alternative JREs.
+OUString sPATH;
+osl_getEnvironment(OUString("PATH").pData, );
+OUString sJRELocation;
+osl::FileBase::getSystemPathFromFileURL(pInfo->sLocation + "/bin", 
sJRELocation);
+if (sPATH.isEmpty())
+sPATH = sJRELocation;
+else
+sPATH = sJRELocation + OUStringChar(SAL_PATHSEPARATOR) + sPATH;
+osl_setEnvironment(OUString("PATH").pData, sPATH.pData);
+#endif // _WIN32
+
 // create JavaVMOptions array that is passed to the plugin
 // it contains the classpath and all options set in the
 //options dialog


[Libreoffice-commits] core.git: jvmfwk/source

2021-01-01 Thread Mike Kaganski (via logerrit)
 jvmfwk/source/fwkbase.cxx |   17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

New commits:
commit 9862820e04ca259b3e15d1aac858cd46ca936a27
Author: Mike Kaganski 
AuthorDate: Mon Dec 28 19:27:38 2020 +0300
Commit: Mike Kaganski 
CommitDate: Sat Jan 2 07:21:28 2021 +0100

Use Unicode paths on Windows for jvmfwk

Change-Id: I6f2e29d2e7908a40175dc2852e955f0a1bc501e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108481
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index 501595c6e857..4c4b50725f2c 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -45,6 +45,13 @@ static bool  g_bJavaSet = false;
 
 namespace {
 
+#if defined _WIN32
+// The paths are used in libxml. On Windows, it takes UTF-8 paths.
+constexpr rtl_TextEncoding PathEncoding() { return RTL_TEXTENCODING_UTF8; }
+#else
+rtl_TextEncoding PathEncoding() { return osl_getThreadTextEncoding(); }
+#endif
+
 OString getVendorSettingsPath(OUString const & sURL)
 {
 if (sURL.isEmpty())
@@ -55,8 +62,7 @@ OString getVendorSettingsPath(OUString const & sURL)
 throw FrameworkException(
 JFW_E_ERROR,
 "[Java framework] Error in function getVendorSettingsPath 
(fwkbase.cxx) ");
-OString osSystemPathSettings =
-OUStringToOString(sSystemPathSettings,osl_getThreadTextEncoding());
+OString osSystemPathSettings = OUStringToOString(sSystemPathSettings, 
PathEncoding());
 return osSystemPathSettings;
 }
 
@@ -239,7 +245,7 @@ OString BootParams::getClasspath()
 OUString sCP;
 if (Bootstrap::get()->getFrom( UNO_JAVA_JFW_CLASSPATH, sCP ))
 {
-sClassPath = OUStringToOString(sCP, osl_getThreadTextEncoding());
+sClassPath = OUStringToOString(sCP, PathEncoding());
 SAL_INFO(
 "jfw.level2",
 "Using bootstrap parameter " UNO_JAVA_JFW_CLASSPATH " = "
@@ -456,8 +462,7 @@ OString makeClassPathOption(OUString const & sUserClassPath)
 sBufCP.append(sAppCP);
 }
 
-sPaths = OUStringToOString(
-sBufCP.makeStringAndClear(), osl_getThreadTextEncoding());
+sPaths = OUStringToOString(sBufCP.makeStringAndClear(), PathEncoding());
 
 OString sOptionClassPath = "-Djava.class.path=" + sPaths;
 return sOptionClassPath;
@@ -483,7 +488,7 @@ OString getSettingsPath( const OUString & sURL)
 throw FrameworkException(
 JFW_E_ERROR,
 "[Java framework] Error in function ::getSettingsPath 
(fwkbase.cxx).");
-return OUStringToOString(sPath,osl_getThreadTextEncoding());
+return OUStringToOString(sPath, PathEncoding());
 }
 
 OString getVendorSettingsPath()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source

2020-10-21 Thread Michael Weghorn (via logerrit)
 jvmfwk/source/framework.cxx |   65 +++-
 1 file changed, 35 insertions(+), 30 deletions(-)

New commits:
commit 903a5aca86b41cd6c3d814af8bdd60b6885d300b
Author: Michael Weghorn 
AuthorDate: Wed Oct 21 10:23:29 2020 +0200
Commit: Michael Weghorn 
CommitDate: Thu Oct 22 07:40:07 2020 +0200

Only read Java settings files in application mode

The 'javasettings_${_OS}_${_ARCH}.xml' files are only
meant to be used when the application mode of the
Java framework is used, not in direct mode.

From ure/source/README:

> You can also use the
> UNO_JAVA_JFW_JREHOME deployment variable to specify the location of a 
JDK/JRE
> installation.  For more information on this variable, see
> http://udk.openoffice.org/common/man/spec/javavendorextension.sxw.

From that http://udk.openoffice.org/common/man/spec/javavendorextension.sxw 
:

> The direct mode of the framework is used within the build environment.
> Java is needed there in order to register Java UNO components with the
> regcomp tool. Direct mode means that no settings are written or read.
> That is the parameters UNO_JAVA_JFW_USER_DATA and
> UNO_JAVA_JFW_SHARED_DATA are not used.
> [...]
> Another example for using the direct mode is the SDK. The SDK uses the
> libraries from the office installation. When an SDK is configured then
> one specifies what Java is to be used. This Java shall then be used for
> all task which require Java including registration of UNO components. In
> order to override the java settings of the office the script which
> prepares the SDK environment sets these environment variables:
> UNO_JAVA_JFW_JREHOME=
> UNO_JAVA_JFW_ENV_CLASSPATH=true
> UNO_JAVA_JFW_VENDOR_SETTINGS=
> By setting UNO_JAVA_JFW_JREHOME the framework is switched into direct mode
> and the office settings are disregarded.

Therefore, don't try to read the settings when using direct mode.
This makes the relevant code path for accessing the settings conditional
on 'jfw::JFW_MODE_APPLICATION' being used.

Otherwise, using direct mode e.g. by starting LibreOffice using

UNO_JAVA_JFW_JREHOME=file:///usr/lib/jvm/java-11-openjdk-amd64/ 
./instdir/program/soffice --writer

then going to the "Advanced" options in "Tools" -> "Options", where
the Java settings reside would result in this SAL_WARN being triggered

warn:jfw:10207:10207:jvmfwk/source/framework.cxx:119: [Java framework] 
Trying to access settings files in direct mode.

and no JVM at all being shown in the list of available
Java installations.

Change-Id: I2b98d822aed2b160f970c50ca695a9f3beeacd34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104001
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 5270439bda6a..5a7cef449b78 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -59,13 +59,8 @@ javaFrameworkError 
jfw_findAllJREs(std::vector> *pparI
 osl::MutexGuard guard(jfw::FwkMutex::get());
 
 jfw::VendorSettings aVendorSettings;
-//Add the JavaInfos found by jfw_plugin_getAllJavaInfos to the vector
 std::vector> vecInfo;
-//get the list of paths to jre locations which have been
-//added manually
-const jfw::MergedSettings settings;
-const std::vector& vecJRELocations =
-settings.getJRELocations();
+
 //Use all plug-in libraries to get Java installations.
 std::vector> arInfos;
 std::vector> infos;
@@ -81,32 +76,42 @@ javaFrameworkError 
jfw_findAllJREs(std::vector> *pparI
 for (auto & j: arInfos)
 vecInfo.push_back(std::move(j));
 
-//Check if any plugin can detect JREs at the location
-// of the paths added by jfw_addJRELocation
-//Check every manually added location
-for (auto const & ii: vecJRELocations)
+// direct mode disregards Java settings, so only retrieve
+// JREs from settings when application mode is used
+if (jfw::getMode() == jfw::JFW_MODE_APPLICATION)
 {
-std::unique_ptr aInfo;
-plerr = jfw_plugin_getJavaInfoByPath(
-ii,
-aVendorSettings,
-);
-if (plerr == javaPluginError::NoJre)
-continue;
-if (plerr == javaPluginError::FailedVersion)
-continue;
-else if (plerr != javaPluginError::NONE)
-return JFW_E_ERROR;
-
-// Was this JRE already added?
-if (std::none_of(
-vecInfo.begin(), vecInfo.end(),
-[](std::unique_ptr const & info) {
-return areEqualJavaInfo(
-info.get(), aInfo.get());
- 

[Libreoffice-commits] core.git: jvmfwk/source

2020-08-31 Thread Stephan Bergmann (via logerrit)
 jvmfwk/source/fwkbase.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit d6ffa7670fcd88befb16de387a6a0edc896c18aa
Author: Stephan Bergmann 
AuthorDate: Mon Aug 31 17:02:49 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Aug 31 22:30:13 2020 +0200

Simplify some code involving SAL_PATHSEPARATOR and OString/OUStringBuffer

Change-Id: If01e7c0d7d87a544f6601174ce43b37c63cfbcb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101746
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index 7f3cd0a132ae..df84d7c77f9e 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -252,8 +252,7 @@ OString BootParams::getClasspath()
 char * pCp = getenv("CLASSPATH");
 if (pCp)
 {
-char szSep[] = {SAL_PATHSEPARATOR,0};
-sClassPath += OStringLiteral(szSep) + pCp;
+sClassPath += OStringChar(SAL_PATHSEPARATOR) + pCp;
 }
 SAL_INFO(
 "jfw.level2",
@@ -415,7 +414,6 @@ OUString getApplicationClassPath()
 
 OUStringBuffer buf;
 sal_Int32 index = 0;
-const char szClassPathSep[] = {SAL_PATHSEPARATOR,0};
 do
 {
 OUString token( sParams.getToken( 0, ' ', index ).trim() );
@@ -428,7 +426,7 @@ OUString getApplicationClassPath()
 if (rc == osl_File_E_None && !systemPathElement.isEmpty())
 {
 if (buf.getLength() > 0)
-buf.append( szClassPathSep );
+buf.append( SAL_PATHSEPARATOR );
 buf.append( systemPathElement );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source

2020-07-01 Thread Stephan Bergmann (via logerrit)
 jvmfwk/source/framework.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 74512c394db63a680469270679b250893c1cdf4b
Author: Stephan Bergmann 
AuthorDate: Wed Jul 1 10:22:42 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Jul 1 13:20:03 2020 +0200

Upcoming improved loplugin:staticanonymous -> redundantstatic: jvmfwk

Change-Id: I979e9142324df589229aafbb4a17f7495a79f0dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97594
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 2457ef3ee4c8..5270439bda6a 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -39,9 +39,9 @@
 
 namespace {
 
-static bool g_bEnabledSwitchedOn = false;
+bool g_bEnabledSwitchedOn = false;
 
-static JavaVM * g_pJavaVM = nullptr;
+JavaVM * g_pJavaVM = nullptr;
 
 bool areEqualJavaInfo(
 JavaInfo const * pInfoA,JavaInfo const * pInfoB)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source

2020-06-21 Thread Stephan Bergmann (via logerrit)
 jvmfwk/source/framework.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 642fc41cd7d080384658e10b30bb9d3b38a2cbd9
Author: Stephan Bergmann 
AuthorDate: Sun Jun 21 23:34:31 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Mon Jun 22 01:21:44 2020 +0200

tdf#134167: jfw_plugin_getAllJavaInfos can successfully return empty list

Regression introduced with 6ba74150866d71469827de9f4f19268dfa7db137
"jfw::isAccessibilitySupportDesired is obsolete"

Change-Id: I696f3240fa8760ae156ac3b8b1fd1fe42f81c539
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96821
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index c253eec65426..2457ef3ee4c8 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -327,9 +327,8 @@ javaFrameworkError 
jfw_findAndSelectJRE(std::unique_ptr *pInfo)
 & arInfos,
 infos);
 
-if (plerr == javaPluginError::NONE)
+if (plerr == javaPluginError::NONE && !arInfos.empty())
 {
-assert(!arInfos.empty());
 aCurrentInfo = std::move(arInfos[0]);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source

2020-05-15 Thread Stephan Bergmann (via logerrit)
 jvmfwk/source/elements.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e55cf3bb2b445201280cdc6742926787294e2363
Author: Stephan Bergmann 
AuthorDate: Fri May 15 12:09:15 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Fri May 15 15:32:36 2020 +0200

Typo in comment

Change-Id: I8b33a9cdb622edb065bceef2e9122c2fd28ce75e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94306
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index 5f7ff045b302..f05cb5950e83 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -878,7 +878,7 @@ void CNodeJavaInfo::writeToNode(xmlDoc* pDoc,
 xmlAddChild(pJavaInfoNode, nodeCrLf);
 
 
-//Create the features element
+//Create the vendorData element
 rtl::ByteSequence data = encodeBase16(arVendorData);
 xmlNode* dataNode = xmlNewChild(pJavaInfoNode, nullptr,
 reinterpret_cast("vendorData"),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source

2018-04-12 Thread Stephan Bergmann
 jvmfwk/source/framework.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 6ec4109f73740de067b713cd46dae043f1b05dc5
Author: Stephan Bergmann 
Date:   Thu Apr 12 08:26:34 2018 +0200

Keep strings alive again as necessary

...fixing regression introduced with 
49eb02f07a5af44da59008a238e828b4a9532bef
"new loplugin:unusedvariablemore"

Change-Id: Ib598d67add50031937c9c9f3e23ea16d0a1da107

diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 17ca11608481..3eceabe99d42 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -275,9 +275,13 @@ javaFrameworkError jfw_startVM(
 index ++;
 }
 //add all options of the arOptions argument
+std::vector convertedOptions;
 for (auto const & ii: arOptions)
 {
 OString conv = OUStringToOString(ii, osl_getThreadTextEncoding());
+convertedOptions.push_back(conv);
+// keep conv.getStr() alive until after the call to
+// jfw_plugin_startJavaVirtualMachine below
 arOpt[index].optionString = const_cast(conv.getStr());
 arOpt[index].extraInfo = nullptr;
 index++;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source

2018-03-28 Thread Stephan Bergmann
 jvmfwk/source/framework.cxx |   17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

New commits:
commit 19d2ec6539f789dfbe38612e5e7807cac9fe0819
Author: Stephan Bergmann 
Date:   Tue Mar 27 15:19:15 2018 +0200

Don't pass empty option to JNI_CreateJavaVM

sUserClassPath may be empty (instead of containing "-Djava.class.path=...")
here, which older versions of Java have apparently silently ignored.  But
Java 10 now fails with JNI_EINVAL (-6).  (Happens e.g. during
CppunitTest_dbaccess_hsqldb_test.)

Change-Id: Ifd13222f0d0ae69547bd1a9fe0fd5eae47917d0a
Reviewed-on: https://gerrit.libreoffice.org/51949
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index af5621addeb7..777133212082 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -247,22 +247,27 @@ javaFrameworkError jfw_startVM(
 // it contains the classpath and all options set in the
 //options dialog
 std::unique_ptr sarJOptions(
-new JavaVMOption[arOptions.size() + 2 + vmParams.size()]);
+new JavaVMOption[
+arOptions.size() + (sUserClassPath.isEmpty() ? 1 : 2) + 
vmParams.size()]);
 JavaVMOption * arOpt = sarJOptions.get();
 if (! arOpt)
 return JFW_E_ERROR;
 
 //The first argument is the classpath
-arOpt[0].optionString= const_cast(sUserClassPath.getStr());
-arOpt[0].extraInfo = nullptr;
+int index = 0;
+if (!sUserClassPath.isEmpty()) {
+arOpt[index].optionString= 
const_cast(sUserClassPath.getStr());
+arOpt[index].extraInfo = nullptr;
+++index;
+}
 // Set a flag that this JVM has been created via the JNI Invocation API
 // (used, for example, by UNO remote bridges to share a common thread 
pool
 // factory among Java and native bridge implementations):
-arOpt[1].optionString = const_cast("-Dorg.openoffice.native=");
-arOpt[1].extraInfo = nullptr;
+arOpt[index].optionString = const_cast("-Dorg.openoffice.native=");
+arOpt[index].extraInfo = nullptr;
+++index;
 
 //add the options set by options dialog
-int index = 2;
 for (auto const & vmParam : vmParams)
 {
 arOpt[index].optionString = 
const_cast(vmParam.getStr());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source

2017-05-30 Thread Noel Grandin
 jvmfwk/source/elements.cxx  |9 ++--
 jvmfwk/source/framework.cxx |   48 +++-
 jvmfwk/source/fwkbase.cxx   |   47 +--
 jvmfwk/source/fwkutil.cxx   |5 +---
 4 files changed, 45 insertions(+), 64 deletions(-)

New commits:
commit 4d162d8222004029561185e07230b98317ec08ff
Author: Noel Grandin 
Date:   Mon May 29 09:48:54 2017 +0200

cleanup some OString stuff in jvmfwk

Change-Id: I80d221a348c4bd5fcec82cafc455a051237ae95d
Reviewed-on: https://gerrit.libreoffice.org/38131
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index 353eab37ba6f..1807f636166b 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -56,16 +56,14 @@ OString getElement(OString const & docPath,
 if (doc == nullptr)
 throw FrameworkException(
 JFW_E_ERROR,
-OString("[Java framework] Error in function getElement "
- "(elements.cxx)"));
+"[Java framework] Error in function getElement (elements.cxx)");
 
 jfw::CXPathContextPtr context(xmlXPathNewContext(doc));
 if (xmlXPathRegisterNs(context, reinterpret_cast("jf"),
 reinterpret_cast(NS_JAVA_FRAMEWORK)) == -1)
 throw FrameworkException(
 JFW_E_ERROR,
-OString("[Java framework] Error in function getElement "
- "(elements.cxx)"));
+"[Java framework] Error in function getElement (elements.cxx)");
 
 CXPathObjectPtr pathObj;
 pathObj = xmlXPathEvalExpression(pathExpression, context);
@@ -75,8 +73,7 @@ OString getElement(OString const & docPath,
 if (bThrowIfEmpty)
 throw FrameworkException(
 JFW_E_ERROR,
-OString("[Java framework] Error in function getElement "
- "(elements.cxx)"));
+"[Java framework] Error in function getElement 
(elements.cxx)");
 }
 else
 {
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index ddc5e6c19747..5b1911fb0583 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -140,8 +140,7 @@ javaFrameworkError 
jfw_findAllJREs(std::vector *pparI
 }
 catch (const jfw::FrameworkException& e)
 {
-fprintf(stderr, "%s\n", e.message.getStr());
-OSL_FAIL(e.message.getStr());
+SAL_WARN( "jfw", e.message);
 return e.errorCode;
 }
 }
@@ -304,8 +303,7 @@ javaFrameworkError jfw_startVM(
 catch (const jfw::FrameworkException& e)
 {
 errcode = e.errorCode;
-fprintf(stderr, "%s\n", e.message.getStr());
-OSL_FAIL(e.message.getStr());
+SAL_WARN( "jfw", e.message);
 }
 
 return errcode;
@@ -540,8 +538,7 @@ javaFrameworkError 
jfw_findAndSelectJRE(std::unique_ptr *pInfo)
 catch (const jfw::FrameworkException& e)
 {
 errcode = e.errorCode;
-fprintf(stderr, "%s\n", e.message.getStr());
-OSL_FAIL(e.message.getStr());
+SAL_WARN( "jfw", e.message );
 }
 
 return errcode;
@@ -580,11 +577,10 @@ javaFrameworkError 
jfw_getSelectedJRE(std::unique_ptr *ppInfo)
 != JFW_E_NONE)
 throw jfw::FrameworkException(
 JFW_E_CONFIGURATION,
-OString(
-"[Java framework] The JRE specified by the bootstrap "
-"variable UNO_JAVA_JFW_JREHOME  or  
UNO_JAVA_JFW_ENV_JREHOME "
-" could not be recognized. Check the values and make 
sure that you "
-"use a plug-in library that can recognize that JRE."));
+"[Java framework] The JRE specified by the bootstrap "
+"variable UNO_JAVA_JFW_JREHOME  or  
UNO_JAVA_JFW_ENV_JREHOME "
+" could not be recognized. Check the values and make sure 
that you "
+"use a plug-in library that can recognize that JRE.");
 
 return JFW_E_NONE;
 }
@@ -609,8 +605,7 @@ javaFrameworkError 
jfw_getSelectedJRE(std::unique_ptr *ppInfo)
 catch (const jfw::FrameworkException& e)
 {
 errcode = e.errorCode;
-fprintf(stderr, "%s\n", e.message.getStr());
-OSL_FAIL(e.message.getStr());
+SAL_WARN( "jfw", e.message );
 }
 return errcode;
 }
@@ -675,8 +670,7 @@ javaFrameworkError jfw_getJavaInfoByPath(OUString const & 
pPath, std::unique_ptr
 catch (const jfw::FrameworkException& e)
 {
 errcode = e.errorCode;
-fprintf(stderr, "%s\n", e.message.getStr());
-OSL_FAIL(e.message.getStr());
+SAL_WARN( "jfw", e.message );
 }
 
 return errcode;
@@ -709,8 +703,7 @@ javaFrameworkError jfw_setSelectedJRE(JavaInfo const 

Re: [Libreoffice-commits] core.git: jvmfwk/source

2017-05-29 Thread Stephan Bergmann

On 05/28/2017 12:11 PM, David Ostrovsky wrote:

On Fri May 19 20:10:43 UTC 2017, Stephan Bergmann wrote:

New commits:
commit 957874168491f4b030fda85c65dd969aae82a670
Author: Stephan Bergmann 
Date:   Fri May 19 22:10:19 2017 +0200

loplugin:stringcopy

Change-Id: I04e3faf18cd6dae39d948cfb3dd0834dd96751b1


diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index 353eab37ba6f..19c3e1b1f44c 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -260,7 +260,7 @@ void NodeJava::load()
 {
 CXmlCharPtr sUser(xmlNodeListGetString(
 docUser, cur->children, 1));
-m_userClassPath =

boost::optional>(OUString(sUser));

+m_userClassPath = boost::optional(sUser);
 }
 }
 else if (xmlStrcmp(cur->name, reinterpret_cast
*>("javaInfo")) == 0)

This doesn't compile against system boost 1.54.0 here: [1].


 
"Revert 'loplugin:stringcopy'"

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: jvmfwk/source

2017-05-29 Thread Stephan Bergmann
 jvmfwk/source/elements.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0bebf37bac076a56801ef7d1c113f729b12b9f46
Author: Stephan Bergmann <sberg...@redhat.com>
Date:   Mon May 29 11:22:57 2017 +0200

Revert "loplugin:stringcopy"

This reverts commit 957874168491f4b030fda85c65dd969aae82a670.  It wasn't 
really
necessary (see commit message of 8b1fcedcd10366523967ebcbd463b2c0c6b5b17a
"...and re-eanble loplugin:stringcopy again") and reportedly causes issues 
with
older Boost (see
<https://lists.freedesktop.org/archives/libreoffice/2017-May/077786.html>
    "[Libreoffice-commits] core.git: jvmfwk/source").

diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index 19c3e1b1f44c..353eab37ba6f 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -260,7 +260,7 @@ void NodeJava::load()
 {
 CXmlCharPtr sUser(xmlNodeListGetString(
 docUser, cur->children, 1));
-m_userClassPath = boost::optional(sUser);
+m_userClassPath = boost::optional(OUString(sUser));
 }
 }
 else if (xmlStrcmp(cur->name, reinterpret_cast("javaInfo")) == 0)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source

2017-05-28 Thread David Ostrovsky
On Fri May 19 20:10:43 UTC 2017, Stephan Bergmann wrote:

>jvmfwk/source/elements.cxx |2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>New commits:
>commit 957874168491f4b030fda85c65dd969aae82a670
>Author: Stephan Bergmann 
>Date:   Fri May 19 22:10:19 2017 +0200
>
>    loplugin:stringcopy
>    
>    Change-Id: I04e3faf18cd6dae39d948cfb3dd0834dd96751b1
>
>diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
>index 353eab37ba6f..19c3e1b1f44c 100644
>--- a/jvmfwk/source/elements.cxx
>+++ b/jvmfwk/source/elements.cxx
>@@ -260,7 +260,7 @@ void NodeJava::load()
>             {
>                 CXmlCharPtr sUser(xmlNodeListGetString(
>                     docUser, cur->children, 1));
>-m_userClassPath =
boost::optional>(OUString(sUser));
>+m_userClassPath = boost::optional(sUser);
>             }
>         }
>         else if (xmlStrcmp(cur->name, reinterpret_cast("javaInfo")) == 0)

This doesn't compile against system boost 1.54.0 here: [1].

$ gcc --version
  gcc (SUSE Linux) 4.8.5

Complete autogen.input is: [2].

* [1] http://paste.openstack.org/show/610812
* [2] http://paste.openstack.org/show/610814
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: jvmfwk/source

2017-05-19 Thread Stephan Bergmann
 jvmfwk/source/elements.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 957874168491f4b030fda85c65dd969aae82a670
Author: Stephan Bergmann 
Date:   Fri May 19 22:10:19 2017 +0200

loplugin:stringcopy

Change-Id: I04e3faf18cd6dae39d948cfb3dd0834dd96751b1

diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index 353eab37ba6f..19c3e1b1f44c 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -260,7 +260,7 @@ void NodeJava::load()
 {
 CXmlCharPtr sUser(xmlNodeListGetString(
 docUser, cur->children, 1));
-m_userClassPath = boost::optional(OUString(sUser));
+m_userClassPath = boost::optional(sUser);
 }
 }
 else if (xmlStrcmp(cur->name, reinterpret_cast("javaInfo")) == 0)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source

2017-04-11 Thread Stephan Bergmann
 jvmfwk/source/framework.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 40677a29093b8e47dfdc17a251845624c57430f6
Author: Stephan Bergmann 
Date:   Tue Apr 11 18:59:13 2017 +0200

Fix missing deref

...lacking since recent f0454e72c1d1b11c3bcbacb23048a62fdecd037c "Use
std::unique_ptr for lifecycle management in jvmfwk/framework.hxx"

Change-Id: Ied39be52ccc8cbef48cdfb4933e4ac1914fd0fd3

diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 96a75249..5bfa77695e83 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -660,7 +660,7 @@ javaFrameworkError 
jfw_getSelectedJRE(std::unique_ptr *ppInfo)
 
 const jfw::MergedSettings settings;
 ppInfo->reset(settings.createJavaInfo());
-if (! ppInfo)
+if (!*ppInfo)
 {
 return JFW_E_NONE;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source

2017-04-11 Thread Stephan Bergmann
 jvmfwk/source/framework.cxx |   10 +-
 jvmfwk/source/framework.hxx |5 ++---
 2 files changed, 3 insertions(+), 12 deletions(-)

New commits:
commit a730dc1b566565472ea7e4b94f0dea9705d0a809
Author: Stephan Bergmann 
Date:   Tue Apr 11 15:07:42 2017 +0200

Remove unnecessary jfw::CJavaInfo::cloneJavaInfo

Change-Id: Ia9e807c0d1e5b0664d711c551a5e70afccbcc564

diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index a56c29488f1f..22d066516326 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -603,7 +603,7 @@ javaFrameworkError jfw_findAndSelectJRE(JavaInfo **pInfo)
 if (pInfo !=nullptr)
 {
 //copy to out param
-*pInfo = aCurrentInfo.cloneJavaInfo();
+*pInfo = jfw::CJavaInfo::copyJavaInfo(aCurrentInfo.pInfo);
 }
 }
 else
@@ -1063,14 +1063,6 @@ JavaInfo * CJavaInfo::copyJavaInfo(const JavaInfo * 
pInfo)
 return pInfo == nullptr ? nullptr : new JavaInfo(*pInfo);
 }
 
-
-JavaInfo* CJavaInfo::cloneJavaInfo() const
-{
-if (pInfo == nullptr)
-return nullptr;
-return copyJavaInfo(pInfo);
-}
-
 CJavaInfo & CJavaInfo::operator = (const CJavaInfo& info)
 {
 if ( == this)
diff --git a/jvmfwk/source/framework.hxx b/jvmfwk/source/framework.hxx
index 8e433054fd3a..9521a723c54a 100644
--- a/jvmfwk/source/framework.hxx
+++ b/jvmfwk/source/framework.hxx
@@ -67,8 +67,6 @@ namespace jfw
 
 class CJavaInfo
 {
-static JavaInfo * copyJavaInfo(const JavaInfo * pInfo);
-
 enum _transfer_ownership {TRANSFER};
 /*Attaching the pointer to this class. The argument pInfo must not
 be freed afterwards.
@@ -96,10 +94,11 @@ public:
 ::JavaInfo * detach();
 const ::JavaInfo* operator ->() const { return pInfo;}
 operator ::JavaInfo* () { return pInfo;}
-::JavaInfo* cloneJavaInfo() const;
 
 OUString getLocation() const;
 sal_uInt64 getFeatures() const;
+
+static JavaInfo * copyJavaInfo(const JavaInfo * pInfo);
 };
 
 class FrameworkException : public std::exception
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source sw/qa

2017-03-19 Thread Julien Nabet
 jvmfwk/source/fwkbase.cxx  |   12 ++--
 sw/qa/python/set_expression.py |2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 0a57e51f410eda8e5d27a95a8d0ae5124fcc7496
Author: Julien Nabet 
Date:   Sun Mar 19 17:35:07 2017 +0100

Fix typo for "expression"

Change-Id: Iad0728fe53912d85ee40ef1b39d476a47aaad2d2
Reviewed-on: https://gerrit.libreoffice.org/35433
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index 6eacf33e4bcf..df2e41e4994f 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -124,13 +124,13 @@ VersionInfo VendorSettings::getVersionInformation(const 
OUString & sVendor)
 VersionInfo aVersionInfo;
 OString osVendor = OUStringToOString(sVendor, RTL_TEXTENCODING_UTF8);
 //Get minVersion
-OString sExpresion = OString(
+OString sExpression = OString(
 "/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") +
 osVendor + OString("\"]/jf:minVersion");
 
 CXPathObjectPtr xPathObjectMin;
 xPathObjectMin =
-xmlXPathEvalExpression(reinterpret_cast(sExpresion.getStr()),
+xmlXPathEvalExpression(reinterpret_cast(sExpression.getStr()),
m_xmlPathContextVendorSettings);
 if (xmlXPathNodeSetIsEmpty(xPathObjectMin->nodesetval))
 {
@@ -148,11 +148,11 @@ VersionInfo VendorSettings::getVersionInformation(const 
OUString & sVendor)
 }
 
 //Get maxVersion
-sExpresion = 
OString("/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") +
+sExpression = 
OString("/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") +
 osVendor + OString("\"]/jf:maxVersion");
 CXPathObjectPtr xPathObjectMax;
 xPathObjectMax = xmlXPathEvalExpression(
-reinterpret_cast(sExpresion.getStr()),
+reinterpret_cast(sExpression.getStr()),
 m_xmlPathContextVendorSettings);
 if (xmlXPathNodeSetIsEmpty(xPathObjectMax->nodesetval))
 {
@@ -170,11 +170,11 @@ VersionInfo VendorSettings::getVersionInformation(const 
OUString & sVendor)
 }
 
 //Get excludeVersions
-sExpresion = 
OString("/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") +
+sExpression = 
OString("/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") +
 osVendor + OString("\"]/jf:excludeVersions/jf:version");
 CXPathObjectPtr xPathObjectVersions;
 xPathObjectVersions =
-xmlXPathEvalExpression(reinterpret_cast(sExpresion.getStr()),
+xmlXPathEvalExpression(reinterpret_cast(sExpression.getStr()),
m_xmlPathContextVendorSettings);
 if (!xmlXPathNodeSetIsEmpty(xPathObjectVersions->nodesetval))
 {
diff --git a/sw/qa/python/set_expression.py b/sw/qa/python/set_expression.py
index 7bcc20d69880..220952536fea 100644
--- a/sw/qa/python/set_expression.py
+++ b/sw/qa/python/set_expression.py
@@ -12,7 +12,7 @@ from org.libreoffice.unotest import UnoInProcess
 
 
 # @unittest.skip("that seems to work")
-class TestSetExpresion(unittest.TestCase):
+class TestSetExpression(unittest.TestCase):
 
 @classmethod
 def setUpClass(cls):
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source l10ntools/inc libreofficekit/source linguistic/inc linguistic/source lotuswordpro/source

2017-01-24 Thread Noel Grandin
 jvmfwk/source/framework.hxx |1 -
 l10ntools/inc/export.hxx|4 
 l10ntools/inc/helpmerge.hxx |1 -
 l10ntools/inc/xmlparse.hxx  |1 -
 libreofficekit/source/gtk/tilebuffer.hxx|2 --
 linguistic/inc/iprcache.hxx |1 -
 linguistic/source/convdicxml.hxx|7 ---
 linguistic/source/misc.cxx  |5 -
 lotuswordpro/source/filter/LotusWordProImportFilter.hxx |1 -
 lotuswordpro/source/filter/lwp9reader.hxx   |1 -
 lotuswordpro/source/filter/lwpbackgroundoverride.hxx|1 -
 lotuswordpro/source/filter/lwpbasetype.hxx  |1 -
 lotuswordpro/source/filter/lwpcharsetmgr.hxx|1 -
 lotuswordpro/source/filter/lwpcolor.hxx |1 -
 lotuswordpro/source/filter/lwpcontent.hxx   |2 --
 lotuswordpro/source/filter/lwpdlvlist.hxx   |1 -
 lotuswordpro/source/filter/lwpdoc.hxx   |1 -
 lotuswordpro/source/filter/lwpdrawobj.hxx   |6 --
 lotuswordpro/source/filter/lwpfilehdr.hxx   |1 -
 lotuswordpro/source/filter/lwpfont.hxx  |4 
 lotuswordpro/source/filter/lwpfootnote.hxx  |4 
 lotuswordpro/source/filter/lwpfoundry.hxx   |6 --
 lotuswordpro/source/filter/lwpframelayout.hxx   |2 --
 lotuswordpro/source/filter/lwpfribbreaks.hxx|2 --
 lotuswordpro/source/filter/lwpfribframe.hxx |2 --
 lotuswordpro/source/filter/lwpfribmark.hxx  |4 
 lotuswordpro/source/filter/lwpfribsection.hxx   |1 -
 lotuswordpro/source/filter/lwpfribtable.hxx |1 -
 lotuswordpro/source/filter/lwpfribtext.hxx  |6 --
 lotuswordpro/source/filter/lwplayout.hxx|2 --
 lotuswordpro/source/filter/lwplnopts.hxx|1 -
 lotuswordpro/source/filter/lwpmarker.hxx|7 ---
 lotuswordpro/source/filter/lwpnotes.hxx |1 -
 lotuswordpro/source/filter/lwpnumberingoverride.hxx |1 -
 lotuswordpro/source/filter/lwpnumericfmt.hxx|1 -
 lotuswordpro/source/filter/lwpoleobject.hxx |1 -
 lotuswordpro/source/filter/lwpparaproperty.hxx  |1 -
 lotuswordpro/source/filter/lwpproplist.hxx  |1 -
 lotuswordpro/source/filter/lwpprtinfo.hxx   |1 -
 lotuswordpro/source/filter/lwpsection.hxx   |1 -
 lotuswordpro/source/filter/lwpsortopt.hxx   |1 -
 lotuswordpro/source/filter/lwptable.hxx |1 -
 lotuswordpro/source/filter/lwptaboverride.hxx   |4 
 lotuswordpro/source/filter/lwptblcell.hxx   |4 
 lotuswordpro/source/filter/lwpuidoc.hxx |2 --
 lotuswordpro/source/filter/lwpusrdicts.hxx  |1 -
 lotuswordpro/source/filter/tocread.hxx  |1 -
 lotuswordpro/source/filter/xfilter/xfchange.hxx |6 --
 lotuswordpro/source/filter/xfilter/xffontworkstyle.hxx  |2 --
 lotuswordpro/source/filter/xfilter/xfofficemeta.hxx |1 -
 lotuswordpro/source/filter/xfilter/xfrubystyle.hxx  |1 -
 lotuswordpro/source/filter/xfilter/xftimestyle.hxx  |4 
 52 files changed, 117 deletions(-)

New commits:
commit c5df32e5cb6ef9727e566541d6cf29dbd5c32602
Author: Noel Grandin 
Date:   Tue Jan 24 13:44:18 2017 +0200

loplugin: unnecessary destructor jvmfwk..lotuswordpro

Change-Id: Iaa4f9b178ab265342255066af7fff09f5b33ab37
Reviewed-on: https://gerrit.libreoffice.org/33496
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/jvmfwk/source/framework.hxx b/jvmfwk/source/framework.hxx
index 9d152c8..8e43305 100644
--- a/jvmfwk/source/framework.hxx
+++ b/jvmfwk/source/framework.hxx
@@ -110,7 +110,6 @@ public:
 errorCode(err), message(msg)
 {
 }
-virtual ~FrameworkException() throw () override {}
 javaFrameworkError errorCode;
 OString message;
 };
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index d04d85c..4e95a5f 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -246,10 +246,6 @@ class MergeDataHashMap
 {
 }
 
-~MergeDataHashMap()
-{
-}
-
 typedef HashMap_t::iterator iterator;
 typedef HashMap_t::const_iterator const_iterator;
 
diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx
index 89c8543..f5af853 100644
--- a/l10ntools/inc/helpmerge.hxx
+++ b/l10ntools/inc/helpmerge.hxx
@@ -41,7 +41,6 @@ private:
 
 public:
 

[Libreoffice-commits] core.git: jvmfwk/source l10ntools/inc l10ntools/source linguistic/source oox/inc oox/source reportdesign/source sax/source

2017-01-16 Thread Noel Grandin
 jvmfwk/source/elements.cxx   |1 -
 l10ntools/inc/export.hxx |4 ++--
 l10ntools/inc/po.hxx |2 +-
 l10ntools/source/merge.cxx   |1 -
 l10ntools/source/po.cxx  |1 -
 linguistic/source/misc.cxx   |7 +++
 oox/inc/drawingml/chart/datasourcecontext.hxx|5 +++--
 oox/source/drawingml/chart/datasourcecontext.cxx |7 +++
 reportdesign/source/core/sdr/ModuleHelper.cxx|7 +++
 sax/source/expatwrap/sax_expat.cxx   |   16 
 sax/source/expatwrap/saxwriter.cxx   |   11 +++
 11 files changed, 22 insertions(+), 40 deletions(-)

New commits:
commit 90df5ee10727719aa1407ed4d1f06d7a790d6871
Author: Noel Grandin 
Date:   Mon Jan 16 14:16:55 2017 +0200

new loplugin: useuniqueptr: jvmfwk..sax

Change-Id: I732e2e22c6f953f0982fbc8833453e7c23cf9d49
Reviewed-on: https://gerrit.libreoffice.org/33166
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index 452ae31..b5846f1 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -174,7 +174,6 @@ VersionInfo::VersionInfo(): arVersions(nullptr)
 
 VersionInfo::~VersionInfo()
 {
-delete [] arVersions;
 }
 
 void VersionInfo::addExcludeVersion(const OUString& sVersion)
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 220259c..d04d85c 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -282,13 +282,13 @@ class MergeData
 public:
 OString sGID;
 OString sLID;
-MergeEntrys* pMergeEntrys;
+std::unique_ptr pMergeEntrys;
 private:
 MergeDataHashMap::iterator m_aNextData;
 public:
 MergeData( const OString , const OString  );
 ~MergeData();
-MergeEntrys* GetMergeEntries() { return pMergeEntrys;}
+MergeEntrys* GetMergeEntries() { return pMergeEntrys.get();}
 
 };
 
diff --git a/l10ntools/inc/po.hxx b/l10ntools/inc/po.hxx
index ce1443d..52c644f 100644
--- a/l10ntools/inc/po.hxx
+++ b/l10ntools/inc/po.hxx
@@ -78,7 +78,7 @@ class PoHeader
 {
 private:
 
-GenPoEntry* m_pGenPo;
+std::unique_ptr m_pGenPo;
 bool m_bIsInitialized;
 
 public:
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 9d04e16..955fca6 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -207,7 +207,6 @@ MergeData::MergeData(const OString ,
 
 MergeData::~MergeData()
 {
-delete pMergeEntrys;
 }
 
 
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index 81ecdcd..87b78dd 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -419,7 +419,6 @@ PoHeader::PoHeader( const OString& rExtSrc )
 
 PoHeader::~PoHeader()
 {
-delete m_pGenPo;
 }
 
 PoOfstream::PoOfstream()
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index 6fe170c..4ceb55b 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -124,8 +124,8 @@ static inline sal_Int32 Minimum( sal_Int32 n1, sal_Int32 
n2, sal_Int32 n3 )
 class IntArray2D
 {
 private:
-sal_Int32  *pData;
-int n1, n2;
+std::unique_ptr  pData;
+int   n1, n2;
 
 public:
 IntArray2D( int nDim1, int nDim2 );
@@ -138,12 +138,11 @@ IntArray2D::IntArray2D( int nDim1, int nDim2 )
 {
 n1 = nDim1;
 n2 = nDim2;
-pData = new sal_Int32[n1 * n2];
+pData.reset( new sal_Int32[n1 * n2] );
 }
 
 IntArray2D::~IntArray2D()
 {
-delete[] pData;
 }
 
 sal_Int32 & IntArray2D::Value( int i, int k  )
diff --git a/oox/inc/drawingml/chart/datasourcecontext.hxx 
b/oox/inc/drawingml/chart/datasourcecontext.hxx
index 5f4b7f7..2704ccf 100644
--- a/oox/inc/drawingml/chart/datasourcecontext.hxx
+++ b/oox/inc/drawingml/chart/datasourcecontext.hxx
@@ -45,11 +45,12 @@ public:
 virtual voidonCharacters( const OUString& rChars ) override;
 
 private:
-SvNumberFormatter* getNumberFormatter();
+SvNumberFormatter*  getNumberFormatter();
 
 private:
 sal_Int32   mnPtIndex;  /// Current data point index.
-SvNumberFormatter*   mpNumberFormatter;
+std::unique_ptr
+mpNumberFormatter;
 };
 
 
diff --git a/oox/source/drawingml/chart/datasourcecontext.cxx 
b/oox/source/drawingml/chart/datasourcecontext.cxx
index f5854df..f54ba84 100644
--- a/oox/source/drawingml/chart/datasourcecontext.cxx
+++ b/oox/source/drawingml/chart/datasourcecontext.cxx
@@ -47,7 +47,6 @@ DoubleSequenceContext::DoubleSequenceContext( 
ContextHandler2Helper& rParent, Da
 
 DoubleSequenceContext::~DoubleSequenceContext()
 {
-delete mpNumberFormatter;
 }
 
 ContextHandlerRef DoubleSequenceContext::onCreateContext( sal_Int32 nElement, 
const AttributeList& rAttribs )
@@ -157,10 +156,10 @@ 

[Libreoffice-commits] core.git: jvmfwk/source

2016-04-05 Thread Stephan Bergmann
 jvmfwk/source/fwkutil.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 6858d559fe1d2a0b7163ad0c04be4f123c68bf21
Author: Stephan Bergmann 
Date:   Tue Apr 5 17:05:34 2016 +0200

Values read from the Windows registry shouldn't be assert'ed

Change-Id: I1a6cc78025790fa22e91ae91dda5644bdc384ca3

diff --git a/jvmfwk/source/fwkutil.cxx b/jvmfwk/source/fwkutil.cxx
index 9c026de..8bbcf60 100644
--- a/jvmfwk/source/fwkutil.cxx
+++ b/jvmfwk/source/fwkutil.cxx
@@ -83,7 +83,7 @@ bool isAccessibilitySupportDesired()
  || strcmp((char*) arData, "0") == 0)
 retVal = false;
 else
-assert(0);
+SAL_WARN("jfw", "bad registry value " << arData);
 }
 else if (dwType == REG_DWORD)
 {
@@ -92,7 +92,8 @@ bool isAccessibilitySupportDesired()
 else if (arData[0] == 0)
 retVal = false;
 else
-assert(0);
+SAL_WARN(
+"jfw", "bad registry value " << unsigned(arData[0]));
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source

2016-03-14 Thread Rohan Kumar
 jvmfwk/source/fwkutil.cxx |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 20efe5ebcbc49ef3ea46bb13b8aec05c81b86308
Author: Rohan Kumar 
Date:   Mon Mar 14 11:36:12 2016 +0530

tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals

I replaced OSL_ASSERT() with standard C++ assert

Change-Id: I92e07d62f3dfe2ad914c49e2b596aef28c35e225
Reviewed-on: https://gerrit.libreoffice.org/23231
Tested-by: Jenkins 
Reviewed-by: Björn Michaelsen 

diff --git a/jvmfwk/source/fwkutil.cxx b/jvmfwk/source/fwkutil.cxx
index 591a12a..9c026de 100644
--- a/jvmfwk/source/fwkutil.cxx
+++ b/jvmfwk/source/fwkutil.cxx
@@ -82,10 +82,8 @@ bool isAccessibilitySupportDesired()
 else if (strcmp((char*) arData, "false") == 0
  || strcmp((char*) arData, "0") == 0)
 retVal = false;
-#if OSL_DEBUG_LEVEL > 1
 else
-OSL_ASSERT(0);
-#endif
+assert(0);
 }
 else if (dwType == REG_DWORD)
 {
@@ -93,10 +91,8 @@ bool isAccessibilitySupportDesired()
 retVal = true;
 else if (arData[0] == 0)
 retVal = false;
-#if OSL_DEBUG_LEVEL > 1
 else
-OSL_ASSERT(0);
-#endif
+assert(0);
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source

2014-12-15 Thread Stephan Bergmann
 jvmfwk/source/framework.cxx |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 8814eb4770403dc2c210feb3a3dd2b5078c27c59
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Dec 15 13:18:56 2014 +0100

Remove unused cModule leftovers

Change-Id: Id08194460e9a42896591047e36b3a95e5fbc47be

diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 05dd3fd..d43423d 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -76,9 +76,8 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo 
***pparInfo, sal_Int32 *pSi
 settings.getJRELocations();
 //Use every plug-in library to get Java installations.
 typedef std::vectorOUString::const_iterator ci_pl;
-int cModule = 0;
- for (ci_pl i = vecVendors.begin(); i != vecVendors.end(); ++i, 
++cModule)
- {
+for (ci_pl i = vecVendors.begin(); i != vecVendors.end(); ++i)
+{
 const OUString  vendor = *i;
 jfw::VersionInfo versionInfo =
 aVendorSettings.getVersionInformation(vendor);
@@ -393,8 +392,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo 
**pInfo)
 //Use every vendor to get Java installations. At the first usable
 //Java the loop will break
 typedef std::vectorOUString::const_iterator ci_pl;
-int cModule = 0;
-for (ci_pl i = vecVendors.begin(); i != vecVendors.end(); ++i, 
++cModule)
+for (ci_pl i = vecVendors.begin(); i != vecVendors.end(); ++i)
 {
 const OUString  vendor = *i;
 jfw::VersionInfo versionInfo =
@@ -660,9 +658,7 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath(
 //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::vectorOUString::const_iterator ci_pl;
-int cModule = 0;
-for (ci_pl i = vecVendors.begin(); i != vecVendors.end();
- ++i, ++cModule)
+for (ci_pl i = vecVendors.begin(); i != vecVendors.end(); ++i)
 {
 const OUString  vendor = *i;
 jfw::VersionInfo versionInfo =
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source

2014-10-13 Thread Caolán McNamara
 jvmfwk/source/framework.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 1156d11ef0bb2bc3d71ae9299656db4fed66f073
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Oct 13 10:31:14 2014 +0100

coverity#1066164 Resource leak

Change-Id: I152f22728a8eeea65114fe102511940bccf40478
Signed-off-by: Stephan Bergmann sberg...@redhat.com

diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index bdb75f7..a604164 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -732,6 +732,8 @@ javaFrameworkError SAL_CALL jfw_setSelectedJRE(JavaInfo 
const *pInfo)
 //remember that the JRE was selected in this process
 jfw::setJavaSelected();
 }
+
+jfw_freeJavaInfo(currentInfo);
 }
 catch (const jfw::FrameworkException e)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source

2014-09-03 Thread Stephan Bergmann
 jvmfwk/source/framework.hxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 07dbd2076bb879def2710b7784ac706940b55886
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Sep 3 10:20:31 2014 +0200

Nothrow dtor

Change-Id: I1793d2eab568f4a65813fca7257c74e1a85a0090

diff --git a/jvmfwk/source/framework.hxx b/jvmfwk/source/framework.hxx
index 6e4fcad..808bff5 100644
--- a/jvmfwk/source/framework.hxx
+++ b/jvmfwk/source/framework.hxx
@@ -113,6 +113,7 @@ public:
 errorCode(err), message(msg)
 {
 }
+virtual ~FrameworkException() throw () {}
 javaFrameworkError errorCode;
 OString message;
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source

2014-06-27 Thread Stephan Bergmann
 jvmfwk/source/fwkbase.hxx |2 --
 jvmfwk/source/fwkutil.hxx |2 --
 2 files changed, 4 deletions(-)

New commits:
commit e4b7da8da851371bd09f4d0e1721626667e56605
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Jun 27 08:59:59 2014 +0200

Dead declarations

Change-Id: I43e388df118b9e08ab8c05cad31871ef0af35164

diff --git a/jvmfwk/source/fwkbase.hxx b/jvmfwk/source/fwkbase.hxx
index 86fde79..89e7b57 100644
--- a/jvmfwk/source/fwkbase.hxx
+++ b/jvmfwk/source/fwkbase.hxx
@@ -120,8 +120,6 @@ OString getSharedSettingsPath();
  */
 OString getVendorSettingsPath();
 
-OUString buildClassPathFromDirectory(const OUString  relPath);
-
 /** Called from writeJavaInfoData. It sets the process identifier. When
 java is to be started, then the current id is compared to the one set by
 this function. If they are identical then the Java was selected in the
diff --git a/jvmfwk/source/fwkutil.hxx b/jvmfwk/source/fwkutil.hxx
index e786943..8bd3466 100644
--- a/jvmfwk/source/fwkutil.hxx
+++ b/jvmfwk/source/fwkutil.hxx
@@ -122,8 +122,6 @@ FileStatus checkFileURL(const OUString  path);
 
 bool isAccessibilitySupportDesired();
 
-OUString buildClassPathFromDirectory(const OUString  relPath);
-
 OUString retrieveClassPath( OUString const  macro );
 }
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/source l10ntools/source lingucomponent/source

2014-04-21 Thread Takeshi Abe
 jvmfwk/source/fwkutil.cxx |   13 +++-
 l10ntools/source/xrmmerge.cxx |8 ++--
 lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx |   29 +-
 3 files changed, 19 insertions(+), 31 deletions(-)

New commits:
commit 1a5457a11c062be8c41cc00813c092b78aa42b8b
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Mon Apr 21 22:29:09 2014 +0900

Avoid possible memory leaks in case of exceptions

Change-Id: I4b2b439615db0ff4598f405d1e339eebbff7ae91

diff --git a/jvmfwk/source/fwkutil.cxx b/jvmfwk/source/fwkutil.cxx
index d7ca9ff..4edb4e8 100644
--- a/jvmfwk/source/fwkutil.cxx
+++ b/jvmfwk/source/fwkutil.cxx
@@ -46,6 +46,7 @@
 
 #include framework.hxx
 #include fwkutil.hxx
+#include boost/scoped_array.hpp
 
 using namespace osl;
 
@@ -114,10 +115,10 @@ rtl::ByteSequence encodeBase16(const rtl::ByteSequence 
rawData)
 static const char EncodingTable[] =
 {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
 sal_Int32 lenRaw = rawData.getLength();
-char* pBuf = new char[lenRaw * 2];
+boost::scoped_arraychar pBuf(new char[lenRaw * 2]);
 const sal_Int8* arRaw = rawData.getConstArray();
 
-char* pCurBuf = pBuf;
+char* pCurBuf = pBuf.get();
 for (int i = 0; i  lenRaw; i++)
 {
 unsigned char curChar = arRaw[i];
@@ -133,8 +134,7 @@ rtl::ByteSequence encodeBase16(const rtl::ByteSequence 
rawData)
 pCurBuf++;
 }
 
-rtl::ByteSequence ret((sal_Int8*) pBuf, lenRaw * 2);
-delete [] pBuf;
+rtl::ByteSequence ret((sal_Int8*) pBuf.get(), lenRaw * 2);
 return ret;
 }
 
@@ -144,7 +144,7 @@ rtl::ByteSequence decodeBase16(const rtl::ByteSequence 
data)
 {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
 sal_Int32 lenData = data.getLength();
 sal_Int32 lenBuf = lenData / 2; //always divisable by two
-unsigned char* pBuf = new unsigned char[lenBuf];
+boost::scoped_arrayunsigned char pBuf(new unsigned char[lenBuf]);
 const sal_Int8* pData = data.getConstArray();
 for (sal_Int32 i = 0; i  lenBuf; i++)
 {
@@ -173,8 +173,7 @@ rtl::ByteSequence decodeBase16(const rtl::ByteSequence 
data)
 }
 pBuf[i] = nibble;
 }
-rtl::ByteSequence ret((sal_Int8*) pBuf, lenBuf );
-delete [] pBuf;
+rtl::ByteSequence ret((sal_Int8*) pBuf.get(), lenBuf );
 return ret;
 }
 
diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx
index f3705fa..37190fb 100644
--- a/l10ntools/source/xrmmerge.cxx
+++ b/l10ntools/source/xrmmerge.cxx
@@ -33,6 +33,7 @@
 #include iostream
 #include fstream
 #include vector
+#include boost/scoped_array.hpp
 
 using namespace std;
 
@@ -327,13 +328,12 @@ void XRMResExport::WorkOnDesc(
 ifstream file (sDescFileName.getStr(), ios::in|ios::binary|ios::ate);
 if (file.is_open()) {
 int size = static_castint(file.tellg());
-char* memblock = new char [size+1];
+boost::scoped_arraychar memblock(new char [size+1]);
 file.seekg (0, ios::beg);
-file.read (memblock, size);
+file.read (memblock.get(), size);
 file.close();
 memblock[size] = '\0';
-rText = OString(memblock);
-delete[] memblock;
+rText = OString(memblock.get());
  }
 WorkOnText( rOpenTag, rText );
 EndOfText( rOpenTag, rOpenTag );
diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx 
b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
index b74b2da..40f7dd2 100644
--- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
+++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
@@ -47,6 +47,7 @@
 
 #include list
 #include set
+#include boost/scoped_array.hpp
 
 using namespace utl;
 using namespace osl;
@@ -253,8 +254,6 @@ Reference XHyphenatedWord  SAL_CALL 
Hyphenator::hyphenate( const OUString aWo
 int nHyphenationPosAlt = -1;
 int nHyphenationPosAltHyph = -1;
 int wordlen;
-char *hyphens;
-char *lcword;
 int k = 0;
 
 PropertyHelper_Hyphenation rHelper = GetPropHelper();
@@ -341,15 +340,15 @@ Reference XHyphenatedWord  SAL_CALL 
Hyphenator::hyphenate( const OUString aWo
 OString encWord(OU2ENC(nTerm,eEnc));
 
 wordlen = encWord.getLength();
-lcword = new char[wordlen + 1];
-hyphens = new char[wordlen + 5];
+boost::scoped_arraychar lcword(new char[wordlen + 1]);
+boost::scoped_arraychar hyphens(new char[wordlen + 5]);
 
 char ** rep = NULL; // replacements of discretionary hyphenation
 int * pos = NULL; // array of [hyphenation point] minus [deletion 
position]
 int * cut = NULL; // length of deletions in original word
 
 // copy converted word into simple char buffer
-strcpy(lcword,encWord.getStr());
+strcpy(lcword.get(),encWord.getStr());
 
 // now strip off any ending periods
 int n = wordlen-1;
@@ -358,15 +357,13 @@ Reference 

[Libreoffice-commits] core.git: jvmfwk/source

2013-03-22 Thread Tor Lillqvist
 jvmfwk/source/framework.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 55e95d1dcbfd155566bb9d7879d9a4a39b9a2cd7
Author: Tor Lillqvist t...@iki.fi
Date:   Fri Mar 22 08:25:43 2013 +0200

warning: unknown log area 'jvmfwk' [loplugin]

This is not a warning that would stop an --enable-werror build, but still
worth fixing.

Change-Id: I6c47fd636f57f55cbe406f51e2f24e015924ce14

diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index b4dde95..ac9f59d 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -460,7 +460,7 @@ javaFrameworkError SAL_CALL jfw_startVM(
 
 //start Java
 JavaVM *pVm = NULL;
-SAL_INFO(jvmfwk, starting java);
+SAL_INFO(jfw, Starting Java);
 javaPluginError plerr = (*pFunc)(pInfo, arOpt, index,  pVm, ppEnv);
 if (plerr == JFW_PLUGIN_E_VM_CREATION_FAILED)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits