summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-04-10 10:47:35 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-04-11 09:54:42 +0200
commite4c4288a4334567c586bc40ece9b3dcf69ccc499 (patch)
tree750d7d1e541f5152af21ab2528c077a8130beef0
parentab2906c593c280c95de7f1984b4e0eea7b52b768 (diff)
weld ScMovingAverageDialog
Change-Id: I5dee3cc19118356d325bc3db9a5ef563945c82ec Reviewed-on: https://gerrit.libreoffice.org/70511 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx22
-rw-r--r--sc/source/ui/inc/MovingAverageDialog.hxx9
-rw-r--r--sc/source/ui/inc/reffact.hxx2
-rw-r--r--sc/source/ui/view/tabvwshc.cxx11
-rw-r--r--sc/uiconfig/scalc/ui/movingaveragedialog.ui146
-rw-r--r--solenv/sanitizers/ui/modules/scalc.suppr2
6 files changed, 97 insertions, 95 deletions
diff --git a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
index e1f0d6360ef2..ef05075d2560 100644
--- a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
@@ -18,28 +18,22 @@
ScMovingAverageDialog::ScMovingAverageDialog(
SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
- vcl::Window* pParent, ScViewData* pViewData ) :
- ScStatisticsInputOutputDialog(
+ weld::Window* pParent, ScViewData* pViewData )
+ : ScStatisticsInputOutputDialogController(
pSfxBindings, pChildWindow, pParent, pViewData,
- "MovingAverageDialog", "modules/scalc/ui/movingaveragedialog.ui" )
+ "modules/scalc/ui/movingaveragedialog.ui",
+ "MovingAverageDialog")
+ , mxIntervalSpin(m_xBuilder->weld_spin_button("interval-spin"))
{
- get(mpIntervalSpin, "interval-spin");
}
ScMovingAverageDialog::~ScMovingAverageDialog()
{
- disposeOnce();
}
-void ScMovingAverageDialog::dispose()
+void ScMovingAverageDialog::Close()
{
- mpIntervalSpin.clear();
- ScStatisticsInputOutputDialog::dispose();
-}
-
-bool ScMovingAverageDialog::Close()
-{
- return DoClose( ScMovingAverageDialogWrapper::GetChildWindowId() );
+ DoClose( ScMovingAverageDialogWrapper::GetChildWindowId() );
}
const char* ScMovingAverageDialog::GetUndoNameId()
@@ -59,7 +53,7 @@ ScRange ScMovingAverageDialog::ApplyOutput(ScDocShell* pDocShell)
else
pIterator.reset(new DataRangeByRowIterator(mInputRange));
- sal_Int32 aIntervalSize = mpIntervalSpin->GetValue();
+ sal_Int32 aIntervalSize = mxIntervalSpin->get_value();
const bool aCentral = true; //to-do add support to change this to the dialog
for( ; pIterator->hasNext(); pIterator->next() )
diff --git a/sc/source/ui/inc/MovingAverageDialog.hxx b/sc/source/ui/inc/MovingAverageDialog.hxx
index 02cdcca6df7a..bbcf0a2dfa05 100644
--- a/sc/source/ui/inc/MovingAverageDialog.hxx
+++ b/sc/source/ui/inc/MovingAverageDialog.hxx
@@ -16,20 +16,19 @@
#include "StatisticsInputOutputDialog.hxx"
-class ScMovingAverageDialog : public ScStatisticsInputOutputDialog
+class ScMovingAverageDialog : public ScStatisticsInputOutputDialogController
{
private:
- VclPtr<NumericField> mpIntervalSpin;
+ std::unique_ptr<weld::SpinButton> mxIntervalSpin;
public:
ScMovingAverageDialog(
SfxBindings* pB, SfxChildWindow* pCW,
- vcl::Window* pParent, ScViewData* pViewData );
+ weld::Window* pParent, ScViewData* pViewData );
virtual ~ScMovingAverageDialog() 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 eb4923dc7903..8de5fda75893 100644
--- a/sc/source/ui/inc/reffact.hxx
+++ b/sc/source/ui/inc/reffact.hxx
@@ -100,7 +100,7 @@ private:
};
class ScMovingAverageDialogWrapper :
- public ChildWindowWrapper<SID_MOVING_AVERAGE_DIALOG>
+ public ChildControllerWrapper<SID_MOVING_AVERAGE_DIALOG>
{
private:
ScMovingAverageDialogWrapper() = delete;
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 5052ab24ec55..95d10e13e33c 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_MOVING_AVERAGE_DIALOG:
- {
- pResult = VclPtr<ScMovingAverageDialog>::Create( pB, pCW, pParent, &GetViewData() );
- }
- break;
-
case SID_REGRESSION_DIALOG:
{
pResult = VclPtr<ScRegressionDialog>::Create( pB, pCW, pParent, &GetViewData() );
@@ -533,6 +527,11 @@ std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
xResult.reset(new ScExponentialSmoothingDialog(pB, pCW, pParent, &GetViewData()));
}
break;
+ case SID_MOVING_AVERAGE_DIALOG:
+ {
+ xResult.reset(new ScMovingAverageDialog(pB, pCW, pParent, &GetViewData()));
+ }
+ break;
}
if (xResult)
diff --git a/sc/uiconfig/scalc/ui/movingaveragedialog.ui b/sc/uiconfig/scalc/ui/movingaveragedialog.ui
index df17904eecc1..935cb2a98b5d 100644
--- a/sc/uiconfig/scalc/ui/movingaveragedialog.ui
+++ b/sc/uiconfig/scalc/ui/movingaveragedialog.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="interval-adjustment">
<property name="lower">2</property>
<property name="upper">10000</property>
@@ -15,12 +14,76 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="movingaveragedialog|MovingAverageDialog">Moving Average</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>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<object class="GtkFrame" id="frame-data">
<property name="visible">True</property>
@@ -45,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="movingaveragedialog|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>
@@ -56,11 +119,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>
@@ -69,7 +133,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>
@@ -83,10 +147,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="movingaveragedialog|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>
@@ -94,11 +158,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>
@@ -107,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>
@@ -138,65 +203,6 @@
<property name="position">0</property>
</packing>
</child>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="ok">
- <property name="label">gtk-ok</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="cancel">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="help">
- <property name="label">gtk-help</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- <property name="secondary">True</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
<child>
<object class="GtkFrame" id="frame-group">
<property name="visible">True</property>
@@ -294,9 +300,9 @@
<object class="GtkLabel" id="interval-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="movingaveragedialog|interval-label">Interval:</property>
<property name="use_underline">True</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -307,7 +313,8 @@
<object class="GtkSpinButton" id="interval-spin">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="text" translatable="no">2</property>
+ <property name="activates_default">True</property>
+ <property name="text">2</property>
<property name="adjustment">interval-adjustment</property>
<property name="value">2</property>
</object>
@@ -341,6 +348,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/solenv/sanitizers/ui/modules/scalc.suppr b/solenv/sanitizers/ui/modules/scalc.suppr
index 9b2dc4330814..9d3847715593 100644
--- a/solenv/sanitizers/ui/modules/scalc.suppr
+++ b/solenv/sanitizers/ui/modules/scalc.suppr
@@ -124,6 +124,8 @@ sc/uiconfig/scalc/ui/mergecolumnentry.ui:GtkGrid[@id='grid']/GtkBox/GtkGrid[@id=
sc/uiconfig/scalc/ui/mergecolumnentry.ui://GtkEntry[@id='ed_separator'] no-labelled-by
sc/uiconfig/scalc/ui/mergecolumnentry.ui:GtkGrid[@id='grid']/GtkBox/GtkGrid[@id='grid_details']/GtkLabel orphan-label
sc/uiconfig/scalc/ui/mergecolumnentry.ui://GtkEntry[@id='ed_columns'] no-labelled-by
+sc/uiconfig/scalc/ui/movingaveragedialog.ui://GtkButton[@id='input-range-button'] button-no-label
+sc/uiconfig/scalc/ui/movingaveragedialog.ui://GtkButton[@id='output-range-button'] button-no-label
sc/uiconfig/scalc/ui/texttransformationentry.ui:GtkGrid[@id='grid']/GtkBox/GtkLabel orphan-label
sc/uiconfig/scalc/ui/sorttransformationentry.ui:GtkGrid[@id='grid']/GtkBox/GtkLabel orphan-label
sc/uiconfig/scalc/ui/aggregatefunctionentry.ui:GtkGrid[@id='grid']/GtkBox/GtkLabel orphan-label