Apache OpenOffice (AOO) Bugzilla – Issue 120005
Feature request: Allow VolatileResult to be different for subsequent function calls with same arguments. (XVolatileResult)
Last modified: 2012-06-17 10:24:36 UTC
As stated in the developer documentation, - see http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Variable_Results -, subsequent calls with same arguments to functions with volatile results (XVolatileResult) have to return the same (XVolatileResult) object. Hence, the add-in function implementing the XVolatileResult has to maintain a map arg->resultObject. However, this requirement is a limitation. Allowing volatile functions to return new objects for every new function call will be an improvement. An example of an application is a random number generator like RAND(). The function RAND() returns a new random number for every subsequent call, even though arguments are the same (it has not arguments). Now consider a timer based (volatile) random number generator returning a new random number ever x seconds, e.g. RANDTICKER(double delay). I experimented a lot with XVolatileResults. However, returning different objects for subsequent function calls with same arguments will lead to some (but not many) undesirable effects, like occasional claims of 522 error (circular reference). PS: I do have a real (but more specific) use case in the application of Obba ( http://obba.info ) , where I need to return a volatile value which depends on the path of the calling spreadsheet.