configmgr/source/configurationregistry.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 08ef54500089f949e67f184bf61ebfa54d5b3dae
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Mon Mar 24 14:48:17 2025 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Mon Mar 24 17:02:26 2025 +0100

    configmgr: Let XRegistryKey::getLongValue return boolean values, too
    
    Ever since 21d42ab495d7b7aea103e7e32bd7a436c914f6b5 "#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.bergm...@allotropia.de>

diff --git a/configmgr/source/configurationregistry.cxx 
b/configmgr/source/configurationregistry.cxx
index c5dcf0cf58ed..d162c430382b 100644
--- a/configmgr/source/configurationregistry.cxx
+++ b/configmgr/source/configurationregistry.cxx
@@ -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,

Reply via email to