diff options
27 files changed, 114 insertions, 142 deletions
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index bc319cb00e39..325ca92bffd2 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -1032,7 +1032,8 @@ IMPL_STATIC_LINK( SfxInsertFloatingFrameDialog, OpenHdl, PushButton*, EMPTYARG ) Application::SetDefDialogParent( pThis ); // create the file dialog - sfx2::FileDialogHelper aFileDlg( SFXWB_PASSWORD, String() ); + sfx2::FileDialogHelper aFileDlg( + ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0, String() ); // set the title aFileDlg.SetTitle( OUString( String( CUI_RES( MD_INSERT_OBJECT_IFRAME ) ) ) ); diff --git a/cui/source/options/doclinkdialog.cxx b/cui/source/options/doclinkdialog.cxx index edebdab3f5ea..b34736623e74 100644 --- a/cui/source/options/doclinkdialog.cxx +++ b/cui/source/options/doclinkdialog.cxx @@ -28,6 +28,9 @@ #include "doclinkdialog.hxx" #include "doclinkdialog.hrc" + +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> + #include <cuires.hrc> #include <tools/debug.hxx> #include <svl/filenotation.hxx> @@ -42,6 +45,7 @@ namespace svx { //...................................................................... + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ucb; using namespace ::svt; @@ -166,7 +170,8 @@ namespace svx //------------------------------------------------------------------ IMPL_LINK( ODocumentLinkDialog, OnBrowseFile, void*, EMPTYARG ) { - ::sfx2::FileDialogHelper aFileDlg(0); + ::sfx2::FileDialogHelper aFileDlg( + ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, 0); static const String s_sDatabaseType = String::CreateFromAscii("StarOffice XML (Base)"); const SfxFilter* pFilter = SfxFilter::GetFilterByName( s_sDatabaseType); if ( pFilter ) diff --git a/dbaccess/source/ext/adabas/AdabasNewDb.cxx b/dbaccess/source/ext/adabas/AdabasNewDb.cxx index cd1a90856724..4c31eff2989e 100644 --- a/dbaccess/source/ext/adabas/AdabasNewDb.cxx +++ b/dbaccess/source/ext/adabas/AdabasNewDb.cxx @@ -48,6 +48,7 @@ #include <unotools/tempfile.hxx> #include <unotools/localfilehelper.hxx> #include <com/sun/star/sdbc/SQLException.hpp> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <unotools/ucbhelper.hxx> #include <connectivity/dbtools.hxx> #include <connectivity/dbexception.hxx> @@ -59,6 +60,7 @@ using namespace adabasui; using namespace ucbhelper; using namespace utl; +using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbcx; @@ -549,7 +551,8 @@ IMPL_LINK( OAdabasNewDbDlg, LoseFocusHdl, Edit *, pEdit ) //------------------------------------------------------------------------ IMPL_LINK( OAdabasNewDbDlg, LoadButtonClickHdl, Button *, /*pButton*/ ) { - ::sfx2::FileDialogHelper aLoad(0); + ::sfx2::FileDialogHelper aLoad( + ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, 0); if(!m_Backup_File.Len()) aLoad.SetDisplayDirectory(SvtPathOptions().GetWorkPath()); else @@ -573,8 +576,8 @@ IMPL_LINK( OAdabasNewDbDlg, LoadButtonClickHdl, Button *, /*pButton*/ ) //------------------------------------------------------------------------ IMPL_LINK( OAdabasNewDbDlg, ButtonClickHdl, Button *, pButton ) { - WinBits nBits(WB_SAVEAS); - ::sfx2::FileDialogHelper aFileDlg( static_cast<sal_uInt32>(nBits) ); + ::sfx2::FileDialogHelper aFileDlg( + ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0); String aPath; if(pButton == &m_PB_SYSDEVSPACE) diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 81a2dd0d7d08..216d65ffe63f 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -1172,14 +1172,15 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa case ID_BROWSER_SAVEASDOC: { - WinBits nBits(WB_SAVEAS); ::rtl::OUString sUrl; if ( m_xModel.is() ) sUrl = m_xModel->getURL(); if ( !sUrl.getLength() ) sUrl = SvtPathOptions().GetWorkPath(); - ::sfx2::FileDialogHelper aFileDlg( com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION,static_cast<sal_uInt32>(nBits) ,getView()); + ::sfx2::FileDialogHelper aFileDlg( + ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION, + 0, getView()); aFileDlg.SetDisplayDirectory( sUrl ); const SfxFilter* pFilter = getStandardDatabaseFilter(); diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 3f1bbd52d3a7..8c34de3c5b69 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -55,6 +55,7 @@ #include <svl/filenotation.hxx> #include "dbustrings.hrc" #include <com/sun/star/ui/dialogs/XFolderPicker.hpp> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/sdbc/XRow.hpp> #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> @@ -87,6 +88,7 @@ namespace dbaui { //......................................................................... + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ucb; using namespace ::com::sun::star::ui::dialogs; @@ -229,9 +231,11 @@ DBG_NAME(OConnectionHelper) case ::dbaccess::DST_CALC: { SvtModuleOptions aModule; - ::sfx2::FileDialogHelper aFileDlg(0 - ,aModule.GetFactoryEmptyDocumentURL(SvtModuleOptions::E_CALC) - ,SFX_FILTER_IMPORT); + ::sfx2::FileDialogHelper aFileDlg( + ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, + 0, + aModule.GetFactoryEmptyDocumentURL(SvtModuleOptions::E_CALC) + ,SFX_FILTER_IMPORT); askForFileName(aFileDlg); } break; @@ -239,7 +243,9 @@ DBG_NAME(OConnectionHelper) { const ::rtl::OUString sExt(RTL_CONSTASCII_USTRINGPARAM("*.mdb")); String sFilterName(ModuleRes (STR_MSACCESS_FILTERNAME)); - ::sfx2::FileDialogHelper aFileDlg(0); + ::sfx2::FileDialogHelper aFileDlg( + ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, + 0); aFileDlg.AddFilter(sFilterName,sExt); aFileDlg.SetCurrentFilter(sFilterName); askForFileName(aFileDlg); @@ -249,7 +255,9 @@ DBG_NAME(OConnectionHelper) { const ::rtl::OUString sAccdb(RTL_CONSTASCII_USTRINGPARAM("*.accdb")); String sFilterName2(ModuleRes (STR_MSACCESS_2007_FILTERNAME)); - ::sfx2::FileDialogHelper aFileDlg(0); + ::sfx2::FileDialogHelper aFileDlg( + ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, + 0); aFileDlg.AddFilter(sFilterName2,sAccdb); aFileDlg.SetCurrentFilter(sFilterName2); askForFileName(aFileDlg); diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 71dbcb357faa..a17d60abd0fd 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -888,8 +888,9 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() sal_Bool ODbTypeWizDialogSetup::callSaveAsDialog() { sal_Bool bRet = sal_False; - WinBits nBits(WB_SAVEAS); - ::sfx2::FileDialogHelper aFileDlg( com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION, static_cast<sal_uInt32>(nBits), this); + ::sfx2::FileDialogHelper aFileDlg( + ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION, + 0, this); const SfxFilter* pFilter = getStandardDatabaseFilter(); if ( pFilter ) { diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index db870237bc85..6f1ed9b41b32 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -44,6 +44,7 @@ #include <vcl/waitobj.hxx> #include <com/sun/star/sdbc/XDriverAccess.hpp> #include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/container/XNameAccess.hpp> #include "DriverSettings.hxx" @@ -56,6 +57,7 @@ namespace dbaui { //......................................................................... + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::beans; @@ -602,8 +604,9 @@ namespace dbaui //------------------------------------------------------------------------- IMPL_LINK(OGeneralPage, OnOpenDocument, PushButton*, /*_pBox*/) { - ::sfx2::FileDialogHelper aFileDlg( 0, - ::String::CreateFromAscii("sdatabase") ); + ::sfx2::FileDialogHelper aFileDlg( + ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, + 0, ::String::CreateFromAscii("sdatabase") ); const SfxFilter* pFilter = getStandardDatabaseFilter(); if ( pFilter ) { diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx index 0a48e8f7d873..ca7740c9fb89 100644 --- a/extensions/source/dbpilots/commonpagesdbp.cxx +++ b/extensions/source/dbpilots/commonpagesdbp.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/sdb/SQLContext.hpp> #include <com/sun/star/sdbc/SQLWarning.hpp> #include <com/sun/star/sdb/CommandType.hpp> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <tools/debug.hxx> #include <svtools/localresaccess.hxx> #include <comphelper/interaction.hxx> @@ -52,6 +53,7 @@ namespace dbp { //......................................................................... + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::container; @@ -198,7 +200,8 @@ namespace dbp //--------------------------------------------------------------------- IMPL_LINK( OTableSelectionPage, OnSearchClicked, PushButton*, /*_pButton*/ ) { - ::sfx2::FileDialogHelper aFileDlg(0); + ::sfx2::FileDialogHelper aFileDlg( + ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, 0); aFileDlg.SetDisplayDirectory( SvtPathOptions().GetWorkPath() ); static const String s_sDatabaseType = String::CreateFromAscii("StarOffice XML (Base)"); diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 1953287f4fe9..62e7ded9e911 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -63,6 +63,7 @@ #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> #include <com/sun/star/awt/XTabControllerModel.hpp> #include <com/sun/star/form/FormSubmitEncoding.hpp> @@ -2779,7 +2780,9 @@ namespace pcr bool bIsLink = true;// reflect the legacy behavior ::rtl::OUString aStrTrans = m_pInfoService->getPropertyTranslation( PROPERTY_ID_IMAGE_URL ); - ::sfx2::FileDialogHelper aFileDlg(SFXWB_GRAPHIC); + ::sfx2::FileDialogHelper aFileDlg( + ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW, + SFXWB_GRAPHIC); aFileDlg.SetTitle(aStrTrans); // non-linked images ( e.g. those located in the document @@ -2836,7 +2839,8 @@ namespace pcr //------------------------------------------------------------------------ bool FormComponentPropertyHandler::impl_browseForTargetURL_nothrow( Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const { - ::sfx2::FileDialogHelper aFileDlg(0); + ::sfx2::FileDialogHelper aFileDlg( + ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, 0); ::rtl::OUString sURL; OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_TARGET_URL ) >>= sURL ); @@ -2889,7 +2893,8 @@ namespace pcr //------------------------------------------------------------------------ bool FormComponentPropertyHandler::impl_browseForDatabaseDocument_throw( Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const { - ::sfx2::FileDialogHelper aFileDlg(0, + ::sfx2::FileDialogHelper aFileDlg( + ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, 0, ::String::CreateFromAscii("sdatabase")); ::rtl::OUString sDataSource; 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; diff --git a/sfx2/inc/sfx2/filedlghelper.hxx b/sfx2/inc/sfx2/filedlghelper.hxx index edc3b091fc4a..a96f54055b0a 100644 --- a/sfx2/inc/sfx2/filedlghelper.hxx +++ b/sfx2/inc/sfx2/filedlghelper.hxx @@ -72,20 +72,12 @@ class SvStringsDtor; class Window; //----------------------------------------------------------------------------- -/* -#define WB_OPEN 0x00200000L -#define WB_SAVEAS 0x00400000L -#define WB_PASSWORD 0x01000000L -*/ - -#define SFXWB_INSERT ( 0x04000000L | WB_OPEN ) // ((WinBits)0x00200000) -#define SFXWB_PASSWORD WB_PASSWORD // ((WinBits)0x01000000) -#define SFXWB_MULTISELECTION 0x20000000L - -#define SFXWB_GRAPHIC 0x00800000L // FileOpen with link and preview box -#define SFXWB_SHOWSTYLES 0x01000000L // FileOpen with link and preview box and styles -#define SFXWB_EXPORT ( 0x040000000L | WB_SAVEAS ) // Export dialog +// the SFXWB constants are for the nFlags parameter of the constructor +#define SFXWB_INSERT 0x04000000L // turn Open into Insert dialog +#define SFXWB_EXPORT 0x40000000L // turn Save into Export dialog +#define SFXWB_MULTISELECTION 0x20000000L +#define SFXWB_GRAPHIC 0x00800000L // register graphic formats #define FILEDIALOG_FILTER_ALL "*.*" @@ -127,21 +119,10 @@ private: FileDialogHelper_Impl *mpImp; - SAL_DLLPRIVATE sal_Int16 getDialogType( sal_Int64 nFlags ) const; - public: - FileDialogHelper( sal_Int64 nFlags, - const String& rFact, - sal_Int16 nDialog, - SfxFilterFlags nMust, - SfxFilterFlags nDont, - const String& rStandardDir, - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList); - - FileDialogHelper( sal_Int64 nFlags, - const String& rFactory, - SfxFilterFlags nMust = 0, - SfxFilterFlags nDont = 0 ); + FileDialogHelper( sal_Int16 nDialogType, + sal_Int64 nFlags, + Window* _pPreferredParent = NULL ); FileDialogHelper( sal_Int16 nDialogType, sal_Int64 nFlags, @@ -158,12 +139,6 @@ public: const String& rStandardDir, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList); - FileDialogHelper( sal_Int64 nFlags ); - - FileDialogHelper( sal_Int16 nDialogType, - sal_Int64 nFlags, - Window* _pPreferredParent = NULL ); - FileDialogHelper( sal_Int16 nDialogType, sal_Int64 nFlags, const ::rtl::OUString& aFilterUIName, @@ -286,7 +261,8 @@ public: #define SFX2_IMPL_DIALOG_SYSTEM 1 #define SFX2_IMPL_DIALOG_OOO 2 -ErrCode FileOpenDialog_Impl( sal_Int64 nFlags, +ErrCode FileOpenDialog_Impl( sal_Int16 nDialogType, + sal_Int64 nFlags, const String& rFact, SvStringsDtor *& rpURLList, String& rFilter, diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 436a8a939729..54b9b26e526a 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -49,6 +49,7 @@ #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/uno/Sequence.h> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <comphelper/processfactory.hxx> #include <cppuhelper/implbase1.hxx> #include <rtl/ustring.hxx> @@ -758,6 +759,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) sal_uIntPtr nErr = sfx2::FileOpenDialog_Impl( + ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, SFXWB_MULTISELECTION, String(), pURLList, aFilter, pSet, &aPath, nDialog, sStandardDir, aBlackList ); diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index 3f8e2ba81f73..826732afe759 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -95,8 +95,9 @@ struct SvxOpenGrf_Impl }; -SvxOpenGrf_Impl::SvxOpenGrf_Impl() : - aFileDlg(SFXWB_GRAPHIC) +SvxOpenGrf_Impl::SvxOpenGrf_Impl() + : aFileDlg(ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW, + SFXWB_GRAPHIC) { uno::Reference < XFilePicker > xFP = aFileDlg.GetFilePicker(); xCtrlAcc = uno::Reference < XFilePickerControlAccess >(xFP, UNO_QUERY); diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index 6418317b6a81..f3293ecdf994 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -43,6 +43,7 @@ #include <com/sun/star/frame/XFramesSupplier.hpp> #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> #include <com/sun/star/ui/dialogs/XFilterManager.hpp> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> #include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp> #include <com/sun/star/ui/dialogs/ControlActions.hpp> @@ -67,6 +68,7 @@ #include "sfx2/sfxresid.hxx" +using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::container; @@ -420,7 +422,9 @@ void ShutdownIcon::StartFileDialog() } if ( !m_pFileDlg ) - m_pFileDlg = new FileDialogHelper( SFXWB_MULTISELECTION, String() ); + m_pFileDlg = new FileDialogHelper( + ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, + SFXWB_MULTISELECTION, String() ); m_pFileDlg->StartExecuteModal( STATIC_LINK( this, ShutdownIcon, DialogClosedHdl_Impl ) ); } diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 08af95aa3b88..1ab73ed2353e 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -2216,47 +2216,6 @@ void FileDialogHelper_Impl::SetContext( FileDialogHelper::Context _eNewContext ) // ------------------------------------------------------------------------ FileDialogHelper::FileDialogHelper( - sal_Int64 nFlags, - const String& rFact, - SfxFilterFlags nMust, - SfxFilterFlags nDont ) -{ - mpImp = new FileDialogHelper_Impl( this, getDialogType( nFlags ), nFlags ); - mxImp = mpImp; - - // create the list of filters - mpImp->addFilters( - SfxObjectShell::GetServiceNameFromFactory(rFact), nMust, nDont ); -} - -FileDialogHelper::FileDialogHelper( - sal_Int64 nFlags, - const String& rFact, - sal_Int16 nDialog, - SfxFilterFlags nMust, - SfxFilterFlags nDont, - const String& rStandardDir, - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList) -{ - mpImp = new FileDialogHelper_Impl( this, getDialogType( nFlags ), nFlags, nDialog, NULL , rStandardDir, rBlackList ); - mxImp = mpImp; - - // create the list of filters - mpImp->addFilters( - SfxObjectShell::GetServiceNameFromFactory(rFact), nMust, nDont ); -} - -// ------------------------------------------------------------------------ -FileDialogHelper::FileDialogHelper( sal_Int64 nFlags ) -{ - sal_Int16 nDialogType = getDialogType( nFlags ); - - mpImp = new FileDialogHelper_Impl( this, nDialogType, nFlags ); - mxImp = mpImp; -} - -// ------------------------------------------------------------------------ -FileDialogHelper::FileDialogHelper( sal_Int16 nDialogType, sal_Int64 nFlags, const String& rFact, @@ -2634,31 +2593,6 @@ uno::Reference < XFilePicker > FileDialogHelper::GetFilePicker() const } // ------------------------------------------------------------------------ -sal_Int16 FileDialogHelper::getDialogType( sal_Int64 nFlags ) const -{ - sal_Int16 nDialogType = FILEOPEN_SIMPLE; - - if ( nFlags & WB_SAVEAS ) - { - if ( nFlags & SFXWB_PASSWORD ) - nDialogType = FILESAVE_AUTOEXTENSION_PASSWORD; - else - nDialogType = FILESAVE_SIMPLE; - } - else if ( nFlags & SFXWB_GRAPHIC ) - { - if ( nFlags & SFXWB_SHOWSTYLES ) - nDialogType = FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE; - else - nDialogType = FILEOPEN_LINK_PREVIEW; - } - else if ( SFXWB_INSERT != ( nFlags & SFXWB_INSERT ) ) - nDialogType = FILEOPEN_READONLY_VERSION; - - return nDialogType; -} - -// ------------------------------------------------------------------------ // XFilePickerListener Methods // ------------------------------------------------------------------------ void SAL_CALL FileDialogHelper::FileSelectionChanged( const FilePickerEvent& aEvent ) @@ -2700,7 +2634,8 @@ void SAL_CALL FileDialogHelper::DialogClosed( const DialogClosedEvent& _rEvent ) // ------------------------------------------------------------------------ -ErrCode FileOpenDialog_Impl( sal_Int64 nFlags, +ErrCode FileOpenDialog_Impl( sal_Int16 nDialogType, + sal_Int64 nFlags, const String& rFact, SvStringsDtor *& rpURLList, String& rFilter, @@ -2711,7 +2646,8 @@ ErrCode FileOpenDialog_Impl( sal_Int64 nFlags, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList ) { ErrCode nRet; - FileDialogHelper aDialog( nFlags, rFact, nDialog, 0, 0, rStandardDir, rBlackList ); + FileDialogHelper aDialog( nDialogType, nFlags, + rFact, nDialog, 0, 0, rStandardDir, rBlackList ); String aPath; if ( pPath ) diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx index cb4354b1d2d2..ec22501cdd2d 100644 --- a/sfx2/source/doc/docinsert.cxx +++ b/sfx2/source/doc/docinsert.cxx @@ -52,6 +52,7 @@ #define _SVSTDARR_STRINGSDTOR #include <svl/svstdarr.hxx> +using namespace ::com::sun::star; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::uno; @@ -96,7 +97,9 @@ void DocumentInserter::StartExecuteModal( const Link& _rDialogClosedLink ) DELETEZ( m_pURLList ); if ( !m_pFileDlg ) { - m_pFileDlg = new FileDialogHelper( m_nDlgFlags, m_sDocFactory ); + m_pFileDlg = new FileDialogHelper( + ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, + m_nDlgFlags, m_sDocFactory ); } m_pFileDlg->StartExecuteModal( LINK( this, DocumentInserter, DialogClosedHdl ) ); } diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx index 1a6204506d85..b67d273f0a2c 100644 --- a/sfx2/source/doc/docvor.cxx +++ b/sfx2/source/doc/docvor.cxx @@ -2221,7 +2221,9 @@ IMPL_LINK( SfxOrganizeDlg_Impl, AddFiles_Impl, Button *, pButton ) (void)pButton; //unused if ( pFileDlg ) delete pFileDlg; - pFileDlg = new sfx2::FileDialogHelper( 0, String() ); + pFileDlg = new sfx2::FileDialogHelper( + ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, + 0, String() ); // add config and basic filter static String sOpenBracket( DEFINE_CONST_UNICODE( " (" ) ); diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index a1e097ef7058..e2c56dcdcab5 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -494,7 +494,7 @@ IMPL_LINK( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx ) void SvxIMapDlg::DoOpen() { - ::sfx2::FileDialogHelper aDlg( + ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); ImageMap aLoadIMap; @@ -535,7 +535,7 @@ void SvxIMapDlg::DoOpen() sal_Bool SvxIMapDlg::DoSave() { - ::sfx2::FileDialogHelper aDlg( + ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 ); const String aBinFilter( DEFINE_CONST_UNICODE( IMAP_BINARY_FILTER ) ); diff --git a/svx/source/dialog/pfiledlg.cxx b/svx/source/dialog/pfiledlg.cxx index 16e124236595..c57c016a572a 100644 --- a/svx/source/dialog/pfiledlg.cxx +++ b/svx/source/dialog/pfiledlg.cxx @@ -31,6 +31,7 @@ #include <sfx2/docfile.hxx> #include <com/sun/star/plugin/PluginDescription.hpp> #include <com/sun/star/plugin/XPluginManager.hpp> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <comphelper/processfactory.hxx> @@ -58,8 +59,8 @@ String SvxPluginFileDlg::GetPath() const return maFileDlg.GetPath(); } -SvxPluginFileDlg::SvxPluginFileDlg (Window *, sal_uInt16 nKind ) : - maFileDlg(SFXWB_INSERT) +SvxPluginFileDlg::SvxPluginFileDlg (Window *, sal_uInt16 nKind ) + : maFileDlg(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, SFXWB_INSERT) { // set title of the dialogwindow switch (nKind) diff --git a/svx/source/form/databaselocationinput.cxx b/svx/source/form/databaselocationinput.cxx index aa377bbd6bd6..4e148eccc868 100644 --- a/svx/source/form/databaselocationinput.cxx +++ b/svx/source/form/databaselocationinput.cxx @@ -247,7 +247,7 @@ namespace svx { ::sfx2::FileDialogHelper aFileDlg( TemplateDescription::FILESAVE_AUTOEXTENSION, - WB_SAVEAS, + 0, m_rLocationInput.GetSystemWindow() ); aFileDlg.SetDisplayDirectory( impl_getCurrentURL() ); diff --git a/svx/workben/msview/msview.cxx b/svx/workben/msview/msview.cxx index fe43765f01bb..34841761bdb0 100644 --- a/svx/workben/msview/msview.cxx +++ b/svx/workben/msview/msview.cxx @@ -865,7 +865,8 @@ void MSViewerWorkWindow::View( const PPTDocumentPtr& pDocument, int nPane ) PPTDocumentPtr MSViewerWorkWindow::Load() { - ::sfx2::FileDialogHelper aDlg( ::sfx2::FILEOPEN_SIMPLE, 0 ); + ::sfx2::FileDialogHelper aDlg( + ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.ppt" ) ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); // INetURLObject aFile( SvtPathOptions().GetPalettePath() ); diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx index 21af280a5784..bbdd2b98fd5b 100644 --- a/sw/source/ui/fldui/javaedit.cxx +++ b/sw/source/ui/fldui/javaedit.cxx @@ -34,6 +34,7 @@ // include --------------------------------------------------------------- +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #define _JAVAEDIT_CXX #include <hintids.hxx> @@ -55,6 +56,9 @@ #include <fldui.hrc> #include <javaedit.hrc> + +using namespace ::com::sun::star; + // static ---------------------------------------------------------------- // class SwJavaEditDialog ------------------------------------------------ @@ -279,7 +283,8 @@ IMPL_LINK( SwJavaEditDialog, InsertFileHdl, PushButton *, pBtn ) Application::SetDefDialogParent( pBtn ); pFileDlg = new ::sfx2::FileDialogHelper( - (SFXWB_INSERT | WB_3DLOOK), String::CreateFromAscii("swriter") ); + ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, + SFXWB_INSERT, String::CreateFromAscii("swriter") ); } pFileDlg->StartExecuteModal( LINK( this, SwJavaEditDialog, DlgClosedHdl ) ); diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 2df2d5de40b7..288141b243ed 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -2467,7 +2467,9 @@ IMPL_LINK( SwGrfExtPage, BrowseHdl, Button *, EMPTYARG ) { if(!pGrfDlg) { - pGrfDlg = new FileDialogHelper( SFXWB_GRAPHIC ); + pGrfDlg = new FileDialogHelper( + ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW, + SFXWB_GRAPHIC ); pGrfDlg->SetTitle(SW_RESSTR(STR_EDIT_GRF )); } pGrfDlg->SetDisplayDirectory( aConnectED.GetText() ); diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index 4ce98f62701c..023bf043e39f 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -306,8 +306,7 @@ void SwSrcView::Execute(SfxRequest& rReq) SvtPathOptions aPathOpt; // filesave dialog with autoextension FileDialogHelper aDlgHelper( - TemplateDescription::FILESAVE_AUTOEXTENSION, - TemplateDescription::FILESAVE_SIMPLE ); + TemplateDescription::FILESAVE_AUTOEXTENSION, 0 ); uno::Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker(); uno::Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY); diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index 031824324bc1..a4483cce59d1 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -34,6 +34,7 @@ #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> #include <com/sun/star/ui/dialogs/ListboxControlActions.hpp> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #define _SVSTDARR_STRINGSSORTDTOR #include <svl/svstdarr.hxx> @@ -259,7 +260,9 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq ) SwDocShell* pDocShell = GetDocShell(); sal_uInt16 nHtmlMode = ::GetHtmlMode(pDocShell); // im HTML-Mode nur verknuepft einfuegen - FileDialogHelper* pFileDlg = new FileDialogHelper( SFXWB_GRAPHIC | SFXWB_SHOWSTYLES ); + FileDialogHelper* pFileDlg = new FileDialogHelper( + ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE, + SFXWB_GRAPHIC ); pFileDlg->SetTitle(SW_RESSTR(STR_INSERT_GRAPHIC )); pFileDlg->SetContext( FileDialogHelper::SW_INSERT_GRAPHIC ); uno::Reference < XFilePicker > xFP = pFileDlg->GetFilePicker(); |