ScriptForge (Sharedmemory) review StoreValue() signature

Thanks to commit
  https://gerrit.libreoffice.org/c/core/+/190931
  (Extend Python-Basic gateway for objects)
a signature with an object instance as argument
is allowed in any position, i.o. the 1st only.

This is applicable to
  sharedmemory.StoreValue(value, variablename)
Indeed, 'value' may be such an object instance.

The signature becomes now
  sharedmemory.StoreValue(variablename, value)
which is more intuitive.

No impact on user scripts <= 25.8

Documentation should take both commits
into account.

Change-Id: I1a07cd740fc9dcba1077932bba0f69735a7bc647
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190979
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
This commit is contained in:
Jean-Pierre Ledure
2025-09-17 16:44:26 +02:00
parent 9ec548605c
commit d8c75e9bda
4 changed files with 26 additions and 26 deletions
@@ -1640,14 +1640,14 @@ class SFScriptForge:
def RemoveAll(self):
return self.ExecMethod(self.vbMethod, 'RemoveAll')
def StoreValue(self, value, variablename):
def StoreValue(self, variablename, value):
if isinstance(value, SFServices):
return self.ExecMethod(self.vbMethod + self.flgObject, 'StoreValue',
value.objectreference, variablename)
return self.ExecMethod((self.vbMethod + self.flgObject, 1), 'StoreValue',
variablename, value.objectreference)
if isinstance(value, datetime.datetime):
value = SFScriptForge.SF_Basic.CDateToUnoDateTime(value)
return self.ExecMethod(self.vbMethod + self.flgDateArg, 'StoreValue', value, variablename)
return self.ExecMethod(self.vbMethod, 'StoreValue', value, variablename)
return self.ExecMethod(self.vbMethod + self.flgDateArg, 'StoreValue', variablename, value)
return self.ExecMethod(self.vbMethod, 'StoreValue', variablename, value)
# #########################################################################
# SF_String CLASS