summaryrefslogtreecommitdiff
path: root/sc/source/ui/StatisticsDialogs
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-04-10 09:05:57 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-04-11 09:52:11 +0200
commitab181504329e33a31ad23c887d817519374c9797 (patch)
tree58cbcb3b4ddefe775fd34921fc975332bd5988cd /sc/source/ui/StatisticsDialogs
parente0fde23412496d548c74603223f7a21b638ece79 (diff)
weld ScSamplingDialog
Change-Id: Ifbae09b2d2b6ebf0c56332ef4f87f3045f97f1ad Reviewed-on: https://gerrit.libreoffice.org/70503 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui/StatisticsDialogs')
-rw-r--r--sc/source/ui/StatisticsDialogs/SamplingDialog.cxx305
1 files changed, 148 insertions, 157 deletions
diff --git a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
index 277485f6b492..59fbb194df9f 100644
--- a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
@@ -19,43 +19,39 @@
#include <scresid.hxx>
#include <strings.hrc>
-ScSamplingDialog::ScSamplingDialog(
- SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
- vcl::Window* pParent, ScViewData* pViewData ) :
- ScAnyRefDlg ( pSfxBindings, pChildWindow, pParent,
- "SamplingDialog", "modules/scalc/ui/samplingdialog.ui" ),
- mpActiveEdit ( nullptr ),
- mViewData ( pViewData ),
- mDocument ( pViewData->GetDocument() ),
- mInputRange ( ScAddress::INITIALIZE_INVALID ),
- mAddressDetails ( mDocument->GetAddressConvention(), 0, 0 ),
- mOutputAddress ( ScAddress::INITIALIZE_INVALID ),
- mCurrentAddress ( pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo() ),
- mnLastSampleSizeValue(1),
- mnLastPeriodValue(1),
- mDialogLostFocus( false )
+ScSamplingDialog::ScSamplingDialog(SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
+ weld::Window* pParent, ScViewData* pViewData)
+ : ScAnyRefDlgController(pSfxBindings, pChildWindow, pParent,
+ "modules/scalc/ui/samplingdialog.ui", "SamplingDialog")
+ , mpActiveEdit(nullptr)
+ , mViewData(pViewData)
+ , mDocument(pViewData->GetDocument())
+ , mInputRange(ScAddress::INITIALIZE_INVALID)
+ , mAddressDetails(mDocument->GetAddressConvention(), 0, 0)
+ , mOutputAddress(ScAddress::INITIALIZE_INVALID)
+ , mCurrentAddress(pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo())
+ , mnLastSampleSizeValue(1)
+ , mnLastPeriodValue(1)
+ , mDialogLostFocus(false)
+ , mxInputRangeLabel(m_xBuilder->weld_label("input-range-label"))
+ , mxInputRangeEdit(new formula::WeldRefEdit(m_xBuilder->weld_entry("input-range-edit")))
+ , mxInputRangeButton(new formula::WeldRefButton(m_xBuilder->weld_button("input-range-button")))
+ , mxOutputRangeLabel(m_xBuilder->weld_label("output-range-label"))
+ , mxOutputRangeEdit(new formula::WeldRefEdit(m_xBuilder->weld_entry("output-range-edit")))
+ , mxOutputRangeButton(new formula::WeldRefButton(m_xBuilder->weld_button("output-range-button")))
+ , mxSampleSize(m_xBuilder->weld_spin_button("sample-size-spin"))
+ , mxPeriod(m_xBuilder->weld_spin_button("period-spin"))
+ , mxRandomMethodRadio(m_xBuilder->weld_radio_button("random-method-radio"))
+ , mxWithReplacement(m_xBuilder->weld_check_button("with-replacement"))
+ , mxKeepOrder(m_xBuilder->weld_check_button("keep-order"))
+ , mxPeriodicMethodRadio(m_xBuilder->weld_radio_button("periodic-method-radio"))
+ , mxButtonOk(m_xBuilder->weld_button("ok"))
{
- get(mpInputRangeLabel, "input-range-label");
- get(mpInputRangeEdit, "input-range-edit");
- get(mpInputRangeButton, "input-range-button");
- mpInputRangeEdit->SetReferences(this, mpInputRangeLabel);
- mpInputRangeButton->SetReferences(this, mpInputRangeEdit);
+ mxInputRangeEdit->SetReferences(this, mxInputRangeLabel.get());
+ mxInputRangeButton->SetReferences(this, mxInputRangeEdit.get());
- get(mpOutputRangeLabel, "output-range-label");
- get(mpOutputRangeEdit, "output-range-edit");
- get(mpOutputRangeButton, "output-range-button");
- mpOutputRangeEdit->SetReferences(this, mpOutputRangeLabel);
- mpOutputRangeButton->SetReferences(this, mpOutputRangeEdit);
-
- get(mpSampleSize, "sample-size-spin");
- get(mpPeriod, "period-spin");
-
- get(mpRandomMethodRadio, "random-method-radio");
- get(mpWithReplacement, "with-replacement");
- get(mpKeepOrder, "keep-order");
- get(mpPeriodicMethodRadio, "periodic-method-radio");
-
- get(mpButtonOk, "ok");
+ mxOutputRangeEdit->SetReferences(this, mxOutputRangeLabel.get());
+ mxOutputRangeButton->SetReferences(this, mxOutputRangeEdit.get());
Init();
GetRangeFromSelection();
@@ -63,60 +59,42 @@ ScSamplingDialog::ScSamplingDialog(
ScSamplingDialog::~ScSamplingDialog()
{
- disposeOnce();
-}
-
-void ScSamplingDialog::dispose()
-{
- mpInputRangeLabel.clear();
- mpInputRangeEdit.clear();
- mpInputRangeButton.clear();
- mpOutputRangeLabel.clear();
- mpOutputRangeEdit.clear();
- mpOutputRangeButton.clear();
- mpSampleSize.clear();
- mpPeriod.clear();
- mpRandomMethodRadio.clear();
- mpWithReplacement.clear();
- mpKeepOrder.clear();
- mpPeriodicMethodRadio.clear();
- mpButtonOk.clear();
- mpActiveEdit.clear();
- ScAnyRefDlg::dispose();
}
void ScSamplingDialog::Init()
{
- mpButtonOk->SetClickHdl( LINK( this, ScSamplingDialog, OkClicked ) );
- mpButtonOk->Enable(false);
+ mxButtonOk->connect_clicked( LINK( this, ScSamplingDialog, OkClicked ) );
+ mxButtonOk->set_sensitive(false);
- Link<Control&,void> aLink = LINK( this, ScSamplingDialog, GetFocusHandler );
- mpInputRangeEdit->SetGetFocusHdl( aLink );
- mpInputRangeButton->SetGetFocusHdl( aLink );
- mpOutputRangeEdit->SetGetFocusHdl( aLink );
- mpOutputRangeButton->SetGetFocusHdl( aLink );
+ Link<formula::WeldRefEdit&,void> aEditLink = LINK( this, ScSamplingDialog, GetEditFocusHandler );
+ mxInputRangeEdit->SetGetFocusHdl( aEditLink );
+ mxOutputRangeEdit->SetGetFocusHdl( aEditLink );
+ Link<formula::WeldRefButton&,void> aButtonLink = LINK( this, ScSamplingDialog, GetButtonFocusHandler );
+ mxInputRangeButton->SetGetFocusHdl( aButtonLink );
+ mxOutputRangeButton->SetGetFocusHdl( aButtonLink );
- aLink = LINK( this, ScSamplingDialog, LoseFocusHandler );
- mpInputRangeEdit->SetLoseFocusHdl( aLink );
- mpInputRangeButton->SetLoseFocusHdl( aLink );
- mpOutputRangeEdit->SetLoseFocusHdl( aLink );
- mpOutputRangeButton->SetLoseFocusHdl( aLink );
+ aEditLink = LINK( this, ScSamplingDialog, LoseEditFocusHandler );
+ mxInputRangeEdit->SetLoseFocusHdl( aEditLink );
+ mxOutputRangeEdit->SetLoseFocusHdl( aEditLink );
+ aButtonLink = LINK( this, ScSamplingDialog, LoseButtonFocusHandler );
+ mxInputRangeButton->SetLoseFocusHdl( aButtonLink );
+ mxOutputRangeButton->SetLoseFocusHdl( aButtonLink );
- Link<Edit&,void> aLink2 = LINK( this, ScSamplingDialog, RefInputModifyHandler);
- mpInputRangeEdit->SetModifyHdl( aLink2);
- mpOutputRangeEdit->SetModifyHdl( aLink2);
+ Link<formula::WeldRefEdit&,void> aLink2 = LINK( this, ScSamplingDialog, RefInputModifyHandler);
+ mxInputRangeEdit->SetModifyHdl( aLink2);
+ mxOutputRangeEdit->SetModifyHdl( aLink2);
- mpSampleSize->SetModifyHdl( LINK( this, ScSamplingDialog, SamplingSizeValueModified ));
- mpPeriod->SetModifyHdl( LINK( this, ScSamplingDialog, PeriodValueModified ));
+ mxSampleSize->connect_value_changed( LINK( this, ScSamplingDialog, SamplingSizeValueModified ));
+ mxPeriod->connect_value_changed( LINK( this, ScSamplingDialog, PeriodValueModified ));
- mpPeriodicMethodRadio->SetToggleHdl( LINK( this, ScSamplingDialog, ToggleSamplingMethod ) );
- mpRandomMethodRadio->SetToggleHdl( LINK( this, ScSamplingDialog, ToggleSamplingMethod ) );
+ mxPeriodicMethodRadio->connect_toggled( LINK( this, ScSamplingDialog, ToggleSamplingMethod ) );
+ mxRandomMethodRadio->connect_toggled( LINK( this, ScSamplingDialog, ToggleSamplingMethod ) );
- mpWithReplacement->SetClickHdl( LINK( this, ScSamplingDialog, CheckHdl));
- mpKeepOrder->SetClickHdl( LINK( this, ScSamplingDialog, CheckHdl));
+ mxWithReplacement->connect_clicked( LINK( this, ScSamplingDialog, CheckHdl));
+ mxKeepOrder->connect_clicked( LINK( this, ScSamplingDialog, CheckHdl));
- mpOutputRangeEdit->GrabFocus();
- mpPeriodicMethodRadio->Check();
+ mxOutputRangeEdit->GrabFocus();
+ mxPeriodicMethodRadio->set_active(true);
ToggleSamplingMethod();
}
@@ -125,7 +103,7 @@ void ScSamplingDialog::GetRangeFromSelection()
{
mViewData->GetSimpleArea(mInputRange);
OUString aCurrentString(mInputRange.Format(ScRefFlags::RANGE_ABS_3D, mDocument, mAddressDetails));
- mpInputRangeEdit->SetText(aCurrentString);
+ mxInputRangeEdit->SetText(aCurrentString);
}
void ScSamplingDialog::SetActive()
@@ -138,14 +116,14 @@ void ScSamplingDialog::SetActive()
}
else
{
- GrabFocus();
+ m_xDialog->grab_focus();
}
RefInputDone();
}
-bool ScSamplingDialog::Close()
+void ScSamplingDialog::Close()
{
- return DoClose( ScSamplingDialogWrapper::GetChildWindowId() );
+ DoClose( ScSamplingDialogWrapper::GetChildWindowId() );
}
void ScSamplingDialog::SetReference( const ScRange& rReferenceRange, ScDocument* pDocument )
@@ -157,15 +135,15 @@ void ScSamplingDialog::SetReference( const ScRange& rReferenceRange, ScDocument*
OUString aReferenceString;
- if ( mpActiveEdit == mpInputRangeEdit )
+ if ( mpActiveEdit == mxInputRangeEdit.get() )
{
mInputRange = rReferenceRange;
aReferenceString = mInputRange.Format(ScRefFlags::RANGE_ABS_3D, pDocument, mAddressDetails);
- mpInputRangeEdit->SetRefString( aReferenceString );
+ mxInputRangeEdit->SetRefString( aReferenceString );
LimitSampleSizeAndPeriod();
}
- else if ( mpActiveEdit == mpOutputRangeEdit )
+ else if ( mpActiveEdit == mxOutputRangeEdit.get() )
{
mOutputAddress = rReferenceRange.aStart;
@@ -173,22 +151,19 @@ void ScSamplingDialog::SetReference( const ScRange& rReferenceRange, ScDocument*
ScRefFlags::ADDR_ABS :
ScRefFlags::ADDR_ABS_3D;
aReferenceString = mOutputAddress.Format(nFormat, pDocument, pDocument->GetAddressConvention());
- mpOutputRangeEdit->SetRefString( aReferenceString );
+ mxOutputRangeEdit->SetRefString( aReferenceString );
// Change sampling size according to output range selection
sal_Int64 aSelectedSampleSize = rReferenceRange.aEnd.Row() - rReferenceRange.aStart.Row() + 1;
if (aSelectedSampleSize > 1)
- mpSampleSize->SetValue(aSelectedSampleSize);
- SamplingSizeValueModified(*mpSampleSize);
+ mxSampleSize->set_value(aSelectedSampleSize);
+ SamplingSizeValueModified(*mxSampleSize);
}
}
// Enable OK if both, input range and output address are set.
// Disable if at least one is invalid.
- if (mInputRange.IsValid() && mOutputAddress.IsValid())
- mpButtonOk->Enable();
- else
- mpButtonOk->Enable(false);
+ mxButtonOk->set_sensitive(mInputRange.IsValid() && mOutputAddress.IsValid());
}
ScRange ScSamplingDialog::PerformPeriodicSampling(ScDocShell* pDocShell)
@@ -199,7 +174,7 @@ ScRange ScSamplingDialog::PerformPeriodicSampling(ScDocShell* pDocShell)
SCTAB outTab = mOutputAddress.Tab();
SCROW outRow = mOutputAddress.Row();
- sal_Int64 aPeriod = mpPeriod->GetValue();
+ sal_Int64 aPeriod = mxPeriod->get_value();
for (SCROW inTab = aStart.Tab(); inTab <= aEnd.Tab(); inTab++)
{
@@ -235,13 +210,13 @@ ScRange ScSamplingDialog::PerformRandomSampling(ScDocShell* pDocShell)
SCTAB outTab = mOutputAddress.Tab();
SCROW outRow = mOutputAddress.Row();
- const sal_Int64 nSampleSize = mpSampleSize->GetValue();
+ const sal_Int64 nSampleSize = mxSampleSize->get_value();
// This implementation groups by columns. Other options could be grouping
// by rows or area.
const sal_Int64 nPopulationSize = aEnd.Row() - aStart.Row() + 1;
- const bool bWithReplacement = mpWithReplacement->IsEnabled() && mpWithReplacement->IsChecked();
+ const bool bWithReplacement = mxWithReplacement->get_sensitive() && mxWithReplacement->get_active();
// WOR (WithOutReplacement) can't draw more than population. Catch that in
// the caller.
@@ -315,7 +290,7 @@ ScRange ScSamplingDialog::PerformRandomSamplingKeepOrder(ScDocShell* pDocShell)
SCROW inRow;
- sal_Int64 aSampleSize = mpSampleSize->GetValue();
+ sal_Int64 aSampleSize = mxSampleSize->get_value();
for (SCROW inTab = aStart.Tab(); inTab <= aEnd.Tab(); inTab++)
{
@@ -361,14 +336,14 @@ void ScSamplingDialog::PerformSampling()
pUndoManager->EnterListAction( aUndo, aUndo, 0, mViewData->GetViewShell()->GetViewShellId() );
- if (mpRandomMethodRadio->IsChecked())
+ if (mxRandomMethodRadio->get_active())
{
- if (mpKeepOrder->IsEnabled() && mpKeepOrder->IsChecked())
+ if (mxKeepOrder->get_sensitive() && mxKeepOrder->get_active())
aModifiedRange = PerformRandomSamplingKeepOrder(pDocShell);
else
aModifiedRange = PerformRandomSampling(pDocShell);
}
- else if (mpPeriodicMethodRadio->IsChecked())
+ else if (mxPeriodicMethodRadio->get_active())
{
aModifiedRange = PerformPeriodicSampling(pDocShell);
}
@@ -388,128 +363,147 @@ void ScSamplingDialog::LimitSampleSizeAndPeriod()
// than last known value. When enlargening the input population range the
// values will be adjusted up to the last known value again.
const sal_Int64 nPopulationSize = GetPopulationSize();
- if (nPopulationSize <= mnLastSampleSizeValue && !mpWithReplacement->IsChecked())
- mpSampleSize->SetValue( nPopulationSize);
+ if (nPopulationSize <= mnLastSampleSizeValue && !mxWithReplacement->get_active())
+ mxSampleSize->set_value( nPopulationSize);
if (nPopulationSize <= mnLastPeriodValue)
- mpPeriod->SetValue( nPopulationSize);
+ mxPeriod->set_value( nPopulationSize);
}
-IMPL_LINK_NOARG(ScSamplingDialog, SamplingSizeValueModified, Edit&, void)
+IMPL_LINK_NOARG(ScSamplingDialog, SamplingSizeValueModified, weld::SpinButton&, void)
{
- if (!mpWithReplacement->IsChecked())
+ if (!mxWithReplacement->get_active())
{
// For all WOR methods limit sample size to population size.
const sal_Int64 nPopulationSize = GetPopulationSize();
- if (mpSampleSize->GetValue() > nPopulationSize)
- mpSampleSize->SetValue(nPopulationSize);
+ if (mxSampleSize->get_value() > nPopulationSize)
+ mxSampleSize->set_value(nPopulationSize);
}
- mnLastSampleSizeValue = mpSampleSize->GetValue();
+ mnLastSampleSizeValue = mxSampleSize->get_value();
}
-IMPL_LINK_NOARG(ScSamplingDialog, PeriodValueModified, Edit&, void)
+IMPL_LINK_NOARG(ScSamplingDialog, PeriodValueModified, weld::SpinButton&, void)
{
// Limit period to population size.
const sal_Int64 nPopulationSize = GetPopulationSize();
- if (mpPeriod->GetValue() > nPopulationSize)
- mpPeriod->SetValue(nPopulationSize);
- mnLastPeriodValue = mpPeriod->GetValue();
+ if (mxPeriod->get_value() > nPopulationSize)
+ mxPeriod->set_value(nPopulationSize);
+ mnLastPeriodValue = mxPeriod->get_value();
}
-IMPL_LINK( ScSamplingDialog, GetFocusHandler, Control&, rCtrl, void )
+IMPL_LINK( ScSamplingDialog, GetEditFocusHandler, formula::WeldRefEdit&, rCtrl, void )
{
- if ( (&rCtrl == static_cast<Control*>(mpInputRangeEdit)) || (&rCtrl == static_cast<Control*>(mpInputRangeButton)))
- mpActiveEdit = mpInputRangeEdit;
- else if ((&rCtrl == static_cast<Control*>(mpOutputRangeEdit)) || (&rCtrl == static_cast<Control*>(mpOutputRangeButton)))
- mpActiveEdit = mpOutputRangeEdit;
+ if (&rCtrl == mxInputRangeEdit.get())
+ mpActiveEdit = mxInputRangeEdit.get();
+ else if (&rCtrl == mxOutputRangeEdit.get())
+ mpActiveEdit = mxOutputRangeEdit.get();
else
mpActiveEdit = nullptr;
if (mpActiveEdit)
- mpActiveEdit->SetSelection( Selection( 0, SELECTION_MAX ) );
+ mpActiveEdit->SelectAll();
}
-IMPL_LINK_NOARG( ScSamplingDialog, OkClicked, Button*, void )
+IMPL_LINK(ScSamplingDialog, GetButtonFocusHandler, formula::WeldRefButton&, rCtrl, void)
+{
+ if (&rCtrl == mxInputRangeButton.get())
+ mpActiveEdit = mxInputRangeEdit.get();
+ else if (&rCtrl == mxOutputRangeButton.get())
+ mpActiveEdit = mxOutputRangeEdit.get();
+ else
+ mpActiveEdit = nullptr;
+
+ if (mpActiveEdit)
+ mpActiveEdit->SelectAll();
+}
+
+
+IMPL_LINK_NOARG(ScSamplingDialog, OkClicked, weld::Button&, void)
{
PerformSampling();
- Close();
+ response(RET_OK);
}
-IMPL_LINK_NOARG(ScSamplingDialog, LoseFocusHandler, Control&, void)
+IMPL_LINK_NOARG(ScSamplingDialog, LoseEditFocusHandler, formula::WeldRefEdit&, void)
{
- mDialogLostFocus = !IsActive();
+ mDialogLostFocus = !m_xDialog->has_toplevel_focus();
}
-IMPL_LINK_NOARG(ScSamplingDialog, ToggleSamplingMethod, RadioButton&, void)
+IMPL_LINK_NOARG(ScSamplingDialog, LoseButtonFocusHandler, formula::WeldRefButton&, void)
+{
+ mDialogLostFocus = !m_xDialog->has_toplevel_focus();
+}
+
+IMPL_LINK_NOARG(ScSamplingDialog, ToggleSamplingMethod, weld::ToggleButton&, void)
{
ToggleSamplingMethod();
}
void ScSamplingDialog::ToggleSamplingMethod()
{
- if (mpRandomMethodRadio->IsChecked())
+ if (mxRandomMethodRadio->get_active())
{
- mpPeriod->Enable(false);
- mpSampleSize->Enable();
- mpWithReplacement->Enable();
- mpKeepOrder->Enable();
+ mxPeriod->set_sensitive(false);
+ mxSampleSize->set_sensitive(true);
+ mxWithReplacement->set_sensitive(true);
+ mxKeepOrder->set_sensitive(true);
}
- else if (mpPeriodicMethodRadio->IsChecked())
+ else if (mxPeriodicMethodRadio->get_active())
{
// WOR keeping order.
- mpPeriod->Enable();
- mpSampleSize->Enable(false);
- mpWithReplacement->Check(false);
- mpWithReplacement->Enable(false);
- mpKeepOrder->Check();
- mpKeepOrder->Enable(false);
+ mxPeriod->set_sensitive(true);
+ mxSampleSize->set_sensitive(false);
+ mxWithReplacement->set_active(false);
+ mxWithReplacement->set_sensitive(false);
+ mxKeepOrder->set_active(true);
+ mxKeepOrder->set_sensitive(false);
}
}
-IMPL_LINK( ScSamplingDialog, CheckHdl, Button*, pBtn, void )
+IMPL_LINK(ScSamplingDialog, CheckHdl, weld::Button&, rBtn, void)
{
// Keep both checkboxes enabled so user can easily switch between the three
// possible combinations (one or the other or none), just uncheck the other
// one if one is checked. Otherwise the other checkbox would had to be
// disabled until user unchecks the enabled one again, which would force
// user to two clicks to switch.
- if (pBtn == mpWithReplacement)
+ if (&rBtn == mxWithReplacement.get())
{
- if (static_cast<const CheckBox*>(pBtn)->IsChecked())
+ if (mxWithReplacement->get_active())
{
// For WR can't keep order.
- mpKeepOrder->Check(false);
+ mxKeepOrder->set_active(false);
}
else
{
// For WOR limit sample size to population size.
- SamplingSizeValueModified(*mpSampleSize);
+ SamplingSizeValueModified(*mxSampleSize);
}
}
- else if (pBtn == mpKeepOrder)
+ else if (&rBtn == mxKeepOrder.get())
{
- if (static_cast<const CheckBox*>(pBtn)->IsChecked())
+ if (mxKeepOrder->get_active())
{
// Keep order is always WOR.
- mpWithReplacement->Check(false);
- SamplingSizeValueModified(*mpSampleSize);
+ mxWithReplacement->set_active(false);
+ SamplingSizeValueModified(*mxSampleSize);
}
}
}
-IMPL_LINK_NOARG(ScSamplingDialog, RefInputModifyHandler, Edit&, void)
+IMPL_LINK_NOARG(ScSamplingDialog, RefInputModifyHandler, formula::WeldRefEdit&, void)
{
if ( mpActiveEdit )
{
- if ( mpActiveEdit == mpInputRangeEdit )
+ if ( mpActiveEdit == mxInputRangeEdit.get() )
{
ScRangeList aRangeList;
- bool bValid = ParseWithNames( aRangeList, mpInputRangeEdit->GetText(), mDocument);
+ bool bValid = ParseWithNames( aRangeList, mxInputRangeEdit->GetText(), mDocument);
const ScRange* pRange = (bValid && aRangeList.size() == 1) ? &aRangeList[0] : nullptr;
if (pRange)
{
mInputRange = *pRange;
// Highlight the resulting range.
- mpInputRangeEdit->StartUpdateData();
+ mxInputRangeEdit->StartUpdateData();
LimitSampleSizeAndPeriod();
}
@@ -518,10 +512,10 @@ IMPL_LINK_NOARG(ScSamplingDialog, RefInputModifyHandler, Edit&, void)
mInputRange = ScRange( ScAddress::INITIALIZE_INVALID);
}
}
- else if ( mpActiveEdit == mpOutputRangeEdit )
+ else if ( mpActiveEdit == mxOutputRangeEdit.get() )
{
ScRangeList aRangeList;
- bool bValid = ParseWithNames( aRangeList, mpOutputRangeEdit->GetText(), mDocument);
+ bool bValid = ParseWithNames( aRangeList, mxOutputRangeEdit->GetText(), mDocument);
const ScRange* pRange = (bValid && aRangeList.size() == 1) ? &aRangeList[0] : nullptr;
if (pRange)
{
@@ -534,17 +528,17 @@ IMPL_LINK_NOARG(ScSamplingDialog, RefInputModifyHandler, Edit&, void)
ScRefFlags::ADDR_ABS :
ScRefFlags::ADDR_ABS_3D;
OUString aReferenceString = mOutputAddress.Format(nFormat, mDocument, mDocument->GetAddressConvention());
- mpOutputRangeEdit->SetRefString( aReferenceString );
+ mxOutputRangeEdit->SetRefString( aReferenceString );
}
// Change sampling size according to output range selection
sal_Int64 aSelectedSampleSize = pRange->aEnd.Row() - pRange->aStart.Row() + 1;
if (aSelectedSampleSize > 1)
- mpSampleSize->SetValue(aSelectedSampleSize);
- SamplingSizeValueModified(*mpSampleSize);
+ mxSampleSize->set_value(aSelectedSampleSize);
+ SamplingSizeValueModified(*mxSampleSize);
// Highlight the resulting range.
- mpOutputRangeEdit->StartUpdateData();
+ mxOutputRangeEdit->StartUpdateData();
}
else
{
@@ -554,10 +548,7 @@ IMPL_LINK_NOARG(ScSamplingDialog, RefInputModifyHandler, Edit&, void)
}
// Enable OK if both, input range and output address are set.
- if (mInputRange.IsValid() && mOutputAddress.IsValid())
- mpButtonOk->Enable();
- else
- mpButtonOk->Disable();
+ mxButtonOk->set_sensitive(mInputRange.IsValid() && mOutputAddress.IsValid());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */