After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 122173 - &[path] should be rationalize
&[path] should be rationalize
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Printing
git master
Other All
: Low minor
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2003-09-13 01:08 UTC by Patrick
Modified: 2005-04-01 20:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Patrick 2003-09-13 01:08:12 UTC
In Excel XP there is the possibility of specifying &[file] and &[path]
fields in the header/footer setup which will be replaced when printing with
the filename (ie. workbook.gnumeric) and path (ie. /home/patrick) respectively.

This would be a useful addition to Gnumeric since printed reports developed
in the spreadsheet often needed to be looked up again and is facilitated by
the ability to immediately locate the appropriate file.
Comment 1 Andreas J. Guelzow 2003-09-13 14:06:49 UTC
Gnumeric already accepts &[FILE] printing the path name of the current
file. (And considering the current code it would be trivial to make
&[FILE:0] print the basename only.)

Note: in a custom format preview &[FILE] is invisible but will be
shown in the print preview.
Comment 2 Jody Goldberg 2003-09-13 14:56:25 UTC
It prints the _relative_ path to the file.  We should probably fix
that to being the basename (if that is what xl does), and add a PATH
entry for XP compatibility.  Should be pretty simple aside from
rationalizing the path.  We can throw it in for 1.2.1
Comment 3 Andreas J. Guelzow 2003-09-13 18:19:36 UTC
We now have in cvs (for 1.2.0):

&[FILE] prints the basename of the file
&[PATH] prints the absolute path and file name of the file

There is one minor problem remaining:
&[PATH] is not rationalized so that it may be
/home/aguelzow/cvs/gnumeric/../../file.gnumeric if the file was opened
from the command line as  ../../file.gnumeric.
Comment 4 Patrick 2003-09-13 23:05:18 UTC
That's great Andreas but it might be better if path just meant the
path since it is split this way in xl? I suppose &[path]&[file] in xl
could be reduced to just &[path] on import and vice versa but wouldn't
it be less work to have direct mappings?
Comment 5 Andreas J. Guelzow 2003-09-14 01:03:03 UTC
According to the MS Knowledgebase [&Path] should stand for the
complete path with filename. (At least the way I understand it.) I do
not have XL2002 to try it out. If you are able to use a copy of XL2002
please let us know what it is doing.

Comment 6 Andreas J. Guelzow 2003-09-14 04:35:35 UTC
Checking a few other web sites, I find that you may be right. I have
changed the behaviour of &[PATH] but it may still be nice if you could
confirm that %[PATH] does not include the basename.
Comment 7 Morten Welinder 2005-04-01 20:44:09 UTC
This appears to have been fixed in the meantime.