configmgr: Let XRegistryKey::getLongValue return boolean values, too
Ever since 21d42ab495 "#75148# check security and
netaccess are set now", getJavaPropsFromSafetySettings in
stoc/source/javavm/javavm.cxx tries to read a Security property (of type
xs:boolean in officecfg/registry/schema/org/openoffice/Office/Java.xcs) via
XRegistryKey::getLongValue. While this may have worked with the previous
configmgr implementation, it now just always caused an exception (that would
have been swalled in initVMConfiguration in stoc/source/javavm/javavm.cxx).
Not sure if there are any other places where code expects to read a boolean
property value from the configuration via XRegistryKey::getLongValue, but lets
better add that (back) as a (hopefully) harmless extension.
Change-Id: I33ca60595da8fd79fb9250d74f36be0b328d610f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183269
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
This commit is contained in:
@@ -411,9 +411,13 @@ sal_Int32 RegistryKey::getLongValue()
|
||||
{
|
||||
std::unique_lock g(service_.mutex_);
|
||||
service_.checkValid();
|
||||
sal_Int32 v = 0;
|
||||
if (value_ >>= v) {
|
||||
return v;
|
||||
sal_Int32 v1 = 0;
|
||||
if (value_ >>= v1) {
|
||||
return v1;
|
||||
}
|
||||
bool v2;
|
||||
if (value_ >>= v2) {
|
||||
return sal_Int32(v2);
|
||||
}
|
||||
throw css::registry::InvalidValueException(
|
||||
u"com.sun.star.configuration.ConfigurationRegistry"_ustr,
|
||||
|
||||
Reference in New Issue
Block a user