[Libreoffice-commits] core.git: jvmfwk/plugins jvmfwk/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Tue Apr 7 13:13:15 UTC 2020
jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 60 ++++++++++++++---------------
jvmfwk/source/fwkbase.cxx | 34 ++++++++--------
2 files changed, 47 insertions(+), 47 deletions(-)
New commits:
commit 21eb6c98bcfb1d453f8eb9f73bd87f6dd87aa882
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Apr 7 14:16:40 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Apr 7 15:12:35 2020 +0200
loplugin:flatten in jvmfwk
Change-Id: Ic58bc539ad6b4e1ef1d8049ec97547d1420be8a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91817
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index ff540cc52325..db855d9ce4f4 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -1049,44 +1049,44 @@ void addJavaInfosFromPath(
#if !defined JVM_ONE_PATH_CHECK
// Get Java from PATH environment variable
char *szPath= getenv("PATH");
- if(szPath)
+ if(!szPath)
+ return;
+
+ OUString usAllPath(szPath, strlen(szPath), osl_getThreadTextEncoding());
+ sal_Int32 nIndex = 0;
+ do
{
- OUString usAllPath(szPath, strlen(szPath), osl_getThreadTextEncoding());
- sal_Int32 nIndex = 0;
- do
+ OUString usToken = usAllPath.getToken( 0, SAL_PATHSEPARATOR, nIndex );
+ OUString usTokenUrl;
+ if(File::getFileURLFromSystemPath(usToken, usTokenUrl) == File::E_None)
{
- OUString usToken = usAllPath.getToken( 0, SAL_PATHSEPARATOR, nIndex );
- OUString usTokenUrl;
- if(File::getFileURLFromSystemPath(usToken, usTokenUrl) == File::E_None)
+ if(!usTokenUrl.isEmpty())
{
- if(!usTokenUrl.isEmpty())
+ OUString usBin;
+ if(usTokenUrl == ".")
{
- OUString usBin;
- if(usTokenUrl == ".")
- {
- OUString usWorkDirUrl;
- if(osl_Process_E_None == osl_getProcessWorkingDir(&usWorkDirUrl.pData))
- usBin= usWorkDirUrl;
- }
- else if(usTokenUrl == "..")
- {
- OUString usWorkDir;
- if(osl_Process_E_None == osl_getProcessWorkingDir(&usWorkDir.pData))
- usBin= getDirFromFile(usWorkDir);
- }
- else
- {
- usBin = usTokenUrl;
- }
- if(!usBin.isEmpty())
- {
- addJREInfoFromBinPath(usBin, allInfos, addedInfos);
- }
+ OUString usWorkDirUrl;
+ if(osl_Process_E_None == osl_getProcessWorkingDir(&usWorkDirUrl.pData))
+ usBin= usWorkDirUrl;
+ }
+ else if(usTokenUrl == "..")
+ {
+ OUString usWorkDir;
+ if(osl_Process_E_None == osl_getProcessWorkingDir(&usWorkDir.pData))
+ usBin= getDirFromFile(usWorkDir);
+ }
+ else
+ {
+ usBin = usTokenUrl;
+ }
+ if(!usBin.isEmpty())
+ {
+ addJREInfoFromBinPath(usBin, allInfos, addedInfos);
}
}
}
- while ( nIndex >= 0 );
}
+ while ( nIndex >= 0 );
#endif
}
diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index 332d84ebb07b..7f3cd0a132ae 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -94,23 +94,23 @@ VendorSettings::VendorSettings()
SAL_WARN( "jfw", sMsg );
throw FrameworkException(JFW_E_CONFIGURATION, sMsg);
}
- if (!sSettingsPath.isEmpty())
- {
- m_xmlDocVendorSettings = xmlParseFile(sSettingsPath.getStr());
- if (m_xmlDocVendorSettings == nullptr)
- throw FrameworkException(
- JFW_E_ERROR,
- OStringLiteral("[Java framework] Error while parsing file: ")
- + sSettingsPath + ".");
-
- m_xmlPathContextVendorSettings = xmlXPathNewContext(m_xmlDocVendorSettings);
- int res = xmlXPathRegisterNs(
- m_xmlPathContextVendorSettings, reinterpret_cast<xmlChar const *>("jf"),
- reinterpret_cast<xmlChar const *>(NS_JAVA_FRAMEWORK));
- if (res == -1)
- throw FrameworkException(JFW_E_ERROR,
- "[Java framework] Error in constructor VendorSettings::VendorSettings() (fwkbase.cxx)");
- }
+ if (sSettingsPath.isEmpty())
+ return;
+
+ m_xmlDocVendorSettings = xmlParseFile(sSettingsPath.getStr());
+ if (m_xmlDocVendorSettings == nullptr)
+ throw FrameworkException(
+ JFW_E_ERROR,
+ OStringLiteral("[Java framework] Error while parsing file: ")
+ + sSettingsPath + ".");
+
+ m_xmlPathContextVendorSettings = xmlXPathNewContext(m_xmlDocVendorSettings);
+ int res = xmlXPathRegisterNs(
+ m_xmlPathContextVendorSettings, reinterpret_cast<xmlChar const *>("jf"),
+ reinterpret_cast<xmlChar const *>(NS_JAVA_FRAMEWORK));
+ if (res == -1)
+ throw FrameworkException(JFW_E_ERROR,
+ "[Java framework] Error in constructor VendorSettings::VendorSettings() (fwkbase.cxx)");
}
std::optional<VersionInfo> VendorSettings::getVersionInformation(const OUString & sVendor) const
More information about the Libreoffice-commits
mailing list