sc/source/ui/StatisticsDialogs/SamplingDialog.cxx | 15 +++++++--- sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx | 15 +++++++--- sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx | 15 +++++++--- sc/source/ui/inc/SamplingDialog.hxx | 3 +- sc/source/ui/inc/StatisticsInputOutputDialog.hxx | 3 +- sc/source/ui/inc/StatisticsTwoVariableDialog.hxx | 3 +- sc/source/ui/view/tabvwshc.cxx | 2 - 7 files changed, 40 insertions(+), 16 deletions(-)
New commits: commit bdcdd00e86eb9408e65e287d566f027fdafc62cd Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Dec 15 11:02:35 2020 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Tue Dec 15 14:36:20 2020 +0100 online: Don't lock new views if ref dialog is opened When one of ref dialogs was opened in one view and then new user opened new view - the new one was locked. Don't do that for all dialogs, not only function wizard. Was partially fixed for one dialog in: 48a216cd16b306f4d2d7edc374ceb4670d177db8 Change-Id: I3b37aa182fd2096a5c989dfbdeb6c245985706d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107743 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 8c7df132e203..34014934b147 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -120,7 +120,7 @@ std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont if ( nCurRefDlgId != nSlotId ) { - if (!(comphelper::LibreOfficeKit::isActive() && nSlotId == SID_OPENDLG_FUNCTION)) + if (!comphelper::LibreOfficeKit::isActive()) { // the dialog has been opened in a different view // -> lock the dispatcher for this view (modal mode) commit 0762fc1bc8d204b4abd1510190223ec5517a3990 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Dec 15 13:56:35 2020 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Tue Dec 15 14:36:14 2020 +0100 online: make buttons work in statistics dialogs Change-Id: Ie4810b87ea5ce4fc7b3e98afdd37bcd903e2907c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107755 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx index 7284cf8261eb..2aa0887bdb9e 100644 --- a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx @@ -46,6 +46,7 @@ ScSamplingDialog::ScSamplingDialog(SfxBindings* pSfxBindings, SfxChildWindow* pC , mxKeepOrder(m_xBuilder->weld_check_button("keep-order")) , mxPeriodicMethodRadio(m_xBuilder->weld_radio_button("periodic-method-radio")) , mxButtonOk(m_xBuilder->weld_button("ok")) + , mxButtonCancel(m_xBuilder->weld_button("cancel")) { mxInputRangeEdit->SetReferences(this, mxInputRangeLabel.get()); mxInputRangeButton->SetReferences(this, mxInputRangeEdit.get()); @@ -63,7 +64,8 @@ ScSamplingDialog::~ScSamplingDialog() void ScSamplingDialog::Init() { - mxButtonOk->connect_clicked( LINK( this, ScSamplingDialog, OkClicked ) ); + mxButtonCancel->connect_clicked( LINK( this, ScSamplingDialog, ButtonClicked ) ); + mxButtonOk->connect_clicked( LINK( this, ScSamplingDialog, ButtonClicked ) ); mxButtonOk->set_sensitive(false); Link<formula::RefEdit&,void> aEditLink = LINK( this, ScSamplingDialog, GetEditFocusHandler ); @@ -417,10 +419,15 @@ IMPL_LINK(ScSamplingDialog, GetButtonFocusHandler, formula::RefButton&, rCtrl, v } -IMPL_LINK_NOARG(ScSamplingDialog, OkClicked, weld::Button&, void) +IMPL_LINK(ScSamplingDialog, ButtonClicked, weld::Button&, rButton, void) { - PerformSampling(); - response(RET_OK); + if (&rButton == mxButtonOk.get()) + { + PerformSampling(); + response(RET_OK); + } + else + response(RET_CANCEL); } IMPL_LINK_NOARG(ScSamplingDialog, LoseEditFocusHandler, formula::RefEdit&, void) diff --git a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx index 36558845a8ae..3747e11c3155 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx @@ -65,6 +65,7 @@ ScStatisticsInputOutputDialog::ScStatisticsInputOutputDialog( , mOutputAddress(ScAddress::INITIALIZE_INVALID) , mGroupedBy(BY_COLUMN) , mxButtonOk(m_xBuilder->weld_button("ok")) + , mxButtonCancel(m_xBuilder->weld_button("cancel")) , mpActiveEdit(nullptr) , mCurrentAddress(pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo()) , mDialogLostFocus(false) @@ -85,7 +86,8 @@ ScStatisticsInputOutputDialog::~ScStatisticsInputOutputDialog() void ScStatisticsInputOutputDialog::Init() { - mxButtonOk->connect_clicked( LINK( this, ScStatisticsInputOutputDialog, OkClicked ) ); + mxButtonCancel->connect_clicked( LINK( this, ScStatisticsInputOutputDialog, ButtonClicked ) ); + mxButtonOk->connect_clicked( LINK( this, ScStatisticsInputOutputDialog, ButtonClicked ) ); mxButtonOk->set_sensitive(false); Link<formula::RefEdit&,void> aEditLink = LINK( this, ScStatisticsInputOutputDialog, GetEditFocusHandler ); @@ -167,10 +169,15 @@ void ScStatisticsInputOutputDialog::SetReference( const ScRange& rReferenceRange ValidateDialogInput(); } -IMPL_LINK_NOARG( ScStatisticsInputOutputDialog, OkClicked, weld::Button&, void ) +IMPL_LINK( ScStatisticsInputOutputDialog, ButtonClicked, weld::Button&, rButton, void ) { - CalculateInputAndWriteToOutput(); - response(RET_OK); + if (&rButton == mxButtonOk.get()) + { + CalculateInputAndWriteToOutput(); + response(RET_OK); + } + else + response(RET_CANCEL); } IMPL_LINK(ScStatisticsInputOutputDialog, GetEditFocusHandler, formula::RefEdit&, rCtrl, void) diff --git a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx index dbc78a0dc6e1..a126d44d8fff 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx @@ -39,6 +39,7 @@ ScStatisticsTwoVariableDialog::ScStatisticsTwoVariableDialog( , mOutputAddress(ScAddress::INITIALIZE_INVALID) , mGroupedBy(BY_COLUMN) , mxButtonOk(m_xBuilder->weld_button("ok")) + , mxButtonCancel(m_xBuilder->weld_button("cancel")) , mxGroupByColumnsRadio(m_xBuilder->weld_radio_button("groupedby-columns-radio")) , mxGroupByRowsRadio(m_xBuilder->weld_radio_button("groupedby-rows-radio")) , mpActiveEdit(nullptr) @@ -64,7 +65,8 @@ ScStatisticsTwoVariableDialog::~ScStatisticsTwoVariableDialog() void ScStatisticsTwoVariableDialog::Init() { - mxButtonOk->connect_clicked( LINK( this, ScStatisticsTwoVariableDialog, OkClicked ) ); + mxButtonCancel->connect_clicked( LINK( this, ScStatisticsTwoVariableDialog, ButtonClicked ) ); + mxButtonOk->connect_clicked( LINK( this, ScStatisticsTwoVariableDialog, ButtonClicked ) ); mxButtonOk->set_sensitive(false); Link<formula::RefEdit&,void> aEditLink = LINK( this, ScStatisticsTwoVariableDialog, GetEditFocusHandler ); @@ -179,10 +181,15 @@ void ScStatisticsTwoVariableDialog::SetReference( const ScRange& rReferenceRange ValidateDialogInput(); } -IMPL_LINK_NOARG( ScStatisticsTwoVariableDialog, OkClicked, weld::Button&, void ) +IMPL_LINK( ScStatisticsTwoVariableDialog, ButtonClicked, weld::Button&, rButton, void ) { - CalculateInputAndWriteToOutput(); - response(RET_OK); + if (&rButton == mxButtonOk.get()) + { + CalculateInputAndWriteToOutput(); + response(RET_OK); + } + else + response(RET_CANCEL); } IMPL_LINK(ScStatisticsTwoVariableDialog, GetEditFocusHandler, formula::RefEdit&, rCtrl, void) diff --git a/sc/source/ui/inc/SamplingDialog.hxx b/sc/source/ui/inc/SamplingDialog.hxx index 6fa6cdcb1903..1e78859a0720 100644 --- a/sc/source/ui/inc/SamplingDialog.hxx +++ b/sc/source/ui/inc/SamplingDialog.hxx @@ -64,6 +64,7 @@ private: std::unique_ptr<weld::RadioButton> mxPeriodicMethodRadio; std::unique_ptr<weld::Button> mxButtonOk; + std::unique_ptr<weld::Button> mxButtonCancel; void Init(); void GetRangeFromSelection(); @@ -75,7 +76,7 @@ private: ScRange PerformRandomSamplingKeepOrder(ScDocShell* pDocShell); ScRange PerformPeriodicSampling(ScDocShell* pDocShell); - DECL_LINK( OkClicked, weld::Button&, void ); + DECL_LINK( ButtonClicked, weld::Button&, void ); DECL_LINK( GetEditFocusHandler, formula::RefEdit&, void ); DECL_LINK( GetButtonFocusHandler, formula::RefButton&, void ); DECL_LINK( LoseEditFocusHandler, formula::RefEdit&, void ); diff --git a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx index 8bdc1fa9e019..ee922567d6b1 100644 --- a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx +++ b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx @@ -69,6 +69,7 @@ protected: private: // Widgets std::unique_ptr<weld::Button> mxButtonOk; + std::unique_ptr<weld::Button> mxButtonCancel; formula::RefEdit* mpActiveEdit; ScAddress const mCurrentAddress; @@ -78,7 +79,7 @@ private: void GetRangeFromSelection(); DECL_LINK( GroupByChanged, weld::ToggleButton&, void ); - DECL_LINK( OkClicked, weld::Button&, void ); + DECL_LINK( ButtonClicked, weld::Button&, void ); DECL_LINK( GetEditFocusHandler, formula::RefEdit&, void ); DECL_LINK( GetButtonFocusHandler, formula::RefButton&, void ); DECL_LINK( LoseEditFocusHandler, formula::RefEdit&, void ); diff --git a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx index 25871ec1ea4f..f62badd045fb 100644 --- a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx +++ b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx @@ -68,6 +68,7 @@ protected: private: // Widgets std::unique_ptr<weld::Button> mxButtonOk; + std::unique_ptr<weld::Button> mxButtonCancel; std::unique_ptr<weld::RadioButton> mxGroupByColumnsRadio; std::unique_ptr<weld::RadioButton> mxGroupByRowsRadio; @@ -80,7 +81,7 @@ private: void GetRangeFromSelection(); DECL_LINK( GroupByChanged, weld::ToggleButton&, void ); - DECL_LINK( OkClicked, weld::Button&, void ); + DECL_LINK( ButtonClicked, weld::Button&, void ); DECL_LINK( GetEditFocusHandler, formula::RefEdit&, void ); DECL_LINK( GetButtonFocusHandler, formula::RefButton&, void ); DECL_LINK( LoseEditFocusHandler, formula::RefEdit&, void ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits