diff options
Diffstat (limited to 'sfx2/source/view/viewsh.cxx')
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index d7962e72be16..f5b0f7399318 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -22,9 +22,9 @@ #include <svl/stritem.hxx> #include <svl/eitem.hxx> #include <svl/whiter.hxx> -#include <vcl/layout.hxx> #include <vcl/msgbox.hxx> #include <vcl/toolbox.hxx> +#include <vcl/weld.hxx> #include <svl/intitem.hxx> #include <svtools/langhelp.hxx> #include <svtools/sfxecode.hxx> @@ -497,8 +497,11 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) if ( eResult == SfxMailModel::SEND_MAIL_ERROR ) { - ScopedVclPtrInstance< MessageDialog > aBox(SfxGetpApp()->GetTopWindow(), SfxResId( STR_ERROR_SEND_MAIL ), VclMessageType::Info); - aBox->Execute(); + vcl::Window* pWin = SfxGetpApp()->GetTopWindow(); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + SfxResId(STR_ERROR_SEND_MAIL))); + xBox->run(); rReq.Ignore(); } else @@ -517,9 +520,12 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) SfxMailModel::SendMailResult eResult = aModel.SaveAndSend( xFrame ); if( eResult == SfxMailModel::SEND_MAIL_ERROR ) { - ScopedVclPtrInstance< MessageDialog > aBox(SfxGetpApp()->GetTopWindow(), SfxResId( STR_ERROR_SEND_MAIL ), VclMessageType::Info); - aBox->Execute(); - rReq.Ignore(); + vcl::Window* pWin = SfxGetpApp()->GetTopWindow(); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + SfxResId(STR_ERROR_SEND_MAIL))); + xBox->run(); + rReq.Ignore(); } else rReq.Done(); @@ -1116,8 +1122,10 @@ bool SfxViewShell::PrepareClose { if ( bUI ) { - ScopedVclPtrInstance< MessageDialog > aInfoBox(&GetViewFrame()->GetWindow(), SfxResId( STR_CANT_CLOSE ), VclMessageType::Info ); - aInfoBox->Execute(); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetViewFrame()->GetWindow().GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + SfxResId(STR_CANT_CLOSE))); + xBox->run(); } return false; |