Apache OpenOffice (AOO) Bugzilla – Issue 22189
Filepicker: SetDefaultName fails in FILESAVE_SIMPLE dialog
Last modified: 2003-11-13 11:44:36 UTC
Hello, in my attempt to write a basic macro I found a little bug in filepicker. If you want to open the file save dialog and set a empty display directory, the default file name is not displayed in the dialog. This does not happen, if there are files in this directory, even if the default file name would be a new file. The code: REM ***** BASIC ***** Sub Main Dim oDoc As Object Dim saveFilePickerArgs(0) Dim saveFilePicker as Object oDoc = ThisComponent saveFilePickerArgs(0) = com.sun.star.ui.dialogs.TemplateDescription. FILESAVE_SIMPLE saveFilePicker = CreateUnoService ("com.sun.star.ui.dialogs.FilePicker") with saveFilePicker .Initialize(saveFilePickerArgs()) .appendFilter ("OpenOffice Textdokument (*.sxw)", "*.sxw") .setDefaultName("Iamnotdisplayed.sxw") .SetDisplayDirectory("C:\Directory_without_any_files") If .execute() Then saveFiles = .getFiles() saveFileURL = saveFiles(0) If lcase(right(saveFileURL(0),4)) = ".sxw" then oDoc.StoreAsURL(saveFileURL, Array()) else oDoc.StoreAsURL(saveFileURL + ".sxw", Array()) end if End If .Dispose() end with End Sub If the bug is my fault, please let me know. I just began to write OOo macros. Best regards, Claudia
I am not sure who is responsible for this dialog, just guessing
guessed right ... Claudia, I cannot reproduce the behaviour. When I try your macro with 1.1., then - the system notation (C:\something) is not accepted by the file picker, no matter if "something" is empty or not - if I use URL notation (file:///c|/something), then the file name is properly display, no matter if something is empty or not Can you provide a bug doc (with the macro included) where this happens?
Created attachment 11039 [details] File with embedded macro
I have tested the macro now with both URL and system notification. I do not get an error, filepicker accepts both display directories, and the behaviour on my system is just the same. The dialog displays the right directory but not the default filename. Perhaps it is my operating system: Win 2k Professional, 5.00.2195, SP2?
Ah! It's not about your system, it's about the dialog you use: With the system dialog (Tools|Options|OpenOffice.org|General|Use OpenOffice.org dialogs *not* checked), the bug happens as you describe. With the internal dialog (the abovementioned box *checked*), the bug does not happen. Confirming, targeting, and assigning to responsible developer.
Thank you, it is absolutely right. My options told OOo not to use internal dialogs, even if they are explicitely called by a macro. Hm, so I will wait for "OOo later" and change my options or accept the little bug for a while :-).
Hi, this is the same problem as reported in i15530. Will have a look on it if there is time. Kind Regards, Tino *** This issue has been marked as a duplicate of 15530 ***
close