replace wildcard/regex checkboxes with radio button group, tdf#72196

Change-Id: I505a0de789190dc7345a703ac50008276d0ed195
This commit is contained in:
Eike Rathke
2016-03-02 14:35:35 +01:00
parent ddc363b2b2
commit 63e914719e
3 changed files with 34 additions and 20 deletions

View File

@@ -60,8 +60,9 @@ private:
VclPtr<CheckBox> m_pBtnCase; VclPtr<CheckBox> m_pBtnCase;
VclPtr<CheckBox> m_pBtnCalc; VclPtr<CheckBox> m_pBtnCalc;
VclPtr<CheckBox> m_pBtnMatch; VclPtr<CheckBox> m_pBtnMatch;
VclPtr<CheckBox> m_pBtnWildcards; VclPtr<RadioButton> m_pBtnWildcards;
VclPtr<CheckBox> m_pBtnRegex; VclPtr<RadioButton> m_pBtnRegex;
VclPtr<RadioButton> m_pBtnLiteral;
VclPtr<CheckBox> m_pBtnLookUp; VclPtr<CheckBox> m_pBtnLookUp;
VclPtr<CheckBox> m_pBtnGeneralPrec; VclPtr<CheckBox> m_pBtnGeneralPrec;

View File

@@ -55,8 +55,9 @@ ScTpCalcOptions::ScTpCalcOptions(vcl::Window* pParent, const SfxItemSet& rCoreAt
get(m_pBtnCase, "case"); get(m_pBtnCase, "case");
get(m_pBtnCalc, "calc"); get(m_pBtnCalc, "calc");
get(m_pBtnMatch, "match"); get(m_pBtnMatch, "match");
get(m_pBtnWildcards, "wildcards"); get(m_pBtnWildcards, "formulawildcards");
get(m_pBtnRegex, "regex"); get(m_pBtnRegex, "formularegex");
get(m_pBtnLiteral, "formulaliteral");
get(m_pBtnLookUp, "lookup"); get(m_pBtnLookUp, "lookup");
get(m_pBtnGeneralPrec, "generalprec"); get(m_pBtnGeneralPrec, "generalprec");
get(m_pFtPrec, "precft"); get(m_pFtPrec, "precft");
@@ -87,6 +88,7 @@ void ScTpCalcOptions::dispose()
m_pBtnMatch.clear(); m_pBtnMatch.clear();
m_pBtnWildcards.clear(); m_pBtnWildcards.clear();
m_pBtnRegex.clear(); m_pBtnRegex.clear();
m_pBtnLiteral.clear();
m_pBtnLookUp.clear(); m_pBtnLookUp.clear();
m_pBtnGeneralPrec.clear(); m_pBtnGeneralPrec.clear();
m_pFtPrec.clear(); m_pFtPrec.clear();
@@ -101,8 +103,6 @@ void ScTpCalcOptions::Init()
m_pBtnDateStd->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) ); m_pBtnDateStd->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
m_pBtnDateSc10->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) ); m_pBtnDateSc10->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
m_pBtnDate1904->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) ); m_pBtnDate1904->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
m_pBtnWildcards->SetClickHdl( LINK( this, ScTpCalcOptions, CheckClickHdl ) );
m_pBtnRegex->SetClickHdl( LINK( this, ScTpCalcOptions, CheckClickHdl ) );
} }
VclPtr<SfxTabPage> ScTpCalcOptions::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ) VclPtr<SfxTabPage> ScTpCalcOptions::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
@@ -125,6 +125,7 @@ void ScTpCalcOptions::Reset( const SfxItemSet* /* rCoreAttrs */ )
bRegex = false; bRegex = false;
m_pBtnWildcards->Check( bWildcards ); m_pBtnWildcards->Check( bWildcards );
m_pBtnRegex->Check( bRegex ); m_pBtnRegex->Check( bRegex );
m_pBtnLiteral->Check( !bWildcards && !bRegex );
m_pBtnLookUp->Check( pLocalOptions->IsLookUpColRowNames() ); m_pBtnLookUp->Check( pLocalOptions->IsLookUpColRowNames() );
m_pBtnIterate->Check( pLocalOptions->IsIter() ); m_pBtnIterate->Check( pLocalOptions->IsIter() );
m_pEdSteps->SetValue( pLocalOptions->GetIterCount() ); m_pEdSteps->SetValue( pLocalOptions->GetIterCount() );
@@ -263,16 +264,6 @@ IMPL_LINK_TYPED( ScTpCalcOptions, CheckClickHdl, Button*, p, void )
m_pFtEps->Disable(); m_pEdEps->Disable(); m_pFtEps->Disable(); m_pEdEps->Disable();
} }
} }
else if (pBtn == m_pBtnWildcards)
{
if ( pBtn->IsChecked() )
m_pBtnRegex->Check( false );
}
else if (pBtn == m_pBtnRegex)
{
if ( pBtn->IsChecked() )
m_pBtnWildcards->Check( false );
}
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -92,14 +92,16 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="wildcards"> <object class="GtkRadioButton" id="formulawildcards">
<property name="label" translatable="yes">Enable w_ildcards in formulas</property> <property name="label" translatable="yes">Enable w_ildcards in formulas</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">formularegex</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@@ -108,14 +110,16 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="regex"> <object class="GtkRadioButton" id="formularegex">
<property name="label" translatable="yes">Enable r_egular expressions in formulas</property> <property name="label" translatable="yes">Enable r_egular expressions in formulas</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">formulaliteral</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@@ -123,6 +127,24 @@
<property name="width">2</property> <property name="width">2</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkRadioButton" id="formulaliteral">
<property name="label" translatable="yes">No wildcards or regular expressions in formulas</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">formulawildcard</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="width">2</property>
</packing>
</child>
<child> <child>
<object class="GtkCheckButton" id="lookup"> <object class="GtkCheckButton" id="lookup">
<property name="label" translatable="yes">_Automatically find column and row labels</property> <property name="label" translatable="yes">_Automatically find column and row labels</property>
@@ -135,7 +157,7 @@
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">5</property> <property name="top_attach">6</property>
<property name="width">2</property> <property name="width">2</property>
</packing> </packing>
</child> </child>
@@ -151,7 +173,7 @@
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">6</property> <property name="top_attach">7</property>
</packing> </packing>
</child> </child>
<child> <child>