sc/inc/funcuno.hxx              |    1 +
 sc/source/ui/unoobj/funcuno.cxx |   15 +++++++--------
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit fbefbfc357aaf4e36a10085b6645e8ba97187543
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Mar 4 08:54:16 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue Mar 5 09:21:55 2024 +0100

    save and return the set value in the case that 'SpellOnline' is used
    
    in XFunctionAccess
    
    Change-Id: I9b917c84732dfd205e46e9bc00656c09341c7077
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164329
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sc/inc/funcuno.hxx b/sc/inc/funcuno.hxx
index 3d62ecaded9d..912201ac4bb7 100644
--- a/sc/inc/funcuno.hxx
+++ b/sc/inc/funcuno.hxx
@@ -64,6 +64,7 @@ private:
     SfxItemPropertyMap aPropertyMap;
     bool            mbArray;
     bool            mbValid;
+    bool            mbSpellOnline;
 
 public:
                             ScFunctionAccess();
diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx
index 38e849a21317..4f4a967b59eb 100644
--- a/sc/source/ui/unoobj/funcuno.cxx
+++ b/sc/source/ui/unoobj/funcuno.cxx
@@ -195,7 +195,8 @@ namespace
 ScFunctionAccess::ScFunctionAccess() :
     aPropertyMap( GetPropertyMap() ),
     mbArray( true ),    // default according to behaviour of older Office 
versions
-    mbValid( true )
+    mbValid( true ),
+    mbSpellOnline( false )
 {
     StartListening( *SfxGetpApp() );       // for SfxHintId::Deinitializing
 }
@@ -266,8 +267,9 @@ void SAL_CALL ScFunctionAccess::setPropertyValue(
     }
     else if (aPropertyName == SC_UNO_SPELLONLINE)
     {
-        // silently ignore this property
-        SAL_WARN("sc", "'SpellOnline' not implemented for ScFunctionAccess");
+        // Allow this property because SpreadsheetDocumentSettings lists it
+        if( !(aValue >>= mbSpellOnline) )
+            throw lang::IllegalArgumentException();
     }
     else
     {
@@ -275,7 +277,6 @@ void SAL_CALL ScFunctionAccess::setPropertyValue(
             pOptions.reset( new ScDocOptions() );
 
         // options aren't initialized from configuration - always get the same 
default behaviour
-
         bool bDone = ScDocOptionsHelper::setPropertyValue( *pOptions, 
aPropertyMap, aPropertyName, aValue );
         if (!bDone)
             throw beans::UnknownPropertyException(aPropertyName);
@@ -289,11 +290,9 @@ uno::Any SAL_CALL ScFunctionAccess::getPropertyValue( 
const OUString& aPropertyN
     if ( aPropertyName == "IsArrayFunction" )
         return uno::Any( mbArray );
 
+    // Allow this property because SpreadsheetDocumentSettings lists it
     if (aPropertyName == SC_UNO_SPELLONLINE)
-    {
-        SAL_WARN("sc", "'SpellOnline' not implemented for ScFunctionAccess");
-        return uno::Any(false);
-    }
+        return uno::Any(mbSpellOnline);
 
     if ( !pOptions )
         pOptions.reset( new ScDocOptions() );

Reply via email to