summaryrefslogtreecommitdiff
path: root/extensions
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 /extensions
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 'extensions')
-rw-r--r--extensions/source/dbpilots/commonpagesdbp.cxx5
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx11
2 files changed, 12 insertions, 4 deletions
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;