Apache OpenOffice (AOO) Bugzilla – Issue 93899
Aqua Native filepicker forget the last directory
Last modified: 2010-07-26 19:47:47 UTC
The File-Open dialog does not save the directory on close, so next time the dialog gets opened the directory is back to where it was. The problem seems to be specific to the native filepickers. This has been observed on the UNX and the Aqua port. When Tools->Options->General->UseBuiltinDialogs is enabled all seems to work fine.
as->hro: Who is reponsible for the UNIX or Aqua file picker implementation ?
Actually I think this is something the wrapper service should do; who does that nowadays ?
pl: Something for you?
@cd: The file dialog wrapper service, is that yours ?
cd: Yes, currently I don't know what part is responsible to store the latest used folder. You are right that it makes sense to have it in the wrapper part.
cd: Set target to OOo 3.2.
cd: I cannot reproduce this behavior on the native Windows file picker (Win 2000/Vista).
cd: Changed title and OS as this issue cannot be reproduced on Windows. A platform independent solution cannot be done. The Micrsoft documentation clearly warns to create your own solution. I will check the Unix specific file pickers.
@hdu After comparing the behaviors of OpenOffice file picker (on MacOSX and Linux), Windows native file picker, gtk native file picker and Aqua native file picker, I cannot see any difference in forgetting or remembering the last used directory when doing the same actions in all of these implementations (always using some recent builds). So can you please tell exactly what's going wrong (in your opinion) with aqua native picker?
I just tested on DEV300_m52 on Windows and Aqua and the issue can be easily reproduced: - open Draw - make sure the native filepicker is not disabled (in Options/OOo/General/OpenCloseDialog) - Insert->Picture->FromFile - note the current directory (e.g. user/gallery) - select a picture from a different directory (e.g. home/mypics) - press OK - Insert->Picture->FromFile again => the directory is still in "user/gallery" instead of "home/mypics"
Taking over for closer investigation on what's going on.
The problem was that the directory was only set in getFiles after the dialog has been successful. Now if getDisplayDirectory is called before getFiles is called, then you get the directory you started with.
Created attachment 63940 [details] Patch to fix the outdated directory problem
Attached patch solving the problem. Fixed in cws aquafilepicker04 @274601
@fheckl: Thanks a lot for solving the problem for the AquaFilePicker! AFAIK cd has already added that task to his CWS filepicker03 too. Maybe the generic problem was fixed in CWS filepicker02 (with "#i95336# Extend SfxApplication to reset last used directory" => r274078). Anyway if there are still these problem after >=DEV300_m54 (where filepicker02 gets integrated) on Win<=XP or on GTK the suggest to open a separate issues => renaming the summary to dedicate this issue to the problem with the Aqua filepicker
@Florian : thanks for the patch ! BTW, I got warnings, and I wonder whether isDirectory is usefull in implsetDisplayDirectory ? First is does generate warnings, because of no matching signature for the method, and second, because it seems to be not usefull (if I'm not wrong). I'll attach a patch to show what I propose.
Created attachment 63952 [details] a second patch, warning free (can be wrong, though)
CC for me
@Eric: Right, I didn't verify that the method I used was only introduced with 10.5. So I changed it to match your patch. Thanks for the hint.
cd->fheckl: Thanks for your solution. I will remove this issues from CWS filepicker03 because your fix went into CWS aquafilepicker04.
verified in aquafilepicker04
close issue