diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-11 13:07:30 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-12 06:57:19 +0000 |
commit | 1342818790083ec1324f76c4eb1813827a4f5b72 (patch) | |
tree | 998289c3aaeb78f41c10f88d8455f6cc46426886 /include | |
parent | 0f4ac20e0456b32995f7a3aff4e46b59e64704a6 (diff) |
convert SFXWB file dialog flags to scoped enum
Change-Id: I1ab5191dc582c46785da58d50b2e68c30b5cbc9b
Reviewed-on: https://gerrit.libreoffice.org/24881
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/docinsert.hxx | 3 | ||||
-rw-r--r-- | include/sfx2/filedlghelper.hxx | 27 |
2 files changed, 18 insertions, 12 deletions
diff --git a/include/sfx2/docinsert.hxx b/include/sfx2/docinsert.hxx index dfc423acf1f4..736577627a60 100644 --- a/include/sfx2/docinsert.hxx +++ b/include/sfx2/docinsert.hxx @@ -29,6 +29,7 @@ namespace sfx2 { class FileDialogHelper; } class SfxMedium; class SfxItemSet; +enum class FileDialogFlags; typedef ::std::vector< SfxMedium* > SfxMediumList; @@ -41,7 +42,7 @@ private: OUString m_sFilter; Link<sfx2::FileDialogHelper*,void> m_aDialogClosedLink; - sal_Int64 const m_nDlgFlags; + FileDialogFlags const m_nDlgFlags; ErrCode m_nError; sfx2::FileDialogHelper* m_pFileDlg; diff --git a/include/sfx2/filedlghelper.hxx b/include/sfx2/filedlghelper.hxx index d8a8fe97b14c..952bd17dd554 100644 --- a/include/sfx2/filedlghelper.hxx +++ b/include/sfx2/filedlghelper.hxx @@ -58,12 +58,17 @@ namespace com class SfxItemSet; namespace vcl { class Window; } -// 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_SAVEACOPY 0x00400000L // turn Save into Save a Copy dialog -#define SFXWB_MULTISELECTION 0x20000000L -#define SFXWB_GRAPHIC 0x00800000L // register graphic formats +enum class FileDialogFlags { + NONE = 0x00, + Insert = 0x01, // turn Open into Insert dialog + Export = 0x02, // turn Save into Export dialog + SaveACopy = 0x04, // turn Save into Save a Copy dialog + MultiSelection = 0x08, + Graphic = 0x10 // register graphic formats +}; +namespace o3tl { + template<> struct typed_flags<FileDialogFlags> : is_typed_flags<FileDialogFlags, 0x1f> {}; +} #define FILEDIALOG_FILTER_ALL "*.*" @@ -101,17 +106,17 @@ private: public: FileDialogHelper( sal_Int16 nDialogType, - sal_Int64 nFlags, + FileDialogFlags nFlags = FileDialogFlags::NONE, vcl::Window* _pPreferredParent = nullptr ); FileDialogHelper( sal_Int16 nDialogType, - sal_Int64 nFlags, + FileDialogFlags nFlags, const OUString& rFactory, SfxFilterFlags nMust = SfxFilterFlags::NONE, SfxFilterFlags nDont = SfxFilterFlags::NONE ); FileDialogHelper( sal_Int16 nDialogType, - sal_Int64 nFlags, + FileDialogFlags nFlags, const OUString& rFactory, sal_Int16 nDialog, SfxFilterFlags nMust, @@ -121,7 +126,7 @@ public: vcl::Window* _pPreferredParent = nullptr); FileDialogHelper( sal_Int16 nDialogType, - sal_Int64 nFlags, + FileDialogFlags nFlags, const OUString& aFilterUIName, const OUString& aExtName, const OUString& rStandardDir, @@ -240,7 +245,7 @@ public: #define SFX2_IMPL_DIALOG_REMOTE 3 ErrCode FileOpenDialog_Impl( sal_Int16 nDialogType, - sal_Int64 nFlags, + FileDialogFlags nFlags, const OUString& rFact, std::vector<OUString>& rpURLList, OUString& rFilter, |