Kaydet (Commit) d4bb1ea9 authored tarafından Eike Rathke's avatar Eike Rathke

reintroduce initial coupling of EmptyStringAsZero to StringConversion

... as not all combinations make sense and aren't handled.
For ILLEGAL and ZERO string conversions the EmptyAsZero checkbox is to
be disabled. Also, remember the EmptyAsZero value again if the user
toggled it.

Got lost in commit e224c9cb
"Refactor OpenCL settings dialog"

Change-Id: I86f9278e3d7856c70e94c2d1eb9f507359b90899
üst 2ad231f9
......@@ -97,6 +97,7 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
get(mpEmptyAsZero,"checkEmptyAsZero");
mpEmptyAsZero->Check(rConfig.mbEmptyStringAsZero);
mpEmptyAsZero->SetClickHdl(LINK(this, ScCalcOptionsDialog, AsZeroModifiedHdl));
CoupleEmptyAsZeroToStringConversion();
get(mpSyntax,"comboSyntaxRef");
mpSyntax->SelectEntryPos( toSelectedItem(rConfig.meStringRefAddressSyntax) );
......@@ -192,34 +193,40 @@ void ScCalcOptionsDialog::SelectedDeviceChanged()
#endif
}
void ScCalcOptionsDialog::CoupleEmptyAsZeroToStringConversion()
{
switch (maConfig.meStringConversion)
{
case ScCalcConfig::StringConversion::ILLEGAL:
maConfig.mbEmptyStringAsZero = false;
mpEmptyAsZero->Check(false);
mpEmptyAsZero->Enable(false);
break;
case ScCalcConfig::StringConversion::ZERO:
maConfig.mbEmptyStringAsZero = true;
mpEmptyAsZero->Check();
mpEmptyAsZero->Enable(false);
break;
case ScCalcConfig::StringConversion::UNAMBIGUOUS:
case ScCalcConfig::StringConversion::LOCALE:
// Reset to the value the user selected before.
maConfig.mbEmptyStringAsZero = mbSelectedEmptyStringAsZero;
mpEmptyAsZero->Enable(true);
mpEmptyAsZero->Check( mbSelectedEmptyStringAsZero);
break;
}
}
IMPL_LINK_TYPED(ScCalcOptionsDialog, AsZeroModifiedHdl, Button*, pCheckBox, void )
{
maConfig.mbEmptyStringAsZero = static_cast<CheckBox*>(pCheckBox)->IsChecked();
maConfig.mbEmptyStringAsZero = mbSelectedEmptyStringAsZero = static_cast<CheckBox*>(pCheckBox)->IsChecked();
}
IMPL_LINK(ScCalcOptionsDialog, ConversionModifiedHdl, ListBox*, pConv )
{
maConfig.meStringConversion = (ScCalcConfig::StringConversion)pConv->GetSelectEntryPos();
switch (maConfig.meStringConversion)
{
case ScCalcConfig::StringConversion::ILLEGAL:
maConfig.mbEmptyStringAsZero = false;
mpEmptyAsZero->Check(false);
mpEmptyAsZero->Enable(false);
break;
case ScCalcConfig::StringConversion::ZERO:
maConfig.mbEmptyStringAsZero = true;
mpEmptyAsZero->Check();
mpEmptyAsZero->Enable(false);
break;
case ScCalcConfig::StringConversion::UNAMBIGUOUS:
case ScCalcConfig::StringConversion::LOCALE:
// Reset to the value the user selected before.
maConfig.mbEmptyStringAsZero = mbSelectedEmptyStringAsZero;
mpEmptyAsZero->Enable(true);
break;
}
maConfig.meStringConversion = (ScCalcConfig::StringConversion)pConv->GetSelectEntryPos();
CoupleEmptyAsZeroToStringConversion();
return 0;
}
......
......@@ -53,6 +53,7 @@ public:
private:
void OpenCLAutomaticSelectionChanged();
void SelectedDeviceChanged();
void CoupleEmptyAsZeroToStringConversion();
private:
VclPtr<CheckBox> mpEmptyAsZero;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment