Kaydet (Commit) b4ac906c authored tarafından Noel Grandin's avatar Noel Grandin

convert to WB_SAVEAS to flags on SfxAcceleratorConfigPage::StartFileDialog

Change-Id: I52ff0b4ba892a74d1dad9ce8c6c7638e3463affe
Reviewed-on: https://gerrit.libreoffice.org/41303Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 50acead1
......@@ -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;
......
......@@ -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();
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment