summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2011-11-30 16:08:23 +0100
committerMichael Stahl <mstahl@redhat.com>2011-12-03 00:48:13 +0100
commit5754213c709428b19c68d5242df54683bf83536e (patch)
treea1f23a0e7218884f9186cd063ba46515a26cab6c /sw
parentdb74fdf5346c4f97256522ee2a3200fcdce1af5a (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 'sw')
-rw-r--r--sw/source/ui/fldui/javaedit.cxx7
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx4
-rw-r--r--sw/source/ui/uiview/srcview.cxx3
-rw-r--r--sw/source/ui/uiview/view2.cxx5
4 files changed, 14 insertions, 5 deletions
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();