summaryrefslogtreecommitdiff
path: root/sc/source/ui/inc/SamplingDialog.hxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-12-22 22:06:02 +0100
committerEike Rathke <erack@redhat.com>2018-12-22 23:28:11 +0100
commit2c5c20b19c349a4b7f6d78d69d8d57f9af5c351c (patch)
tree3547c192bffd1cdf638d203df50db55fc5dbd99f /sc/source/ui/inc/SamplingDialog.hxx
parent28a1ae3285aad77e238c698bd8d496006c881f6d (diff)
Rework Data -> Statistics dialog, add WithReplacement and KeepOrder
* Add "With replacement" checkbutton * checked: WR (with replacement, put back after draw), larger sample size than population size possible * mutually exclusive with "Keep order" * unchecked: WOR (without replacement, do not put back after draw), sample size limited to population size * automatically unchecked for "Periodic" samples * Add "Keep order" checkbutton * checked: samples are drawn in order of population data * WOR method mutually exclusive with "With replacement" * automatically checked for "Periodic" samples * unchecked: samples are drawn in random order * Limit "Sample size" and "Period" input fields to size of population for all WOR methods * when limiting, increment "Sample size" and "Period" up to their last known value when enlargening the population size Previously, for "Periodic" samples the "Period" field was never limited, which for populations of smaller size makes no sense. The new recent implementation for "Random" without "Keep order" and without "With replacement" set (WOR) strictly needs "Sample size" limited to population size. Change-Id: I3c0bef402afb775bca7ae877e6424f4a4eaae359 Reviewed-on: https://gerrit.libreoffice.org/65574 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'sc/source/ui/inc/SamplingDialog.hxx')
-rw-r--r--sc/source/ui/inc/SamplingDialog.hxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sc/source/ui/inc/SamplingDialog.hxx b/sc/source/ui/inc/SamplingDialog.hxx
index 4994f73cb8a4..cf517a2bfa39 100644
--- a/sc/source/ui/inc/SamplingDialog.hxx
+++ b/sc/source/ui/inc/SamplingDialog.hxx
@@ -45,6 +45,8 @@ private:
VclPtr<NumericField> mpPeriod;
VclPtr<RadioButton> mpRandomMethodRadio;
+ VclPtr<CheckBox> mpWithReplacement;
+ VclPtr<CheckBox> mpKeepOrder;
VclPtr<RadioButton> mpPeriodicMethodRadio;
VclPtr<OKButton> mpButtonOk;
@@ -61,11 +63,16 @@ private:
ScAddress const mCurrentAddress;
+ sal_Int64 mnLastSampleSizeValue;
+ sal_Int64 mnLastPeriodValue;
+
bool mDialogLostFocus;
void Init();
void GetRangeFromSelection();
void PerformSampling();
+ sal_Int64 GetPopulationSize() const;
+ void LimitSampleSizeAndPeriod();
ScRange PerformRandomSampling(ScDocShell* pDocShell);
ScRange PerformRandomSamplingKeepOrder(ScDocShell* pDocShell);
@@ -75,8 +82,10 @@ private:
DECL_LINK( GetFocusHandler, Control&, void );
DECL_LINK( LoseFocusHandler, Control&, void );
DECL_LINK( SamplingSizeValueModified, Edit&, void );
+ DECL_LINK( PeriodValueModified, Edit&, void );
DECL_LINK( ToggleSamplingMethod, RadioButton&, void );
DECL_LINK( RefInputModifyHandler, Edit&, void );
+ DECL_LINK( CheckHdl, Button*, void );
void ToggleSamplingMethod();
};