[Libreoffice-commits] core.git: cui/source cui/uiconfig include/jvmfwk jvmfwk/inc jvmfwk/plugins jvmfwk/source
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 15 21:30:16 UTC 2020
cui/source/options/optjava.cxx | 5 --
cui/uiconfig/ui/optadvancedpage.ui | 17 --------
include/jvmfwk/framework.hxx | 37 +------------------
jvmfwk/inc/elements.hxx | 1
jvmfwk/inc/vendorbase.hxx | 2 -
jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java | 24 ------------
jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx | 18 ++-------
jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx | 1
jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 18 +--------
jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx | 25 ++----------
jvmfwk/source/elements.cxx | 26 ++++---------
jvmfwk/source/framework.cxx | 6 ---
12 files changed, 23 insertions(+), 157 deletions(-)
New commits:
commit 3bc8b14bea3c11159bdbd6fc4f9658fce3ba252e
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri May 15 20:09:43 2020 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri May 15 23:29:36 2020 +0200
Drop the JVM "feature" concept support
...now that 6ba74150866d71469827de9f4f19268dfa7db137
"jfw::isAccessibilitySupportDesired is obsolete" demonstrated that there is no
more need for JFW_FEATURE_ACCESSBRIDGE, the sole feature that had been provided.
* The javasettings_*.xml format still supports the <feature> tag, but it is
ignored when reading and always written as "0".
* There is no trace that "the bootstrap parameter
JFW_PLUGIN_NO_NOT_CHECK_ACCESSIBILITY" whose mention gets removed from
jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java had ever been supported.
(The only mention was 6873b3be47d71f94c38262003101576081acd241 "INTEGRATION:
CWS jre5issues (1.3.18); FILE MERGED: 2005/01/18 12:48:48 jl 1.3.18.1:
#i40879# in build environment the JRE is not tested for accessibility, because
of potential X server problems" introducing that comment.)
* The "Features" column is removed from the JRE table on the "LibreOffice -
Advance" options page.
Change-Id: I332d34b60548e7f2f852241ea8edfbee0ffcf510
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94329
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 8c0060fcdd01..256328fd6e53 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -93,7 +93,6 @@ SvxJavaOptionsPage::SvxJavaOptionsPage(weld::Container* pPage, weld::DialogContr
std::vector<int> aWidths;
aWidths.push_back(m_xJavaList->get_checkbox_column_width());
aWidths.push_back(m_xJavaList->get_pixel_size("Sun Microsystems Inc.").Width());
- aWidths.push_back(m_xJavaList->get_pixel_size("0.0.0_00-icedtea").Width());
m_xJavaList->set_column_fixed_widths(aWidths);
std::vector<int> aRadioColumns;
@@ -361,10 +360,6 @@ void SvxJavaOptionsPage::AddJRE( JavaInfo const * _pInfo )
m_xJavaList->set_toggle(nPos, TRISTATE_FALSE, 0);
m_xJavaList->set_text(nPos, _pInfo->sVendor, 1);
m_xJavaList->set_text(nPos, _pInfo->sVersion, 2);
- OUString sFeature;
- if ((_pInfo->nFeatures & JFW_FEATURE_ACCESSBRIDGE) == JFW_FEATURE_ACCESSBRIDGE)
- sFeature = m_sAccessibilityText;
- m_xJavaList->set_text(nPos, sFeature, 3);
INetURLObject aLocObj(_pInfo->sLocation);
OUString sLocation = aLocObj.getFSysPath(FSysStyle::Detect);
diff --git a/cui/uiconfig/ui/optadvancedpage.ui b/cui/uiconfig/ui/optadvancedpage.ui
index cd4359b9ae6d..279a23a5a20d 100644
--- a/cui/uiconfig/ui/optadvancedpage.ui
+++ b/cui/uiconfig/ui/optadvancedpage.ui
@@ -10,8 +10,6 @@
<column type="gchararray"/>
<!-- column-name text2 -->
<column type="gchararray"/>
- <!-- column-name text3 -->
- <column type="gchararray"/>
<!-- column-name id -->
<column type="gchararray"/>
<!-- column-name checkvis1 -->
@@ -196,7 +194,7 @@
<property name="radio">True</property>
</object>
<attributes>
- <attribute name="visible">5</attribute>
+ <attribute name="visible">4</attribute>
<attribute name="active">0</attribute>
</attributes>
</child>
@@ -228,19 +226,6 @@
</child>
</object>
</child>
- <child>
- <object class="GtkTreeViewColumn" id="treeviewcolumn2">
- <property name="resizable">True</property>
- <property name="spacing">6</property>
- <property name="title" translatable="yes" context="optadvancedpage|features">Features</property>
- <child>
- <object class="GtkCellRendererText" id="cellrenderer2"/>
- <attributes>
- <attribute name="text">3</attribute>
- </attributes>
- </child>
- </object>
- </child>
</object>
</child>
</object>
diff --git a/include/jvmfwk/framework.hxx b/include/jvmfwk/framework.hxx
index 0b02a9e04447..08baf8f23d67 100644
--- a/include/jvmfwk/framework.hxx
+++ b/include/jvmfwk/framework.hxx
@@ -159,11 +159,6 @@
mentioned differently.</p>
*/
-/** indicates that a JRE has an accessibility bridge installed.
- <p>
- The flag is used with JavaInfo::nFeatures.</p>
- */
-#define JFW_FEATURE_ACCESSBRIDGE 0x1l
/** indicates that there must be an environment set up before the Java process
runs.
<p>Therefore, when a Java is selected in OO then the office must be
@@ -218,12 +213,6 @@ struct JavaInfo
</p>
*/
OUString sVersion;
- /** indicates supported special features.
-
- <p>For example, <code>JFW_FEATURE_ACCESSBRIDGE</code> indicates that
- assistive technology tools are supported.</p>
- */
- sal_uInt64 nFeatures;
/** indicates requirements for running the java runtime.
<p>For example, it may be necessary to prepare the environment before
@@ -288,9 +277,7 @@ JVMFWK_DLLPUBLIC bool jfw_isVMRunning();
which contains version requirements.</p>
<p>
JREs can be provided by different vendors.
- The function obtains information about JRE installations and checks if
- there is one among them that supports
- a set of features (currently only accessibility is possible). If none was
+ The function obtains information about JRE installations. If none was
found then it also uses a list of paths, which have been registered
by <code>jfw_addJRELocation</code>
to find JREs. Found JREs are examined in the same way.</p>
@@ -310,27 +297,7 @@ JVMFWK_DLLPUBLIC bool jfw_isVMRunning();
the PATH environment variable is inspected and the respective JREs
are checked for their suitability next.</p>
<p>
- When support for assistive technology is required, then the
- <code>JavaInfo</code> objects,
- which are provided by the <code>getJavaInfo</code> functions, are
- examined for a suitable JRE.
- That is, the <code>JavaInfo</code> object that refers to the JRE referred to
- by JAVA_HOME is examined. If it does not have the flag
- <code>JFW_FEATURE_ACCESSBRIDGE</code> in the member <code>nFeatures</code>
- then the <JavaInfo></code> objects that are related to the PATH variable
- are examined.
- If no suitable <code>JavaInfo</code> object is found, all <code>JavaInfo</code>
- objects - representing Java installations on the system -, are examined.
- As long as no <code>JavaInfo</code> object has the flag
- <code>JFW_FEATURE_ACCESSBRIDGE</code> in the member <code>nFeatures</code>, more
- <code>JavaInfo</code> objects are examined.
- This goes on until a <code>JavaInfo</code> object was found which
- represents a suitable JRE. Or no such <code>JavaInfo</code> object was found.
- In that case the first <code>JavaInfo</code> object that was detected
- by the algorithm described above is used to determine the JRE which is to be used.</p>
- <p>
- If there is no need for the support of assistive technology tools then
- the first <code>JavaInfo</code> object that is detected by the algorithm
+ The first <code>JavaInfo</code> object that is detected by the algorithm
as described above is used.</p>
@param pInfo
diff --git a/jvmfwk/inc/elements.hxx b/jvmfwk/inc/elements.hxx
index eeaff7c4b835..800ecaf697fb 100644
--- a/jvmfwk/inc/elements.hxx
+++ b/jvmfwk/inc/elements.hxx
@@ -84,7 +84,6 @@ public:
OUString sVendor;
OUString sLocation;
OUString sVersion;
- sal_uInt64 nFeatures;
sal_uInt64 nRequirements;
::rtl::ByteSequence arVendorData;
diff --git a/jvmfwk/inc/vendorbase.hxx b/jvmfwk/inc/vendorbase.hxx
index 374a3cbcf655..df536bc3477e 100644
--- a/jvmfwk/inc/vendorbase.hxx
+++ b/jvmfwk/inc/vendorbase.hxx
@@ -124,7 +124,6 @@ public:
const OUString & getHome() const;
const OUString & getRuntimeLibrary() const;
const OUString & getLibraryPath() const;
- bool supportsAccessibility() const;
bool isValidArch() const;
/* determines if prior to running java something has to be done,
like setting the LD_LIBRARY_PATH. This implementation checks
@@ -172,7 +171,6 @@ protected:
OUString m_sRuntimeLibrary;
OUString m_sLD_LIBRARY_PATH;
OUString m_sArch;
- bool m_bAccessibility;
typedef rtl::Reference<VendorBase> (* createInstance_func) ();
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
index dfb27e941b8b..0d3503af385f 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
+++ b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
@@ -35,30 +35,6 @@ public class JREProperties
{
try
{
- boolean bNoAccess = false;
- if(args.length > 0 && args[0].equals("noaccessibility")) {
- bNoAccess = true;
- }
-
- //We need to be able to switch this part off because
- //it causes an exception if the DISPLAY variable has
- //a false value. Setting the noaccessibility argument
- //can be done by providing a sunjavaplugin.ini with
- //the bootstrap parameter JFW_PLUGIN_NO_NOT_CHECK_ACCESSIBILITY
- //set to "1"
- if (!bNoAccess)
- {
- try{
- //This line is needed to get the accessibility properties
- java.awt.Toolkit.getDefaultToolkit();
- }
- catch(Throwable e)
- {
- System.err.println(e);
- }
- }
-
-
Properties p = System.getProperties();
Enumeration e = p.propertyNames();
while (e.hasMoreElements()) {
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
index d9c0e7d5d25f..19cc9bf5d674 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
@@ -92,8 +92,8 @@ char const* const* GnuInfo::getLibraryPaths(int* /*size*/)
bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
{
- //get java.vendor, java.version, java.home,
- //javax.accessibility.assistive_technologies from system properties
+ //get java.vendor, java.version, java.home
+ //from system properties
OUString sJavaLibraryPath;
OUString const sVendorProperty("java.vendor");
@@ -101,14 +101,12 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
OUString const sJavaHomeProperty("java.home");
OUString const sJavaLibraryPathProperty("java.library.path");
OUString const sGNUHomeProperty("gnu.classpath.home.url");
- OUString const sAccessProperty("javax.accessibility.assistive_technologies");
bool bVersion = false;
bool bVendor = false;
bool bHome = false;
bool bJavaHome = false;
bool bJavaLibraryPath = false;
- bool bAccess = false;
for (auto const& prop : props)
{
@@ -149,17 +147,9 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
osl_getFileURLFromSystemPath(prop.second.getToken(0, ':', nIndex).pData, &sJavaLibraryPath.pData);
bJavaLibraryPath = true;
}
- else if (!bAccess && sAccessProperty == prop.first)
- {
- if (!prop.second.isEmpty())
- {
- m_bAccessibility = true;
- bAccess = true;
- }
+ if (bVendor && bVersion && bHome && bJavaHome && bJavaLibraryPath) {
+ break;
}
- // the javax.accessibility.xxx property may not be set. Therefore we
- //must search through all properties.
-
}
if (!bVersion || !bVendor || !bHome)
return false;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 46f5cfba1281..1d3667988cf9 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -168,7 +168,6 @@ std::unique_ptr<JavaInfo> createJavaInfo(
return std::unique_ptr<JavaInfo>(
new JavaInfo{
info->getVendor(), info->getHome(), info->getVersion(),
- sal_uInt64(info->supportsAccessibility() ? JFW_FEATURE_ACCESSBRIDGE : 0),
sal_uInt64(info->needsRestart() ? JFW_REQUIRE_NEEDRESTART : 0),
rtl::ByteSequence(
reinterpret_cast<sal_Int8*>(sVendorData.pData->buffer),
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index db855d9ce4f4..3b7a2beb2314 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -383,26 +383,12 @@ bool getJavaProps(const OUString & exePath,
sClassPath += "/../Resources/java";
#endif
-#ifdef UNX
- // Java is no longer required for a11y - we use atk directly.
- bool bNoAccessibility = true;
-#else
- bool bNoAccessibility = false;
-#endif
-
//prepare the arguments
- sal_Int32 cArgs = 3;
+ sal_Int32 const cArgs = 3;
OUString arg1 = "-classpath";// + sClassPath;
OUString arg2 = sClassPath;
OUString arg3("JREProperties");
- OUString arg4 = "noaccessibility";
- rtl_uString *args[4] = {arg1.pData, arg2.pData, arg3.pData};
- // Only add the fourth param if the bootstrap parameter is set.
- if (bNoAccessibility)
- {
- args[3] = arg4.pData;
- cArgs = 4;
- }
+ rtl_uString *args[cArgs] = {arg1.pData, arg2.pData, arg3.pData};
oslProcess javaProcess= nullptr;
oslFileHandle fileOut= nullptr;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index c4e70d1df27b..4bfc1fd90af0 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -32,19 +32,18 @@ namespace jfw_plugin
MalformedVersionException::~MalformedVersionException() = default;
-VendorBase::VendorBase(): m_bAccessibility(false)
+VendorBase::VendorBase()
{
}
bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
{
- //get java.vendor, java.version, java.home,
- //javax.accessibility.assistive_technologies from system properties
+ //get java.vendor, java.version, java.home
+ //from system properties
bool bVersion = false;
bool bVendor = false;
bool bHome = false;
- bool bAccess = false;
bool bArch = false;
for (auto const& prop : props)
@@ -85,18 +84,9 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
m_sArch = prop.second;
bArch = true;
}
- else if (!bAccess
- && prop.first == "javax.accessibility.assistive_technologies")
- {
- if (!prop.second.isEmpty())
- {
- m_bAccessibility = true;
- bAccess = true;
- }
+ if (bVendor && bVersion && bHome && bArch) {
+ break;
}
- // the javax.accessibility.xxx property may not be set. Therefore we
- //must search through all properties.
-
}
if (!bVersion || !bVendor || !bHome || !bArch)
return false;
@@ -196,11 +186,6 @@ bool VendorBase::isValidArch() const
#endif
}
-bool VendorBase::supportsAccessibility() const
-{
- return m_bAccessibility;
-}
-
bool VendorBase::needsRestart() const
{
return !getLibraryPath().isEmpty();
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index f05cb5950e83..904e8211834c 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -37,9 +37,9 @@
#include <optional>
#include <string.h>
-// For backwards compatibility, the nFeatures and nRequirements flag words are
-// read/written as potentially signed hexadecimal numbers (though that has no
-// practical relevance given that each has only one flag with value 0x01
+// For backwards compatibility, the nRequirements flag word is
+// read/written as potentially signed hexadecimal number (though that has no
+// practical relevance given that it has only one flag with value 0x01
// defined).
using namespace osl;
@@ -553,7 +553,6 @@ void NodeJava::setJavaInfo(const JavaInfo * pInfo, bool bAutoSelect)
m_javaInfo->sVendor = pInfo->sVendor;
m_javaInfo->sLocation = pInfo->sLocation;
m_javaInfo->sVersion = pInfo->sVersion;
- m_javaInfo->nFeatures = pInfo->nFeatures;
m_javaInfo->nRequirements = pInfo->nRequirements;
m_javaInfo->arVendorData = pInfo->arVendorData;
}
@@ -563,7 +562,6 @@ void NodeJava::setJavaInfo(const JavaInfo * pInfo, bool bAutoSelect)
m_javaInfo->sVendor.clear();
m_javaInfo->sLocation.clear();
m_javaInfo->sVersion.clear();
- m_javaInfo->nFeatures = 0;
m_javaInfo->nRequirements = 0;
m_javaInfo->arVendorData = rtl::ByteSequence();
}
@@ -676,7 +674,7 @@ bool NodeJava::createSettingsDocument() const
CNodeJavaInfo::CNodeJavaInfo() :
m_bEmptyNode(false), bNil(true), bAutoSelect(true),
- nFeatures(0), nRequirements(0)
+ nRequirements(0)
{
}
@@ -740,13 +738,6 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo)
pDoc, cur->children, 1);
sVersion = xmlVersion;
}
- else if (xmlStrcmp(cur->name, reinterpret_cast<xmlChar const *>("features"))== 0)
- {
- CXmlCharPtr xmlFeatures = xmlNodeListGetString(
- pDoc, cur->children, 1);
- OUString sFeatures = xmlFeatures;
- nFeatures = sFeatures.toInt64(16);
- }
else if (xmlStrcmp(cur->name, reinterpret_cast<xmlChar const *>("requirements")) == 0)
{
CXmlCharPtr xmlRequire = xmlNodeListGetString(
@@ -858,11 +849,10 @@ void CNodeJavaInfo::writeToNode(xmlDoc* pDoc,
nodeCrLf = xmlNewText(reinterpret_cast<xmlChar const *>("\n"));
xmlAddChild(pJavaInfoNode, nodeCrLf);
- //Create the features element
- OUString sFeatures = OUString::number(
- nFeatures, 16);
+ //Create the features element, for backwards compatibility (it used to support one flag
+ // JFW_FEATURE_ACCESSBRIDGE = 0x01, but is ignored and always written as zero now)
xmlNewTextChild(pJavaInfoNode, nullptr, reinterpret_cast<xmlChar const *>("features"),
- CXmlCharPtr(sFeatures));
+ reinterpret_cast<xmlChar const *>("0"));
//add a new line for better readability
nodeCrLf = xmlNewText(reinterpret_cast<xmlChar const *>("\n"));
xmlAddChild(pJavaInfoNode, nodeCrLf);
@@ -896,7 +886,7 @@ std::unique_ptr<JavaInfo> CNodeJavaInfo::makeJavaInfo() const
return std::unique_ptr<JavaInfo>();
return std::unique_ptr<JavaInfo>(
new JavaInfo{
- sVendor, sLocation, sVersion, nFeatures, nRequirements,
+ sVendor, sLocation, sVersion, nRequirements,
arVendorData});
}
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index d008b5d16ab2..c253eec65426 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -282,7 +282,6 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
// 'bInfoFound' indicates whether a Java installation has been found
- // that supports all desired features
bool bInfoFound = false;
// get list of vendors for Java installations
@@ -299,7 +298,7 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
bInfoFound = true;
}
- // if no Java installation providing all features was detected by using JAVA_HOME,
+ // if no Java installation was detected by using JAVA_HOME,
// query PATH for Java installations
if (!bInfoFound)
{
@@ -359,8 +358,6 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
if (aInfo)
{
- //the just found Java implements all required features
- //currently there is only accessibility!!!
aCurrentInfo = std::move(aInfo);
break;
}
@@ -403,7 +400,6 @@ bool jfw_areEqualJavaInfo(JavaInfo const * pInfoA,JavaInfo const * pInfoB)
if (pInfoA->sVendor == pInfoB->sVendor
&& pInfoA->sLocation == pInfoB->sLocation
&& pInfoA->sVersion == pInfoB->sVersion
- && pInfoA->nFeatures == pInfoB->nFeatures
&& pInfoA->nRequirements == pInfoB->nRequirements
&& pInfoA->arVendorData == pInfoB->arVendorData)
{
More information about the Libreoffice-commits
mailing list