Closed
Bug 665987
Opened 13 years ago
Closed 13 years ago
win32 nsFilePicker does not clear out mFiles on showing picker
Categories
(Core :: Widget: Win32, defect)
Tracking
()
RESOLVED
FIXED
mozilla9
People
(Reporter: mark.yen, Assigned: bbondy)
References
()
Details
Attachments
(1 file)
1.10 KB,
patch
|
jimm
:
review+
|
Details | Diff | Splinter Review |
In the GTK2 and Cocoa implementations, showing the file picker clears out nsFilePicker.mFiles. This does not happen for Win32, though it probably should, given that there's no other way for an API consumer to clear it. STR: 1. Create a nsIFilePicker on Windows and .init() as appropriate for modeOpen 2. .show() and pick a file. 3. .show() and pick a different file 4. read fp.files Expected results: fp.files should only have the last file picked from step 3. Actual results: fp.files contains both files (steps 2 and 3).
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → netzen
Assignee | ||
Comment 1•13 years ago
|
||
Here are exact steps to reproduce the problem: 1. Download the Extension Developer extension (https://addons.mozilla.org/en-us/firefox/addon/extension-developer/) 2. Open the Interactive JS console via the small button under the maximize button 3. Type in the following code, and select a file on each open: var picker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); picker = picker.QueryInterface(Components.interfaces.nsIFilePicker); picker.init(window, "Select 1 file exactly", Components.interfaces.nsIFilePicker.modeOpenMultiple); picker.show(); picker.show(); var enumerator = picker.files; while (enumerator.hasMoreElements()) { var file = enumerator.getNext().QueryInterface(Components.interfaces.nsILocalFile); print(file.path); } Actual results: Step 3 prints all files selected Expected results: Step 3 should print only the files selected in the second file picker dialog
Assignee | ||
Comment 2•13 years ago
|
||
I simply call `Clear()` on the nsCOMArray before re-filling the array
Attachment #544610 -
Flags: review?(jmathies)
Updated•13 years ago
|
Attachment #544610 -
Flags: review?(jmathies) → review+
Assignee | ||
Updated•13 years ago
|
Attachment #544610 -
Flags: checkin?
Assignee | ||
Updated•13 years ago
|
Attachment #544610 -
Flags: checkin?
Comment 3•13 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/bd9dd7e4c7ff
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla9
You need to log in
before you can comment on or make changes to this bug.
Description
•