[Libreoffice-commits] core.git: sc/source sc/uiconfig
Dennis Francis (via logerrit)
logerrit at kemper.freedesktop.org
Mon May 20 13:28:15 UTC 2019
sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx | 4 +++
sc/source/ui/inc/MovingAverageDialog.hxx | 1
sc/uiconfig/scalc/ui/movingaveragedialog.ui | 18 +++++++++++++++++
3 files changed, 23 insertions(+)
New commits:
commit 2fd8f56ed1bf9b547093c4ac6c3231fff001b748
Author: Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Sun May 5 19:40:56 2019 +0530
Commit: Eike Rathke <erack at redhat.com>
CommitDate: Mon May 20 15:27:27 2019 +0200
tdf#99938 : Moving Average : By default trim input range...
to actual data content inside the input range via a new
checkbox in the dialog.
Change-Id: I4ac5ec5809e772f75f303c3dcfcc6e6ef8693eb1
Reviewed-on: https://gerrit.libreoffice.org/71824
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack at redhat.com>
diff --git a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
index ad7a1d9d53b6..4f4d5960e199 100644
--- a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
@@ -23,6 +23,7 @@ ScMovingAverageDialog::ScMovingAverageDialog(
pSfxBindings, pChildWindow, pParent, pViewData,
"modules/scalc/ui/movingaveragedialog.ui",
"MovingAverageDialog")
+ , mxTrimRangeCheck(m_xBuilder->weld_check_button("trimrange-check"))
, mxIntervalSpin(m_xBuilder->weld_spin_button("interval-spin"))
{
}
@@ -47,6 +48,9 @@ ScRange ScMovingAverageDialog::ApplyOutput(ScDocShell* pDocShell)
formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv));
FormulaTemplate aTemplate(mDocument);
+ if (mxTrimRangeCheck->get_active())
+ mDocument->GetDataAreaSubrange(mInputRange);
+
std::unique_ptr<DataRangeIterator> pIterator;
if (mGroupedBy == BY_COLUMN)
pIterator.reset(new DataRangeByColumnIterator(mInputRange));
diff --git a/sc/source/ui/inc/MovingAverageDialog.hxx b/sc/source/ui/inc/MovingAverageDialog.hxx
index 8601a6c69e37..5b373e563edd 100644
--- a/sc/source/ui/inc/MovingAverageDialog.hxx
+++ b/sc/source/ui/inc/MovingAverageDialog.hxx
@@ -19,6 +19,7 @@
class ScMovingAverageDialog : public ScStatisticsInputOutputDialog
{
private:
+ std::unique_ptr<weld::CheckButton> mxTrimRangeCheck;
std::unique_ptr<weld::SpinButton> mxIntervalSpin;
public:
diff --git a/sc/uiconfig/scalc/ui/movingaveragedialog.ui b/sc/uiconfig/scalc/ui/movingaveragedialog.ui
index 935cb2a98b5d..625ca23eb2f4 100644
--- a/sc/uiconfig/scalc/ui/movingaveragedialog.ui
+++ b/sc/uiconfig/scalc/ui/movingaveragedialog.ui
@@ -182,6 +182,24 @@
<property name="top_attach">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="trimrange-check">
+ <property name="label" translatable="yes" context="movingaveragedialog|trimrange-check">Trim input range to actual data content</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</object>
</child>
</object>
More information about the Libreoffice-commits
mailing list