diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-23 09:35:08 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-26 15:27:09 +0000 |
commit | 942f05996bc287923cdbcae12c64e57adf8ec975 (patch) | |
tree | 7005380763a9ecb93f5f27c28174633b9774abb7 /sc/source/ui/docshell/docsh4.cxx | |
parent | c410a3dcfeb68ba2247c0d879727afe4ca8ed3da (diff) |
convert remaining ErrorBox to weld::MessageDialog
and
convert remaining QueryBox to weld::MessageDialog
Change-Id: Ifb4c316dee8eabf57c4940c44e29c65a2781aa6c
Diffstat (limited to 'sc/source/ui/docshell/docsh4.cxx')
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 749ec29784a7..17f597270876 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -261,8 +261,11 @@ void ScDocShell::Execute( SfxRequest& rReq ) aMessage += sTarget; aMessage += aTemplate.getToken( 1, '#' ); - ScopedVclPtrInstance< QueryBox > aBox( nullptr, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, aMessage ); - bDo = ( aBox->Execute() == RET_YES ); + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(nullptr, + VclMessageType::Question, VclButtonsType::YesNo, + aMessage)); + xQueryBox->set_default_response(RET_YES); + bDo = xQueryBox->run() == RET_YES; } if (bDo) @@ -521,9 +524,12 @@ void ScDocShell::Execute( SfxRequest& rReq ) OSL_ENSURE(pViewSh,"SID_REIMPORT_AFTER_LOAD: no View"); if (pViewSh && pDBColl) { - ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, - ScGlobal::GetRscString(STR_REIMPORT_AFTER_LOAD) ); - if (aBox->Execute() == RET_YES) + vcl::Window* pWin = GetActiveDialogParent(); + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Question, VclButtonsType::YesNo, + ScGlobal::GetRscString(STR_REIMPORT_AFTER_LOAD))); + xQueryBox->set_default_response(RET_YES); + if (xQueryBox->run() == RET_YES) { ScDBCollection::NamedDBs& rDBs = pDBColl->getNamedDBs(); ScDBCollection::NamedDBs::iterator itr = rDBs.begin(), itrEnd = rDBs.end(); @@ -973,11 +979,12 @@ void ScDocShell::Execute( SfxRequest& rReq ) bool bContinue = true; if ( HasName() ) { - ScopedVclPtrInstance<QueryBox> aBox( - GetActiveDialogParent(), - MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, - ScGlobal::GetRscString( STR_DOC_WILLBESAVED ) ); - if ( aBox->Execute() == RET_NO ) + vcl::Window* pWin = GetActiveDialogParent(); + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Question, VclButtonsType::YesNo, + ScGlobal::GetRscString(STR_REIMPORT_AFTER_LOAD))); + xQueryBox->set_default_response(RET_YES); + if (xQueryBox->run() == RET_NO) { bContinue = false; } |