BUG DESCRIPTION:
----------------
After saving a graphic handle of a component of an axes -- such as of a polyline --,
it is well registered in the archive -- as listvarinfile shows it --, but load()
fails restoring it.
I know that saving and restoring pointers is a complicated thing, since it is
actually the pointed objects that must be saved, plus the links, and for graphics,
somewhat the whole chain of its ancestors.
In Scilab 5.5.2, the situation was somewhat better: When saving an axes a, and
one of its curves c = a.children.children(1) in the same file, then load()
restores the whole (a) (including c), plus a copy of (c) in a, since the parentship
of c wrt a is not saved. At least, we do restore 2 objects without yielding any error.
In Scilab 6.0.1, only figures and axes look to be restorable with load().
At least, the following simple case fails:
path = TMPDIR+"/test.dat";
clf, plot2d(); a=gca(); e=gce().children(1);
save(path, "a")
xdel(winsid()); clear a e; load(path); a // OK
clf, plot2d(); e=gce(); e=e.children(1); save(path, "e")
xdel(winsid()); clear e; load(path); // error
--> xdel(winsid()); clear e; load(path); // error
load: Unable to load 'e'.
Cumulating this issue with the bug 15663 and the bug 15664 makes saving session variables and using graphic files complicated.
ERROR LOG:
----------
load: Unable to load 'e'.
HOW TO REPRODUCE THE BUG:
-------------------------
path = TMPDIR+"/test.dat";
clf, plot2d(); a=gca(); e=gce().children(1);
save(path, "a")
xdel(winsid()); clear a e; load(path); a // OK
clf, plot2d(); e=gce(); e=e.children(1); save(path, "e")
xdel(winsid()); clear e; load(path); // error
OTHER INFORMATION:
------------------
See also the bug 13815.
Graphical pointers -- as with legends polyline references or datatips, or with handles of subcomponents -- might be carefully considered when saving and restoring them. IMO, it would be relevant
* to save their whole parent figure
* to detect and save the subcomponent path inside the figure, instead of saving a copy of the subcomponent on its own.
Then
* to restore the whole parent figure (without restoring any handle if not saved)
* to restore the handle of the subcomponent, according to its parent figure and the path inside it.