diff options
author | Michael Stahl <mstahl@redhat.com> | 2011-11-30 16:08:23 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2011-12-03 00:48:13 +0100 |
commit | 5754213c709428b19c68d5242df54683bf83536e (patch) | |
tree | a1f23a0e7218884f9186cd063ba46515a26cab6c /sd | |
parent | db74fdf5346c4f97256522ee2a3200fcdce1af5a (diff) |
sfx2::FileDialogHelper: refactor construction:
There are currently 2 different ways to specify what kind of file dialog
should be created: the nDialogType and nFlags ctor parameters.
Simplify that by using the nDialogType for the API specified variety,
and the nFlags only for options that cannot be specified by the API.
This allows to get rid of 3 constructors, and the following constants:
WB_OPEN, WB_SAVEAS, WB_PASSWORD, SFXWB_PASSWORD, SFXWB_SHOWSTYLES
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/dlg/dlgass.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/dlg/tpaction.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/fuinsfil.cxx | 5 |
3 files changed, 11 insertions, 4 deletions
diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index 1c35a5488408..eb885b64fc0e 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -62,6 +62,7 @@ #include <com/sun/star/ucb/XSimpleFileAccess.hpp> #include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/XImageManager.hpp> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <unotools/historyoptions.hxx> #include <tools/urlobj.hxx> #include <osl/file.hxx> @@ -1879,8 +1880,9 @@ IMPL_LINK( AssistentDlg, FinishHdl, OKButton *, EMPTYARG ) String aFileToOpen = GetDocPath(); if(aFileToOpen.Len() == 0) { - sfx2::FileDialogHelper aFileDlg( 0, - ::String::CreateFromAscii("simpress") ); + sfx2::FileDialogHelper aFileDlg( + ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, 0, + ::String::CreateFromAscii("simpress") ); if ( aFileDlg.Execute() == ERRCODE_NONE ) aFileToOpen = aFileDlg.GetPath(); diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index 6916730a8e99..4e6db4f6ae9f 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -41,6 +41,7 @@ #include <com/sun/star/uri/XVndSunStarScriptUrl.hpp> #include <comphelper/processfactory.hxx> #include <com/sun/star/embed/VerbAttributes.hpp> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include "sdattr.hxx" #include <sfx2/sfxresid.hxx> @@ -470,7 +471,8 @@ void SdTPAction::OpenFileDialog() } else { - sfx2::FileDialogHelper aFileDialog(0); + sfx2::FileDialogHelper aFileDialog( + ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, 0); if (bDocument && !aFile.Len()) aFile = SvtPathOptions().GetWorkPath(); diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 59fb1a0672dc..a54e22774e44 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -53,6 +53,7 @@ #include <com/sun/star/ui/dialogs/XFilterManager.hpp> #include <com/sun/star/ui/dialogs/XFilePicker.hpp> #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include "sdresid.hxx" #include "drawdoc.hxx" @@ -116,7 +117,9 @@ void FuInsertFile::DoExecute( SfxRequest& rReq ) if (!pArgs) { - sfx2::FileDialogHelper aFileDialog( SFXWB_INSERT ); + sfx2::FileDialogHelper aFileDialog( + ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, + SFXWB_INSERT ); Reference< XFilePicker > xFilePicker( aFileDialog.GetFilePicker(), UNO_QUERY ); Reference< XFilterManager > xFilterManager( xFilePicker, UNO_QUERY ); String aOwnCont; |