diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-31 11:57:38 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-31 22:08:07 +0100 |
commit | 9d1c68ae17ef566b9034478c7b29411c62684289 (patch) | |
tree | 265f9e7decdbe9dc77ff7a108d878b68ed9887a6 /fpicker | |
parent | 97be9270868990d3d45b29724c8fdc3598d2a64c (diff) |
replace StartExecuteModal with StartExecuteAsync
Change-Id: I2c0e0266f6bb468ebb5285f95d1824cf12100812
Reviewed-on: https://gerrit.libreoffice.org/62690
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/office/OfficeFilePicker.cxx | 15 | ||||
-rw-r--r-- | fpicker/source/office/OfficeFilePicker.hxx | 2 | ||||
-rw-r--r-- | fpicker/source/office/OfficeFolderPicker.cxx | 11 | ||||
-rw-r--r-- | fpicker/source/office/OfficeFolderPicker.hxx | 4 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.cxx | 9 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.hxx | 2 |
6 files changed, 21 insertions, 22 deletions
diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx index 8966e7f9f426..6f22961fdf8d 100644 --- a/fpicker/source/office/OfficeFilePicker.cxx +++ b/fpicker/source/office/OfficeFilePicker.cxx @@ -212,22 +212,18 @@ void SvtFilePicker::prepareExecute() } - -IMPL_LINK( SvtFilePicker, DialogClosedHdl, Dialog&, rDlg, void ) +void SvtFilePicker::DialogClosedHdl(sal_Int32 nResult) { if ( m_xDlgClosedListener.is() ) { - sal_Int16 nRet = static_cast< sal_Int16 >( rDlg.GetResult() ); + sal_Int16 nRet = static_cast< sal_Int16 >(nResult); css::ui::dialogs::DialogClosedEvent aEvent( *this, nRet ); m_xDlgClosedListener->dialogClosed( aEvent ); m_xDlgClosedListener.clear(); } } - // SvtFilePicker - - PickerFlags SvtFilePicker::getPickerFlags() { // set the winbits for creating the filedialog @@ -505,8 +501,11 @@ void SAL_CALL SvtFilePicker::startExecuteModal( const Reference< css::ui::dialog m_xDlgClosedListener = xListener; prepareDialog(); prepareExecute(); - getDialog()->EnableAutocompletion(); - getDialog()->StartExecuteModal( LINK( this, SvtFilePicker, DialogClosedHdl ) ); + SvtFileDialog_Base* pDialog = getDialog(); + pDialog->EnableAutocompletion(); + pDialog->StartExecuteAsync([=](sal_Int32 nResult){ + DialogClosedHdl(nResult); + }); } diff --git a/fpicker/source/office/OfficeFilePicker.hxx b/fpicker/source/office/OfficeFilePicker.hxx index af60daa9ee0b..9df75d019fb7 100644 --- a/fpicker/source/office/OfficeFilePicker.hxx +++ b/fpicker/source/office/OfficeFilePicker.hxx @@ -222,7 +222,7 @@ protected: void prepareExecute( ); - DECL_LINK( DialogClosedHdl, Dialog&, void ); + void DialogClosedHdl(sal_Int32 nResult); }; // SvtRemoteFilePicker diff --git a/fpicker/source/office/OfficeFolderPicker.cxx b/fpicker/source/office/OfficeFolderPicker.cxx index 5ace5400eedf..06703055fb4b 100644 --- a/fpicker/source/office/OfficeFolderPicker.cxx +++ b/fpicker/source/office/OfficeFolderPicker.cxx @@ -63,8 +63,11 @@ void SAL_CALL SvtFolderPicker::startExecuteModal( const Reference< css::ui::dial m_xListener = xListener; prepareDialog(); prepareExecute(); - getDialog()->EnableAutocompletion(); - getDialog()->StartExecuteModal( LINK( this, SvtFolderPicker, DialogClosedHdl ) ); + SvtFileDialog_Base* pDialog = getDialog(); + pDialog->EnableAutocompletion(); + pDialog->StartExecuteAsync([=](sal_Int32 nResult){ + DialogClosedHdl(nResult); + }); } VclPtr<SvtFileDialog_Base> SvtFolderPicker::implCreateDialog( vcl::Window* _pParent ) @@ -96,11 +99,11 @@ void SvtFolderPicker::prepareExecute() } } -IMPL_LINK( SvtFolderPicker, DialogClosedHdl, Dialog&, rDlg, void ) +void SvtFolderPicker::DialogClosedHdl(sal_Int32 nResult) { if ( m_xListener.is() ) { - sal_Int16 nRet = static_cast< sal_Int16 >( rDlg.GetResult() ); + sal_Int16 nRet = static_cast<sal_Int16>(nResult); css::ui::dialogs::DialogClosedEvent aEvent( *this, nRet ); m_xListener->dialogClosed( aEvent ); m_xListener.clear(); diff --git a/fpicker/source/office/OfficeFolderPicker.hxx b/fpicker/source/office/OfficeFolderPicker.hxx index 4dd96a833151..7a44881c05f8 100644 --- a/fpicker/source/office/OfficeFolderPicker.hxx +++ b/fpicker/source/office/OfficeFolderPicker.hxx @@ -45,8 +45,8 @@ private: css::uno::Reference< css::ui::dialogs::XDialogClosedListener > m_xListener; - void prepareExecute( ); - DECL_LINK( DialogClosedHdl, Dialog&, void ); + void prepareExecute(); + void DialogClosedHdl(sal_Int32 nResult); public: SvtFolderPicker(); diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 18714773cdf3..c7211f330a00 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -1685,17 +1685,15 @@ short SvtFileDialog::Execute() return nResult; } - -void SvtFileDialog::StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) +bool SvtFileDialog::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) { if (!PrepareExecute()) - return; + return false; // start of the dialog - ModalDialog::StartExecuteModal( rEndDialogHdl ); + return ModalDialog::StartExecuteAsync(rCtx); } - void SvtFileDialog::onAsyncOperationStarted() { EnableUI( false ); @@ -1704,7 +1702,6 @@ void SvtFileDialog::onAsyncOperationStarted() pImpl->_pBtnCancel->GrabFocus(); } - void SvtFileDialog::onAsyncOperationFinished() { EnableUI( true ); diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx index 3cb4f631e307..165e8426086a 100644 --- a/fpicker/source/office/iodlg.hxx +++ b/fpicker/source/office/iodlg.hxx @@ -173,7 +173,7 @@ public: virtual void dispose() override; virtual short Execute() override; - virtual void StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) override; + virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; void FileSelect(); void FilterSelect() override; |