summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--automation/source/miniapp/testapp.cxx2
-rw-r--r--cui/source/customize/acccfg.cxx2
-rw-r--r--cui/source/dialogs/insdlg.cxx2
-rw-r--r--cui/source/options/doclinkdialog.cxx2
-rw-r--r--cui/source/options/optinet2.cxx2
-rw-r--r--dbaccess/source/ext/adabas/AdabasNewDb.cxx2
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.cxx6
-rw-r--r--dbaccess/source/ui/dlg/generalpage.cxx3
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx3
-rw-r--r--sd/source/ui/dlg/dlgass.cxx3
-rw-r--r--sd/source/ui/dlg/tpaction.cxx2
-rw-r--r--sd/source/ui/func/fuinsfil.cxx2
-rw-r--r--sfx2/source/appl/appopen.cxx3
-rw-r--r--sfx2/source/appl/shutdownicon.cxx2
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx3
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx46
-rw-r--r--sfx2/source/dialog/filedlgimpl.hxx3
-rw-r--r--sfx2/source/doc/docvor.cxx2
18 files changed, 60 insertions, 30 deletions
diff --git a/automation/source/miniapp/testapp.cxx b/automation/source/miniapp/testapp.cxx
index d13eddff0d19..5ee27cb815a0 100644
--- a/automation/source/miniapp/testapp.cxx
+++ b/automation/source/miniapp/testapp.cxx
@@ -73,7 +73,7 @@ IMPL_LINK(MainWindow,MenuSelectHdl,MenuBar*,aMenu)
void MainWindow::FileOpen()
{
- FileDialog Dlg(this,WB_OPEN );
+ FileDialog Dlg(this, 0);
Dlg.AddFilter(CUniString("Alle Dateien"), CUniString("*.*"));
Dlg.SetCurFilter (CUniString("*.*"));
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 3f305a627c2a..f4f46625a585 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -1034,7 +1034,7 @@ void SfxAcceleratorConfigPage::ResetConfig()
IMPL_LINK( SfxAcceleratorConfigPage, Load, Button*, EMPTYARG )
{
// ask for filename, where we should load the new config data from
- StartFileDialog( WB_OPEN | WB_STDMODAL | WB_3DLOOK, aLoadAccelConfigStr );
+ StartFileDialog( WB_STDMODAL | WB_3DLOOK, aLoadAccelConfigStr );
return 0;
}
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index 18e4aa4ca871..bc319cb00e39 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -1032,7 +1032,7 @@ IMPL_STATIC_LINK( SfxInsertFloatingFrameDialog, OpenHdl, PushButton*, EMPTYARG )
Application::SetDefDialogParent( pThis );
// create the file dialog
- sfx2::FileDialogHelper aFileDlg( WB_OPEN | SFXWB_PASSWORD, String() );
+ sfx2::FileDialogHelper aFileDlg( SFXWB_PASSWORD, 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 d4f7c84c284d..b6500b31a936 100644
--- a/cui/source/options/doclinkdialog.cxx
+++ b/cui/source/options/doclinkdialog.cxx
@@ -166,7 +166,7 @@ namespace svx
//------------------------------------------------------------------
IMPL_LINK( ODocumentLinkDialog, OnBrowseFile, void*, EMPTYARG )
{
- ::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK | WB_STDMODAL | WB_OPEN);
+ ::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK | WB_STDMODAL);
static const String s_sDatabaseType = String::CreateFromAscii("StarOffice XML (Base)");
const SfxFilter* pFilter = SfxFilter::GetFilterByName( s_sDatabaseType);
if ( pFilter )
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 65679e2de94c..f1bcd0722909 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -1440,7 +1440,7 @@ IMPL_LINK( SvxEMailTabPage, FileDialogHdl_Impl, PushButton*, pButton )
{
FileDialogHelper aHelper(
com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
- WB_OPEN );
+ 0 );
String sPath = aMailerURLED.GetText();
if ( !sPath.Len() )
sPath.AppendAscii("/usr/bin");
diff --git a/dbaccess/source/ext/adabas/AdabasNewDb.cxx b/dbaccess/source/ext/adabas/AdabasNewDb.cxx
index 0438e4ae00dd..1aa86cdf3ad4 100644
--- a/dbaccess/source/ext/adabas/AdabasNewDb.cxx
+++ b/dbaccess/source/ext/adabas/AdabasNewDb.cxx
@@ -549,7 +549,7 @@ IMPL_LINK( OAdabasNewDbDlg, LoseFocusHdl, Edit *, pEdit )
//------------------------------------------------------------------------
IMPL_LINK( OAdabasNewDbDlg, LoadButtonClickHdl, Button *, /*pButton*/ )
{
- ::sfx2::FileDialogHelper aLoad(WB_3DLOOK | WB_STDMODAL | WB_OPEN);
+ ::sfx2::FileDialogHelper aLoad(WB_3DLOOK | WB_STDMODAL);
if(!m_Backup_File.Len())
aLoad.SetDisplayDirectory(SvtPathOptions().GetWorkPath());
else
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index 8696341512c6..d5c5058e4165 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -229,7 +229,7 @@ DBG_NAME(OConnectionHelper)
case ::dbaccess::DST_CALC:
{
SvtModuleOptions aModule;
- ::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK | WB_STDMODAL | WB_OPEN
+ ::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK | WB_STDMODAL
,aModule.GetFactoryEmptyDocumentURL(SvtModuleOptions::E_CALC)
,SFX_FILTER_IMPORT);
askForFileName(aFileDlg);
@@ -239,7 +239,7 @@ DBG_NAME(OConnectionHelper)
{
const ::rtl::OUString sExt(RTL_CONSTASCII_USTRINGPARAM("*.mdb"));
String sFilterName(ModuleRes (STR_MSACCESS_FILTERNAME));
- ::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK | WB_STDMODAL | WB_OPEN);
+ ::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK | WB_STDMODAL);
aFileDlg.AddFilter(sFilterName,sExt);
aFileDlg.SetCurrentFilter(sFilterName);
askForFileName(aFileDlg);
@@ -249,7 +249,7 @@ DBG_NAME(OConnectionHelper)
{
const ::rtl::OUString sAccdb(RTL_CONSTASCII_USTRINGPARAM("*.accdb"));
String sFilterName2(ModuleRes (STR_MSACCESS_2007_FILTERNAME));
- ::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK | WB_STDMODAL | WB_OPEN);
+ ::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK | WB_STDMODAL);
aFileDlg.AddFilter(sFilterName2,sAccdb);
aFileDlg.SetCurrentFilter(sFilterName2);
askForFileName(aFileDlg);
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 459190918196..db870237bc85 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -602,7 +602,8 @@ namespace dbaui
//-------------------------------------------------------------------------
IMPL_LINK(OGeneralPage, OnOpenDocument, PushButton*, /*_pBox*/)
{
- ::sfx2::FileDialogHelper aFileDlg( WB_OPEN, ::String::CreateFromAscii("sdatabase") );
+ ::sfx2::FileDialogHelper aFileDlg( 0,
+ ::String::CreateFromAscii("sdatabase") );
const SfxFilter* pFilter = getStandardDatabaseFilter();
if ( pFilter )
{
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 0f4832b767b5..5ca5ac4856f2 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2889,7 +2889,8 @@ namespace pcr
//------------------------------------------------------------------------
bool FormComponentPropertyHandler::impl_browseForDatabaseDocument_throw( Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
{
- ::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK|WB_OPEN,::String::CreateFromAscii("sdatabase"));
+ ::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK,
+ ::String::CreateFromAscii("sdatabase"));
::rtl::OUString sDataSource;
OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_DATASOURCE ) >>= sDataSource );
diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx
index 9b68de71bde4..1c35a5488408 100644
--- a/sd/source/ui/dlg/dlgass.cxx
+++ b/sd/source/ui/dlg/dlgass.cxx
@@ -1879,7 +1879,8 @@ IMPL_LINK( AssistentDlg, FinishHdl, OKButton *, EMPTYARG )
String aFileToOpen = GetDocPath();
if(aFileToOpen.Len() == 0)
{
- sfx2::FileDialogHelper aFileDlg( WB_OPEN, ::String::CreateFromAscii("simpress") );
+ sfx2::FileDialogHelper aFileDlg( 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 e46c9fec6f88..fd468003395d 100644
--- a/sd/source/ui/dlg/tpaction.cxx
+++ b/sd/source/ui/dlg/tpaction.cxx
@@ -470,7 +470,7 @@ void SdTPAction::OpenFileDialog()
}
else
{
- sfx2::FileDialogHelper aFileDialog(WB_OPEN | WB_3DLOOK | WB_STDMODAL );
+ sfx2::FileDialogHelper aFileDialog(WB_3DLOOK | WB_STDMODAL);
if (bDocument && !aFile.Len())
aFile = SvtPathOptions().GetWorkPath();
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index 89dc5435882c..7575773015f0 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -116,7 +116,7 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
if (!pArgs)
{
- sfx2::FileDialogHelper aFileDialog( WB_OPEN | SFXWB_INSERT | WB_STDMODAL );
+ sfx2::FileDialogHelper aFileDialog( SFXWB_INSERT | WB_STDMODAL );
Reference< XFilePicker > xFilePicker( aFileDialog.GetFilePicker(), UNO_QUERY );
Reference< XFilterManager > xFilterManager( xFilePicker, UNO_QUERY );
String aOwnCont;
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index d35b2c2d8b34..c6fe758d777b 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -758,7 +758,8 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
sal_uIntPtr nErr = sfx2::FileOpenDialog_Impl(
- WB_OPEN | SFXWB_MULTISELECTION | SFXWB_SHOWVERSIONS, String(), pURLList, aFilter, pSet, &aPath, nDialog, sStandardDir, aBlackList );
+ SFXWB_MULTISELECTION | SFXWB_SHOWVERSIONS, String(), pURLList,
+ aFilter, pSet, &aPath, nDialog, sStandardDir, aBlackList );
if ( nErr == ERRCODE_ABORT )
{
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 2b32ee2c5c4c..6418317b6a81 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -420,7 +420,7 @@ void ShutdownIcon::StartFileDialog()
}
if ( !m_pFileDlg )
- m_pFileDlg = new FileDialogHelper( WB_OPEN | SFXWB_MULTISELECTION, String() );
+ m_pFileDlg = new FileDialogHelper( SFXWB_MULTISELECTION, String() );
m_pFileDlg->StartExecuteModal( STATIC_LINK( this, ShutdownIcon, DialogClosedHdl_Impl ) );
}
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 1832e05767d5..df7f9634b974 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1374,7 +1374,8 @@ IMPL_LINK( SfxInternetPage, ClickHdlForward, Control*, pCtrl )
IMPL_LINK( SfxInternetPage, ClickHdlBrowseURL, PushButton*, EMPTYARG )
{
if ( !pFileDlg )
- pFileDlg = new sfx2::FileDialogHelper( TemplateDescription::FILEOPEN_SIMPLE, WB_OPEN );
+ pFileDlg = new sfx2::FileDialogHelper(
+ TemplateDescription::FILEOPEN_SIMPLE, 0 );
pFileDlg->SetDisplayDirectory( aEDForwardURL.GetText() );
pFileDlg->StartExecuteModal( LINK( this, SfxInternetPage, DialogClosedHdl ) );
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 5a87f5d96ab6..08af95aa3b88 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -856,6 +856,29 @@ static bool lcl_isSystemFilePicker( const uno::Reference< XFilePicker >& _rxFP )
return false;
}
+enum open_or_save_t {OPEN, SAVE};
+static open_or_save_t lcl_OpenOrSave(sal_Int16 const nDialogType)
+{
+ switch (nDialogType)
+ {
+ case FILEOPEN_SIMPLE:
+ case FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE:
+ case FILEOPEN_PLAY:
+ case FILEOPEN_READONLY_VERSION:
+ case FILEOPEN_LINK_PREVIEW:
+ return OPEN;
+ case FILESAVE_SIMPLE:
+ case FILESAVE_AUTOEXTENSION_PASSWORD:
+ case FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS:
+ case FILESAVE_AUTOEXTENSION_SELECTION:
+ case FILESAVE_AUTOEXTENSION_TEMPLATE:
+ case FILESAVE_AUTOEXTENSION:
+ return SAVE;
+ default:
+ assert(false); // invalid dialog type
+ }
+}
+
// ------------------------------------------------------------------------
// ----------- FileDialogHelper_Impl ---------------------------
// ------------------------------------------------------------------------
@@ -909,7 +932,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
// default settings
m_nDontFlags = SFX_FILTER_INTERNAL | SFX_FILTER_NOTINFILEDLG | SFX_FILTER_NOTINSTALLED;
- if( WB_OPEN == ( nFlags & WB_OPEN ) )
+ if (OPEN == lcl_OpenOrSave(m_nDialogType))
m_nMustFlags = SFX_FILTER_IMPORT;
else
m_nMustFlags = SFX_FILTER_EXPORT;
@@ -1697,8 +1720,7 @@ void FileDialogHelper_Impl::createMatcher( const String& rFactory )
}
// ------------------------------------------------------------------------
-void FileDialogHelper_Impl::addFilters( sal_Int64 nFlags,
- const String& rFactory,
+void FileDialogHelper_Impl::addFilters( const String& rFactory,
SfxFilterFlags nMust,
SfxFilterFlags nDont )
{
@@ -1757,7 +1779,7 @@ void FileDialogHelper_Impl::addFilters( sal_Int64 nFlags,
// append the filters
::rtl::OUString sFirstFilter;
- if ( WB_OPEN == ( nFlags & WB_OPEN ) )
+ if (OPEN == lcl_OpenOrSave(m_nDialogType))
::sfx2::appendFiltersForOpen( aIter, xFltMgr, sFirstFilter, *this );
else if ( mbExport )
::sfx2::appendExportFilters( aIter, xFltMgr, sFirstFilter, *this );
@@ -2203,7 +2225,8 @@ FileDialogHelper::FileDialogHelper(
mxImp = mpImp;
// create the list of filters
- mpImp->addFilters( nFlags, SfxObjectShell::GetServiceNameFromFactory(rFact), nMust, nDont );
+ mpImp->addFilters(
+ SfxObjectShell::GetServiceNameFromFactory(rFact), nMust, nDont );
}
FileDialogHelper::FileDialogHelper(
@@ -2219,7 +2242,8 @@ FileDialogHelper::FileDialogHelper(
mxImp = mpImp;
// create the list of filters
- mpImp->addFilters( nFlags, SfxObjectShell::GetServiceNameFromFactory(rFact), nMust, nDont );
+ mpImp->addFilters(
+ SfxObjectShell::GetServiceNameFromFactory(rFact), nMust, nDont );
}
// ------------------------------------------------------------------------
@@ -2243,7 +2267,8 @@ FileDialogHelper::FileDialogHelper(
mxImp = mpImp;
// create the list of filters
- mpImp->addFilters( nFlags, SfxObjectShell::GetServiceNameFromFactory(rFact), nMust, nDont );
+ mpImp->addFilters(
+ SfxObjectShell::GetServiceNameFromFactory(rFact), nMust, nDont );
}
// ------------------------------------------------------------------------
@@ -2261,7 +2286,8 @@ FileDialogHelper::FileDialogHelper(
mxImp = mpImp;
// create the list of filters
- mpImp->addFilters( nFlags, SfxObjectShell::GetServiceNameFromFactory(rFact), nMust, nDont );
+ mpImp->addFilters(
+ SfxObjectShell::GetServiceNameFromFactory(rFact), nMust, nDont );
}
// ------------------------------------------------------------------------
@@ -2299,8 +2325,8 @@ FileDialogHelper::FileDialogHelper(
aWildcard += aExtName;
- ::rtl::OUString aUIString =
- ::sfx2::addExtension( aFilterUIName, aWildcard, ( WB_OPEN == ( nFlags & WB_OPEN ) ), *mpImp );
+ ::rtl::OUString const aUIString = ::sfx2::addExtension( aFilterUIName,
+ aWildcard, (OPEN == lcl_OpenOrSave(mpImp->m_nDialogType)), *mpImp);
AddFilter( aUIString, aWildcard );
}
diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx
index 6b6b66d64c46..8d0ddcb2ca55 100644
--- a/sfx2/source/dialog/filedlgimpl.hxx
+++ b/sfx2/source/dialog/filedlgimpl.hxx
@@ -112,8 +112,7 @@ namespace sfx2
sal_Bool mbSelectionFltrEnabled : 1;
private:
- void addFilters( sal_Int64 nFlags,
- const String& rFactory,
+ void addFilters( const String& rFactory,
SfxFilterFlags nMust,
SfxFilterFlags nDont );
void addFilter( const ::rtl::OUString& rFilterName,
diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx
index 243e5f2f2619..1a6204506d85 100644
--- a/sfx2/source/doc/docvor.cxx
+++ b/sfx2/source/doc/docvor.cxx
@@ -2221,7 +2221,7 @@ IMPL_LINK( SfxOrganizeDlg_Impl, AddFiles_Impl, Button *, pButton )
(void)pButton; //unused
if ( pFileDlg )
delete pFileDlg;
- pFileDlg = new sfx2::FileDialogHelper( WB_OPEN, String() );
+ pFileDlg = new sfx2::FileDialogHelper( 0, String() );
// add config and basic filter
static String sOpenBracket( DEFINE_CONST_UNICODE( " (" ) );