summaryrefslogtreecommitdiff
path: root/sc/source/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-02-23 09:35:08 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-02-26 15:27:09 +0000
commit942f05996bc287923cdbcae12c64e57adf8ec975 (patch)
tree7005380763a9ecb93f5f27c28174633b9774abb7 /sc/source/filter
parentc410a3dcfeb68ba2247c0d879727afe4ca8ed3da (diff)
convert remaining ErrorBox to weld::MessageDialog
and convert remaining QueryBox to weld::MessageDialog Change-Id: Ifb4c316dee8eabf57c4940c44e29c65a2781aa6c
Diffstat (limited to 'sc/source/filter')
-rw-r--r--sc/source/filter/oox/workbookfragment.cxx30
1 files changed, 22 insertions, 8 deletions
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index d80b594c730e..7a57a2a04402 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -57,7 +57,7 @@
#include <vcl/svapp.hxx>
#include <vcl/timer.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <oox/core/fastparser.hxx>
#include <salhelper/thread.hxx>
@@ -532,15 +532,29 @@ void WorkbookFragment::recalcFormulaCells()
if (rDoc.IsUserInteractionEnabled())
{
// Ask the user if full re-calculation is desired.
- ScopedVclPtrInstance<QueryBox> aBox(
- ScDocShell::GetActiveDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes,
- ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS));
- aBox->SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
+ vcl::Window* pWin = ScDocShell::GetActiveDialogParent();
- sal_Int32 nRet = aBox->Execute();
- bHardRecalc = nRet == RET_YES;
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pWin ? pWin->GetFrameWeld() : nullptr,
+ "modules/scalc/ui/recalcquerydialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("RecalcQueryDialog"));
+ xQueryBox->set_primary_text(ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS));
+ xQueryBox->set_default_response(RET_YES);
+ std::unique_ptr<weld::CheckButton> xWarningOnBox(xBuilder->weld_check_button("ask"));
- if (aBox->GetCheckBoxState())
+ //fdo#75121, a bit tricky because the widgets we want to align with
+ //don't actually exist in the ui description, they're implied
+ std::unique_ptr<weld::Container> xOrigParent(xWarningOnBox->weld_parent());
+ std::unique_ptr<weld::Container> xContentArea(xQueryBox->weld_message_area());
+ xOrigParent->remove(xWarningOnBox.get());
+ xContentArea->add(xWarningOnBox.get());
+
+ bHardRecalc = xQueryBox->run() == RET_YES;
+
+ //put them back as they were
+ xContentArea->remove(xWarningOnBox.get());
+ xOrigParent->add(xWarningOnBox.get());
+
+ if (xWarningOnBox->get_active())
{
// Always perform selected action in the future.
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());