summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/cellsh3.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/cellsh3.cxx')
-rw-r--r--sc/source/ui/view/cellsh3.cxx19
1 files changed, 13 insertions, 6 deletions
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index ce2c030ac55c..3322d1701c56 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -25,7 +25,6 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/request.hxx>
#include <svl/stritem.hxx>
-#include <vcl/msgbox.hxx>
#include <vcl/weld.hxx>
#include <sfx2/app.hxx>
#include <globstr.hrc>
@@ -418,11 +417,19 @@ void ScCellShell::Execute( SfxRequest& rReq )
rMark.MarkToMulti();
if ( rMark.IsMultiMarked() )
{
- if ( rReq.IsAPI()
- || RET_YES ==
- ScopedVclPtrInstance<QueryBox>( pTabViewShell->GetDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes,
- ScGlobal::GetRscString(STR_UPDATE_SCENARIO) )->
- Execute() )
+
+ bool bExtend = rReq.IsAPI();
+ if (!bExtend)
+ {
+ vcl::Window* pWin = pTabViewShell->GetDialogParent();
+ std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+ VclMessageType::Question, VclButtonsType::YesNo,
+ ScGlobal::GetRscString(STR_UPDATE_SCENARIO)));
+ xQueryBox->set_default_response(RET_YES);
+ bExtend = xQueryBox->run() == RET_YES;
+ }
+
+ if (bExtend)
{
pTabViewShell->ExtendScenario();
rReq.Done();