Issue 22189 - Filepicker: SetDefaultName fails in FILESAVE_SIMPLE dialog
Summary: Filepicker: SetDefaultName fails in FILESAVE_SIMPLE dialog
Status: CLOSED DUPLICATE of issue 15530
Alias: None
Product: ui
Classification: Code
Component: code (show other issues)
Version: OOo 1.1
Hardware: PC Windows 2000
: P4 Trivial (vote)
Target Milestone: AOO PleaseHelp
Assignee: tino.rachui
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-06 10:09 UTC by cat65
Modified: 2003-11-13 11:44 UTC (History)
1 user (show)

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


Attachments
File with embedded macro (6.43 KB, application/octet-stream)
2003-11-07 10:53 UTC, cat65
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description cat65 2003-11-06 10:09:11 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
Comment 1 ooo 2003-11-06 17:33:00 UTC
I am not sure who is responsible for this dialog, just guessing
Comment 2 Frank Schönheit 2003-11-07 08:53:32 UTC
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?
Comment 3 cat65 2003-11-07 10:53:53 UTC
Created attachment 11039 [details]
File with embedded macro
Comment 4 cat65 2003-11-07 11:03:01 UTC
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?
Comment 5 Frank Schönheit 2003-11-07 12:20:56 UTC
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.
Comment 6 cat65 2003-11-07 12:49:35 UTC
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 :-).
Comment 7 tino.rachui 2003-11-13 11:43:40 UTC
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 ***
Comment 8 tino.rachui 2003-11-13 11:44:36 UTC
close