https://bugs.freedesktop.org/show_bug.cgi?id=60977

--- Comment #4 from Christian Fries <[email protected]> ---
Created attachment 75064
  --> https://bugs.freedesktop.org/attachment.cgi?id=75064&action=edit
Test sheet (requires Obba.oxt from http://www.obba.info )


With respect to XVolatileResult here is a setup on how to reproduce the
problem:

1. Download and install the extension Obba from http://www.obba.info (download
Obba.zip and install Obba.oxt from "Obba for OpenOffice"). This extension
offers a UDF called obAddClasses which loads Java classes from disk and
provides them dynamically to other UDFs. This function is implemented with an
XVolatileResult since it needs to notify the sheet of an update of the sheet
path (actually this is a workaround for another LibreOffice/OpenOffice/UNO
bug). (Note: XVolatileResult is a result that may change upon recalculation or
any time later even if the arguments of the function are the same. Examples of
such functions are, e.g., NOW()).

2. Open the attached sheet "LoadClassesTest.ods". This sheet has just a single
function call to obAddClasses with the local spreadsheet path "." as argument.
As a result the function will (should) show the current directory of the sheet.

Result:

A) If you open the sheet on LibreOffice 3.6 the sheet will be recalculated,
initializing the Java virtual machine and showing the correct current directory
of the sheet (retry with the sheet copied to another directory).

B) If you open the sheet on LibreOffice 4 the sheet will not show the current
directory of the sheet. Instead it will show the directory of the sheet upon
last calculation, this is /Users/fries/Documents 

Note that this bug has nothing to do with Obba (I just use it for convenience).
For example: IT IS NOW IMPOSSIBLE TO CREATE AN UNO PLUGIN WHICH PROVIDES A
SPREADSHEET FUNCTION "GetSheetDirectory" and have the current directory of the
sheet displayed in the sheet, since this function won't be called after load.

On the other hand, if you use the build-in volatile function "NOW()" in a
spreadsheet it get's relcalculated. Hence the developers who implemented the
use of cached values does consider volatile functions (the sheet is not
displayed in its last saved state, it update the NOW function!).

I believe the use of cached values has to be changed in the several ways. That
is:

- Provide an option to load a sheet in "View only" using cached values, even
for volatile functions (NOW()). Notify the user that this sheet contains
volatile functions (like a notification in the case where a sheet contains an
external reference - a volatile function is similar to an external reference).

- Upon first recalculation of any cell of such a sheet, recalculate all (!)
volatile functions, including all functions provided by UNO plugins (as it is
done for the NOW() function). (Even better: default to a conservative model,
where all plugin functions are recalculated until UNO developers adopt to the
requirement to use XVolatileResults where necessary. Give UNO developers time
to cope with the paradigm change that sheets are not recalculated on load).

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to