diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-04-10 10:15:20 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-04-11 09:53:25 +0200 |
commit | a5a0d6050b05362a39424ae9f44627fb3c604b8a (patch) | |
tree | 9017be1cc824b72bfc6431bbd1927bec245112ee | |
parent | 48af979d264fff14352b2c69db137332fcfdb25e (diff) |
weld ScAnalysisOfVarianceDialog
Change-Id: I94b736bbc5268f36a56a4a40ec39c6adaf67afbf
Reviewed-on: https://gerrit.libreoffice.org/70506
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx | 66 | ||||
-rw-r--r-- | sc/source/ui/inc/AnalysisOfVarianceDialog.hxx | 19 | ||||
-rw-r--r-- | sc/source/ui/inc/reffact.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshc.cxx | 11 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/analysisofvariancedialog.ui | 32 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/correlationdialog.ui | 4 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/descriptivestatisticsdialog.ui | 2 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/samplingdialog.ui | 4 | ||||
-rw-r--r-- | solenv/sanitizers/ui/modules/scalc.suppr | 2 |
9 files changed, 75 insertions, 67 deletions
diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx index b8284c6f885d..0dc391a17e2f 100644 --- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx @@ -67,10 +67,10 @@ OUString lclCreateMultiParameterFormula( return aResult.makeStringAndClear(); } -void lclMakeSubRangesList(ScRangeList& rRangeList, const ScRange& rInputRange, ScStatisticsInputOutputDialog::GroupedBy aGroupedBy) +void lclMakeSubRangesList(ScRangeList& rRangeList, const ScRange& rInputRange, ScStatisticsInputOutputDialogController::GroupedBy aGroupedBy) { std::unique_ptr<DataRangeIterator> pIterator; - if (aGroupedBy == ScStatisticsInputOutputDialog::BY_COLUMN) + if (aGroupedBy == ScStatisticsInputOutputDialogController::BY_COLUMN) pIterator.reset(new DataRangeByColumnIterator(rInputRange)); else pIterator.reset(new DataRangeByRowIterator(rInputRange)); @@ -86,43 +86,33 @@ void lclMakeSubRangesList(ScRangeList& rRangeList, const ScRange& rInputRange, S ScAnalysisOfVarianceDialog::ScAnalysisOfVarianceDialog( SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow, - vcl::Window* pParent, ScViewData* pViewData ) : - ScStatisticsInputOutputDialog( + weld::Window* pParent, ScViewData* pViewData ) + : ScStatisticsInputOutputDialogController( pSfxBindings, pChildWindow, pParent, pViewData, - "AnalysisOfVarianceDialog", "modules/scalc/ui/analysisofvariancedialog.ui" ), - meFactor(SINGLE_FACTOR) + "modules/scalc/ui/analysisofvariancedialog.ui", + "AnalysisOfVarianceDialog") + , meFactor(SINGLE_FACTOR) + , mxAlphaField(m_xBuilder->weld_spin_button("alpha-spin")) + , mxSingleFactorRadio(m_xBuilder->weld_radio_button("radio-single-factor")) + , mxTwoFactorRadio(m_xBuilder->weld_radio_button("radio-two-factor")) + , mxRowsPerSampleField(m_xBuilder->weld_spin_button("rows-per-sample-spin")) { - get(mpAlphaField, "alpha-spin"); - get(mpSingleFactorRadio, "radio-single-factor"); - get(mpTwoFactorRadio, "radio-two-factor"); - get(mpRowsPerSampleField, "rows-per-sample-spin"); + mxSingleFactorRadio->connect_toggled( LINK( this, ScAnalysisOfVarianceDialog, FactorChanged ) ); + mxTwoFactorRadio->connect_toggled( LINK( this, ScAnalysisOfVarianceDialog, FactorChanged ) ); - mpSingleFactorRadio->SetToggleHdl( LINK( this, ScAnalysisOfVarianceDialog, FactorChanged ) ); - mpTwoFactorRadio->SetToggleHdl( LINK( this, ScAnalysisOfVarianceDialog, FactorChanged ) ); - - mpSingleFactorRadio->Check(); - mpTwoFactorRadio->Check(false); + mxSingleFactorRadio->set_active(true); + mxTwoFactorRadio->set_active(false); FactorChanged(); } ScAnalysisOfVarianceDialog::~ScAnalysisOfVarianceDialog() { - disposeOnce(); -} - -void ScAnalysisOfVarianceDialog::dispose() -{ - mpAlphaField.clear(); - mpSingleFactorRadio.clear(); - mpTwoFactorRadio.clear(); - mpRowsPerSampleField.clear(); - ScStatisticsInputOutputDialog::dispose(); } -bool ScAnalysisOfVarianceDialog::Close() +void ScAnalysisOfVarianceDialog::Close() { - return DoClose( ScAnalysisOfVarianceDialogWrapper::GetChildWindowId() ); + DoClose( ScAnalysisOfVarianceDialogWrapper::GetChildWindowId() ); } const char* ScAnalysisOfVarianceDialog::GetUndoNameId() @@ -130,25 +120,25 @@ const char* ScAnalysisOfVarianceDialog::GetUndoNameId() return STR_ANALYSIS_OF_VARIANCE_UNDO_NAME; } -IMPL_LINK_NOARG( ScAnalysisOfVarianceDialog, FactorChanged, RadioButton&, void ) +IMPL_LINK_NOARG( ScAnalysisOfVarianceDialog, FactorChanged, weld::ToggleButton&, void ) { FactorChanged(); } void ScAnalysisOfVarianceDialog::FactorChanged() { - if (mpSingleFactorRadio->IsChecked()) + if (mxSingleFactorRadio->get_active()) { - mpGroupByRowsRadio->Enable(); - mpGroupByColumnsRadio->Enable(); - mpRowsPerSampleField->Enable(false); + mxGroupByRowsRadio->set_sensitive(true); + mxGroupByColumnsRadio->set_sensitive(true); + mxRowsPerSampleField->set_sensitive(false); meFactor = SINGLE_FACTOR; } - else if (mpTwoFactorRadio->IsChecked()) + else if (mxTwoFactorRadio->get_active()) { - mpGroupByRowsRadio->Enable(false); - mpGroupByColumnsRadio->Enable(false); - mpRowsPerSampleField->Enable(false); // Rows per sample not yet implemented + mxGroupByRowsRadio->set_sensitive(false); + mxGroupByColumnsRadio->set_sensitive(false); + mxRowsPerSampleField->set_sensitive(false); // Rows per sample not yet implemented meFactor = TWO_FACTOR; } } @@ -193,7 +183,7 @@ void ScAnalysisOfVarianceDialog::AnovaSingleFactor(AddressWalkerWriter& output, output.writeBoldString(ScResId(STR_ANOVA_SINGLE_FACTOR_LABEL)); output.newLine(); - double aAlphaValue = mpAlphaField->GetValue() / 100.0; + double aAlphaValue = mxAlphaField->get_value() / 100.0; output.writeString(ScResId(STR_LABEL_ALPHA)); output.nextColumn(); output.writeValue(aAlphaValue); @@ -340,7 +330,7 @@ void ScAnalysisOfVarianceDialog::AnovaTwoFactor(AddressWalkerWriter& output, For output.writeBoldString(ScResId(STR_ANOVA_TWO_FACTOR_LABEL)); output.newLine(); - double aAlphaValue = mpAlphaField->GetValue() / 100.0; + double aAlphaValue = mxAlphaField->get_value() / 100.0; output.writeString("Alpha"); output.nextColumn(); output.writeValue(aAlphaValue); diff --git a/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx b/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx index 0af68255b4b5..317f7d2e11fc 100644 --- a/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx +++ b/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx @@ -19,7 +19,7 @@ class FormulaTemplate; class AddressWalkerWriter; -class ScAnalysisOfVarianceDialog : public ScStatisticsInputOutputDialog +class ScAnalysisOfVarianceDialog : public ScStatisticsInputOutputDialogController { private: enum AnovaFactor @@ -28,16 +28,16 @@ private: TWO_FACTOR }; - VclPtr<NumericField> mpAlphaField; - VclPtr<RadioButton> mpSingleFactorRadio; - VclPtr<RadioButton> mpTwoFactorRadio; - VclPtr<NumericField> mpRowsPerSampleField; - - DECL_LINK(FactorChanged, RadioButton&, void); + DECL_LINK(FactorChanged, weld::ToggleButton&, void); void FactorChanged(); AnovaFactor meFactor; + std::unique_ptr<weld::SpinButton> mxAlphaField; + std::unique_ptr<weld::RadioButton> mxSingleFactorRadio; + std::unique_ptr<weld::RadioButton> mxTwoFactorRadio; + std::unique_ptr<weld::SpinButton> mxRowsPerSampleField; + static void RowColumn(ScRangeList& rRangeList, AddressWalkerWriter& aOutput, FormulaTemplate& aTemplate, const OUString& sFormula, GroupedBy aGroupedBy, ScRange* pResultRange); @@ -48,12 +48,11 @@ private: public: ScAnalysisOfVarianceDialog( SfxBindings* pB, SfxChildWindow* pCW, - vcl::Window* pParent, ScViewData* pViewData ); + weld::Window* pParent, ScViewData* pViewData ); virtual ~ScAnalysisOfVarianceDialog() override; - virtual void dispose() override; - virtual bool Close() override; + virtual void Close() override; protected: virtual const char* GetUndoNameId() override; diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx index c8ce5507bc08..b1dda37d1249 100644 --- a/sc/source/ui/inc/reffact.hxx +++ b/sc/source/ui/inc/reffact.hxx @@ -72,7 +72,7 @@ private: }; class ScAnalysisOfVarianceDialogWrapper : - public ChildWindowWrapper<SID_ANALYSIS_OF_VARIANCE_DIALOG> + public ChildControllerWrapper<SID_ANALYSIS_OF_VARIANCE_DIALOG> { private: ScAnalysisOfVarianceDialogWrapper() = delete; diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 545a9dc4974f..379bf2ad3f1f 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -330,12 +330,6 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog( } break; - case SID_ANALYSIS_OF_VARIANCE_DIALOG: - { - pResult = VclPtr<ScAnalysisOfVarianceDialog>::Create( pB, pCW, pParent, &GetViewData() ); - } - break; - case SID_COVARIANCE_DIALOG: { pResult = VclPtr<ScCovarianceDialog>::Create( pB, pCW, pParent, &GetViewData() ); @@ -536,6 +530,11 @@ std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont xResult.reset(new ScDescriptiveStatisticsDialog(pB, pCW, pParent, &GetViewData())); } break; + case SID_ANALYSIS_OF_VARIANCE_DIALOG: + { + xResult.reset(new ScAnalysisOfVarianceDialog(pB, pCW, pParent, &GetViewData())); + } + break; } if (xResult) diff --git a/sc/uiconfig/scalc/ui/analysisofvariancedialog.ui b/sc/uiconfig/scalc/ui/analysisofvariancedialog.ui index ccbc5048825e..7093ac128266 100644 --- a/sc/uiconfig/scalc/ui/analysisofvariancedialog.ui +++ b/sc/uiconfig/scalc/ui/analysisofvariancedialog.ui @@ -1,8 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> +<!-- Generated with glade 3.22.1 --> <interface domain="sc"> <requires lib="gtk+" version="3.18"/> - <requires lib="LibreOffice" version="1.0"/> <object class="GtkAdjustment" id="alpha-adjustment"> <property name="lower">0.01</property> <property name="upper">0.98999999999999999</property> @@ -15,7 +14,12 @@ <property name="border_width">6</property> <property name="title" translatable="yes" context="analysisofvariancedialog|AnalysisOfVarianceDialog">Analysis of Variance (ANOVA)</property> <property name="resizable">False</property> + <property name="default_width">0</property> + <property name="default_height">0</property> <property name="type_hint">dialog</property> + <child> + <placeholder/> + </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> @@ -104,10 +108,10 @@ <object class="GtkLabel" id="input-range-label"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="analysisofvariancedialog|input-range-label">Input range:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">input-range-edit</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> @@ -118,10 +122,10 @@ <object class="GtkLabel" id="output-range-label"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="analysisofvariancedialog|output-range-label">Results to:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">output-range-edit</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> @@ -129,11 +133,12 @@ </packing> </child> <child> - <object class="foruilo-RefEdit" id="input-range-edit"> + <object class="GtkEntry" id="input-range-edit"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> <property name="width_chars">30</property> </object> <packing> @@ -142,11 +147,12 @@ </packing> </child> <child> - <object class="foruilo-RefEdit" id="output-range-edit"> + <object class="GtkEntry" id="output-range-edit"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> <property name="width_chars">30</property> </object> <packing> @@ -155,7 +161,7 @@ </packing> </child> <child> - <object class="foruilo-RefButton" id="input-range-button"> + <object class="GtkButton" id="input-range-button"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -166,7 +172,7 @@ </packing> </child> <child> - <object class="foruilo-RefButton" id="output-range-button"> + <object class="GtkButton" id="output-range-button"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -225,8 +231,8 @@ <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> + <property name="active">True</property> <property name="draw_indicator">True</property> - <property name="group">radio-two-factor</property> </object> <packing> <property name="left_attach">0</property> @@ -300,7 +306,6 @@ <property name="xalign">0</property> <property name="active">True</property> <property name="draw_indicator">True</property> - <property name="group">groupedby-rows-radio</property> </object> <packing> <property name="left_attach">0</property> @@ -369,10 +374,10 @@ <object class="GtkLabel" id="alpha-label"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="analysisofvariancedialog|alpha-label">Alpha:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">alpha-spin</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> @@ -383,6 +388,7 @@ <object class="GtkSpinButton" id="alpha-spin"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="activates_default">True</property> <property name="text" translatable="yes" context="analysisofvariancedialog|alpha-spin">0,05</property> <property name="adjustment">alpha-adjustment</property> <property name="digits">2</property> @@ -397,10 +403,10 @@ <object class="GtkLabel" id="rows-per-sample-label"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="analysisofvariancedialog|rows-per-sample-label">Rows per sample:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">rows-per-sample-spin</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> @@ -411,6 +417,7 @@ <object class="GtkSpinButton" id="rows-per-sample-spin"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="activates_default">True</property> <property name="text">1</property> <property name="value">1</property> </object> @@ -444,6 +451,7 @@ </child> <action-widgets> <action-widget response="-5">ok</action-widget> + <action-widget response="-6">cancel</action-widget> <action-widget response="-11">help</action-widget> </action-widgets> </object> diff --git a/sc/uiconfig/scalc/ui/correlationdialog.ui b/sc/uiconfig/scalc/ui/correlationdialog.ui index 7fff92fa924d..f29dc92bb1d8 100644 --- a/sc/uiconfig/scalc/ui/correlationdialog.ui +++ b/sc/uiconfig/scalc/ui/correlationdialog.ui @@ -7,6 +7,8 @@ <property name="border_width">6</property> <property name="title" translatable="yes" context="correlationdialog|CorrelationDialog">Correlation</property> <property name="resizable">False</property> + <property name="default_width">0</property> + <property name="default_height">0</property> <property name="type_hint">dialog</property> <child> <placeholder/> @@ -128,6 +130,7 @@ <property name="can_focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> <property name="width_chars">30</property> </object> <packing> @@ -141,6 +144,7 @@ <property name="can_focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> <property name="width_chars">30</property> </object> <packing> diff --git a/sc/uiconfig/scalc/ui/descriptivestatisticsdialog.ui b/sc/uiconfig/scalc/ui/descriptivestatisticsdialog.ui index 4086f5a7cdb7..8ba1adeb34ab 100644 --- a/sc/uiconfig/scalc/ui/descriptivestatisticsdialog.ui +++ b/sc/uiconfig/scalc/ui/descriptivestatisticsdialog.ui @@ -117,6 +117,7 @@ <property name="can_focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> <property name="width_chars">30</property> </object> <packing> @@ -155,6 +156,7 @@ <property name="can_focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> <property name="width_chars">30</property> </object> <packing> diff --git a/sc/uiconfig/scalc/ui/samplingdialog.ui b/sc/uiconfig/scalc/ui/samplingdialog.ui index 8920406a9c47..3c0202286a82 100644 --- a/sc/uiconfig/scalc/ui/samplingdialog.ui +++ b/sc/uiconfig/scalc/ui/samplingdialog.ui @@ -129,6 +129,7 @@ <property name="can_focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> <property name="width_chars">30</property> </object> <packing> @@ -167,6 +168,7 @@ <property name="can_focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> <property name="width_chars">30</property> </object> <packing> @@ -231,6 +233,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> <property name="text">1</property> <property name="adjustment">sample-size-adjustment</property> <property name="update_policy">if-valid</property> @@ -298,6 +301,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> <property name="text">1</property> <property name="adjustment">period-adjustment</property> <property name="update_policy">if-valid</property> diff --git a/solenv/sanitizers/ui/modules/scalc.suppr b/solenv/sanitizers/ui/modules/scalc.suppr index 2d7380fa2b67..cdd2c5f3f2bb 100644 --- a/solenv/sanitizers/ui/modules/scalc.suppr +++ b/solenv/sanitizers/ui/modules/scalc.suppr @@ -1,6 +1,8 @@ sc/uiconfig/scalc/ui/advancedfilterdialog.ui://foruilo-RefEdit[@id='edfilterarea'] no-labelled-by sc/uiconfig/scalc/ui/advancedfilterdialog.ui://GtkLabel[@id='dbarealabel'] orphan-label sc/uiconfig/scalc/ui/advancedfilterdialog.ui://GtkLabel[@id='dbarea'] orphan-label +sc/uiconfig/scalc/ui/analysisofvariancedialog.ui://GtkButton[@id='input-range-button'] button-no-label +sc/uiconfig/scalc/ui/analysisofvariancedialog.ui://GtkButton[@id='output-range-button'] button-no-label sc/uiconfig/scalc/ui/cellprotectionpage.ui://GtkLabel[@id='label1'] orphan-label sc/uiconfig/scalc/ui/cellprotectionpage.ui://GtkLabel[@id='label4'] orphan-label sc/uiconfig/scalc/ui/conditionalentry.ui://GtkLabel[@id='number'] orphan-label |