summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-08-18 16:42:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-19 06:54:24 +0200
commitb4ac906cd07c06abcda427f70787b9b6c213b354 (patch)
tree55b529720c17e3b86ef5d0dfcb920ca65b99143a
parent50acead19bd13a344f8ca9b3879f8e8cb0b24eb7 (diff)
convert to WB_SAVEAS to flags on SfxAcceleratorConfigPage::StartFileDialog
Change-Id: I52ff0b4ba892a74d1dad9ce8c6c7638e3463affe Reviewed-on: https://gerrit.libreoffice.org/41303 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--cui/source/customize/acccfg.cxx8
-rw-r--r--cui/source/inc/acccfg.hxx4
-rw-r--r--include/tools/wintypes.hxx1
3 files changed, 7 insertions, 6 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 1d0af8c3d45d..04d055a5537b 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -1054,12 +1054,12 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, SearchUpdateHdl, Edit&, void)
IMPL_LINK_NOARG(SfxAcceleratorConfigPage, Load, Button*, void)
{
// ask for filename, where we should load the new config data from
- StartFileDialog( 0, aLoadAccelConfigStr );
+ StartFileDialog( StartFileDialogType::Open, aLoadAccelConfigStr );
}
IMPL_LINK_NOARG(SfxAcceleratorConfigPage, Save, Button*, void)
{
- StartFileDialog( WB_SAVEAS, aSaveAccelConfigStr );
+ StartFileDialog( StartFileDialogType::SaveAs, aSaveAccelConfigStr );
}
IMPL_LINK_NOARG(SfxAcceleratorConfigPage, Default, Button*, void)
@@ -1391,9 +1391,9 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, SaveHdl, sfx2::FileDialogHelper*, void
}
-void SfxAcceleratorConfigPage::StartFileDialog( WinBits nBits, const OUString& rTitle )
+void SfxAcceleratorConfigPage::StartFileDialog( StartFileDialogType nType, const OUString& rTitle )
{
- bool bSave = ( ( nBits & WB_SAVEAS ) == WB_SAVEAS );
+ bool bSave = nType == StartFileDialogType::SaveAs;
short nDialogType = bSave ? ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION
: ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE;
delete m_pFileDlg;
diff --git a/cui/source/inc/acccfg.hxx b/cui/source/inc/acccfg.hxx
index adc67e208885..cc78f437d913 100644
--- a/cui/source/inc/acccfg.hxx
+++ b/cui/source/inc/acccfg.hxx
@@ -103,6 +103,8 @@ namespace sfx2
class FileDialogHelper;
}
+enum class StartFileDialogType { Open, SaveAs };
+
class SfxAcceleratorConfigPage : public SfxTabPage
{
friend class SfxAccCfgTabListBox_Impl;
@@ -159,7 +161,7 @@ private:
SvTreeListEntry* applySearchFilter(OUString const & rSearchTerm, SvTreeListBox* rListBox);
void InitAccCfg();
sal_uLong MapKeyCodeToPos( const vcl::KeyCode &rCode ) const;
- void StartFileDialog( WinBits nBits, const OUString& rTitle );
+ void StartFileDialog( StartFileDialogType nType, const OUString& rTitle );
void Init(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& pAccMgr);
void ResetConfig();
diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx
index 0eccec5cc259..cd1e5750d5a0 100644
--- a/include/tools/wintypes.hxx
+++ b/include/tools/wintypes.hxx
@@ -265,7 +265,6 @@ WinBits const WB_QUICK_SEARCH = SAL_CONST_INT64(0x010000000000);
// For FileOpen Dialog
WinBits const WB_PATH = 0x00100000;
WinBits const WB_OPEN = 0x00200000;
-WinBits const WB_SAVEAS = 0x00400000;