diff options
author | Eike Rathke <erack@redhat.com> | 2016-02-22 20:43:50 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-02-22 21:30:29 +0100 |
commit | 20b5917966d931fc9cbb8dd24a957f80f95e64bc (patch) | |
tree | 2ca2de121dc2c4e1e49b05fe903c80c19dab8f4a | |
parent | d098b76f3311ec1b1763dbcfc1561791a4a2945f (diff) |
add wildcards to Tools->Options->Calc->Calculate dialog, tdf#72196
Maybe this should be a radio button instead (wildcards/regex/literal),
on the other hand it reflects the two API bool values. Also only two
checkbox lines are needed instead of three radio button lines.
Change-Id: I3fa74e19c838e10dc0cffd6c0ad6329017e10e56
-rw-r--r-- | sc/source/ui/inc/tpcalc.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/optdlg/tpcalc.cxx | 22 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/optcalculatepage.ui | 24 |
3 files changed, 42 insertions, 5 deletions
diff --git a/sc/source/ui/inc/tpcalc.hxx b/sc/source/ui/inc/tpcalc.hxx index 9476ac151cf2..1d99e1ea110d 100644 --- a/sc/source/ui/inc/tpcalc.hxx +++ b/sc/source/ui/inc/tpcalc.hxx @@ -60,6 +60,7 @@ private: VclPtr<CheckBox> m_pBtnCase; VclPtr<CheckBox> m_pBtnCalc; VclPtr<CheckBox> m_pBtnMatch; + VclPtr<CheckBox> m_pBtnWildcards; VclPtr<CheckBox> m_pBtnRegex; VclPtr<CheckBox> m_pBtnLookUp; VclPtr<CheckBox> m_pBtnGeneralPrec; diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx index 8073d3735ba5..b3fcfb707f12 100644 --- a/sc/source/ui/optdlg/tpcalc.cxx +++ b/sc/source/ui/optdlg/tpcalc.cxx @@ -55,6 +55,7 @@ ScTpCalcOptions::ScTpCalcOptions(vcl::Window* pParent, const SfxItemSet& rCoreAt get(m_pBtnCase, "case"); get(m_pBtnCalc, "calc"); get(m_pBtnMatch, "match"); + get(m_pBtnWildcards, "wildcards"); get(m_pBtnRegex, "regex"); get(m_pBtnLookUp, "lookup"); get(m_pBtnGeneralPrec, "generalprec"); @@ -84,6 +85,7 @@ void ScTpCalcOptions::dispose() m_pBtnCase.clear(); m_pBtnCalc.clear(); m_pBtnMatch.clear(); + m_pBtnWildcards.clear(); m_pBtnRegex.clear(); m_pBtnLookUp.clear(); m_pBtnGeneralPrec.clear(); @@ -99,6 +101,8 @@ void ScTpCalcOptions::Init() m_pBtnDateStd->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) ); m_pBtnDateSc10->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 ) @@ -115,7 +119,12 @@ void ScTpCalcOptions::Reset( const SfxItemSet* /* rCoreAttrs */ ) m_pBtnCase->Check( !pLocalOptions->IsIgnoreCase() ); m_pBtnCalc->Check( pLocalOptions->IsCalcAsShown() ); m_pBtnMatch->Check( pLocalOptions->IsMatchWholeCell() ); - m_pBtnRegex->Check( pLocalOptions->IsFormulaRegexEnabled() ); + bool bWildcards = pLocalOptions->IsFormulaWildcardsEnabled(); + bool bRegex = pLocalOptions->IsFormulaRegexEnabled(); + if (bWildcards && bRegex) + bRegex = false; + m_pBtnWildcards->Check( bWildcards ); + m_pBtnRegex->Check( bRegex ); m_pBtnLookUp->Check( pLocalOptions->IsLookUpColRowNames() ); m_pBtnIterate->Check( pLocalOptions->IsIter() ); m_pEdSteps->SetValue( pLocalOptions->GetIterCount() ); @@ -161,6 +170,7 @@ bool ScTpCalcOptions::FillItemSet( SfxItemSet* rCoreAttrs ) pLocalOptions->SetIgnoreCase( !m_pBtnCase->IsChecked() ); pLocalOptions->SetCalcAsShown( m_pBtnCalc->IsChecked() ); pLocalOptions->SetMatchWholeCell( m_pBtnMatch->IsChecked() ); + pLocalOptions->SetFormulaWildcardsEnabled( m_pBtnWildcards->IsChecked() ); pLocalOptions->SetFormulaRegexEnabled( m_pBtnRegex->IsChecked() ); pLocalOptions->SetLookUpColRowNames( m_pBtnLookUp->IsChecked() ); @@ -253,6 +263,16 @@ IMPL_LINK_TYPED( ScTpCalcOptions, CheckClickHdl, Button*, p, void ) 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: */ diff --git a/sc/uiconfig/scalc/ui/optcalculatepage.ui b/sc/uiconfig/scalc/ui/optcalculatepage.ui index a9dca1982238..6b0e1c024a79 100644 --- a/sc/uiconfig/scalc/ui/optcalculatepage.ui +++ b/sc/uiconfig/scalc/ui/optcalculatepage.ui @@ -92,8 +92,8 @@ </packing> </child> <child> - <object class="GtkCheckButton" id="regex"> - <property name="label" translatable="yes">_Enable regular expressions in formulas</property> + <object class="GtkCheckButton" id="wildcards"> + <property name="label" translatable="yes">Enable w_ildcards in formulas</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -108,6 +108,22 @@ </packing> </child> <child> + <object class="GtkCheckButton" id="regex"> + <property name="label" translatable="yes">Enable r_egular 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="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">4</property> + <property name="width">2</property> + </packing> + </child> + <child> <object class="GtkCheckButton" id="lookup"> <property name="label" translatable="yes">_Automatically find column and row labels</property> <property name="visible">True</property> @@ -119,7 +135,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">4</property> + <property name="top_attach">5</property> <property name="width">2</property> </packing> </child> @@ -135,7 +151,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">5</property> + <property name="top_attach">6</property> </packing> </child> <child> |