Issue 93899 - Aqua Native filepicker forget the last directory
Summary: Aqua Native filepicker forget the last directory
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: OOO300m5
Hardware: All Unix, all
: P3 Trivial (vote)
Target Milestone: OOo 3.2
Assignee: florian
QA Contact: issues@porting
URL:
Keywords: aqua
Depends on:
Blocks:
 
Reported: 2008-09-15 08:29 UTC by hdu@apache.org
Modified: 2010-07-26 19:47 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch to fix the outdated directory problem (1.66 KB, text/plain)
2009-08-03 22:24 UTC, florian
no flags Details
a second patch, warning free (can be wrong, though) (2.31 KB, patch)
2009-08-04 16:54 UTC, eric.bachard
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description hdu@apache.org 2008-09-15 08:29:53 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.
Comment 1 andreas.schluens 2008-11-26 12:03:35 UTC
as->hro: Who is reponsible for the UNIX or Aqua file picker implementation ?
Comment 2 philipp.lohmann 2008-11-26 12:22:55 UTC
Actually I think this is something the wrapper service should do; who does that
nowadays ?
Comment 3 kai.sommerfeld 2009-06-16 10:18:20 UTC
pl: Something for you?
Comment 4 philipp.lohmann 2009-06-16 11:08:47 UTC
@cd: The file dialog wrapper service, is that yours ?
Comment 5 carsten.driesner 2009-06-16 11:19:20 UTC
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.
Comment 6 carsten.driesner 2009-06-19 08:59:59 UTC
cd: Set target to OOo 3.2.
Comment 7 carsten.driesner 2009-06-23 14:27:15 UTC
cd: I cannot reproduce this behavior on the native Windows file picker (Win
2000/Vista).
Comment 8 carsten.driesner 2009-07-15 10:27:48 UTC
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.
Comment 9 florian 2009-08-02 13:22:45 UTC
@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?
Comment 10 hdu@apache.org 2009-08-03 12:13:43 UTC
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"
Comment 11 florian 2009-08-03 21:01:49 UTC
Taking over for closer investigation on what's going on.
Comment 12 florian 2009-08-03 22:21:42 UTC
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.
Comment 13 florian 2009-08-03 22:24:43 UTC
Created attachment 63940 [details]
Patch to fix the outdated directory problem
Comment 14 florian 2009-08-03 22:27:28 UTC
Attached patch solving the problem.

Fixed in cws aquafilepicker04 @274601
Comment 15 hdu@apache.org 2009-08-04 10:51:15 UTC
@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
Comment 16 eric.bachard 2009-08-04 16:52:59 UTC
@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.


Comment 17 eric.bachard 2009-08-04 16:54:04 UTC
Created attachment 63952 [details]
a second patch, warning free (can be wrong, though)
Comment 18 eric.bachard 2009-08-04 16:54:27 UTC
CC for me
Comment 19 florian 2009-08-04 18:45:04 UTC
@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.
Comment 20 carsten.driesner 2009-08-05 09:43:39 UTC
cd->fheckl: Thanks for your solution. I will remove this issues from CWS
filepicker03 because your fix went into CWS aquafilepicker04.
Comment 21 philipp.lohmann 2009-08-21 14:12:10 UTC
verified in aquafilepicker04
Comment 22 Martin Hollmichel 2010-07-26 19:47:47 UTC
close issue