summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/docsh.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-02-26 13:28:48 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-02-27 09:52:32 +0000
commit0fad8d308122a862aa49dece498d56a418df2afe (patch)
treee67e7df1f9d315648535f436b424c9941dea589e /sc/source/ui/docshell/docsh.cxx
parentf3a4129ed5946e2b8661dc8df23e00c4b6c6ecc8 (diff)
convert remaining WarningBox to weld::MessageDialog
Change-Id: I7e3c156a6ad47ac232636ae274280c1cb7556d4a
Diffstat (limited to 'sc/source/ui/docshell/docsh.cxx')
-rw-r--r--sc/source/ui/docshell/docsh.cxx28
1 files changed, 18 insertions, 10 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index c8bbd5c93dd3..33a59ab41e5a 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -25,7 +25,6 @@
#include <comphelper/fileformat.h>
#include <comphelper/classids.hxx>
#include <formula/errorcodes.hxx>
-#include <vcl/msgbox.hxx>
#include <vcl/weld.hxx>
#include <vcl/virdev.hxx>
#include <vcl/waitobj.hxx>
@@ -867,8 +866,14 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_SAVE_LATER ) );
aMessage = aMessage.replaceFirst( "%1", aUserName );
- ScopedVclPtrInstance< WarningBox > aBox( GetActiveDialogParent(), MessBoxStyle::RetryCancel | MessBoxStyle::DefaultRetry, aMessage );
- if ( aBox->Execute() == RET_RETRY )
+ vcl::Window* pWin = GetActiveDialogParent();
+ std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+ VclMessageType::Warning, VclButtonsType::NONE,
+ aMessage));
+ xWarn->add_button(Button::GetStandardText(StandardButtonType::Retry), RET_RETRY);
+ xWarn->add_button(Button::GetStandardText(StandardButtonType::Cancel), RET_CANCEL);
+ xWarn->set_default_response(RET_RETRY);
+ if (xWarn->run() == RET_RETRY)
{
bRetry = true;
}
@@ -942,9 +947,11 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
else
{
- ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), MessBoxStyle::Ok,
- ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) );
- aBox->Execute();
+ vcl::Window* pWin = GetActiveDialogParent();
+ std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+ VclMessageType::Warning, VclButtonsType::Ok,
+ ScGlobal::GetRscString(STR_DOC_NOLONGERSHARED)));
+ xWarn->run();
SfxBindings* pBindings = GetViewBindings();
if ( pBindings )
@@ -983,10 +990,11 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( GetDocument().GetExternalRefManager()->containsUnsavedReferences() )
{
- ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), MessBoxStyle::YesNo,
- ScGlobal::GetRscString( STR_UNSAVED_EXT_REF ) );
-
- if( RET_NO == aBox->Execute())
+ vcl::Window* pWin = GetActiveDialogParent();
+ std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+ VclMessageType::Warning, VclButtonsType::YesNo,
+ ScGlobal::GetRscString(STR_UNSAVED_EXT_REF)));
+ if (RET_NO == xWarn->run())
{
SetError(ERRCODE_IO_ABORT); // this error code will produce no error message, but will break the further saving process
}