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 m_pBtnCase; VclPtr m_pBtnCalc; VclPtr m_pBtnMatch; + VclPtr m_pBtnWildcards; VclPtr m_pBtnRegex; VclPtr m_pBtnLookUp; VclPtr 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 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 @@ - - _Enable regular expressions in formulas + + Enable w_ildcards in formulas True True False @@ -107,6 +107,22 @@ 2 + + + Enable r_egular expressions in formulas + True + True + False + True + 0 + True + + + 0 + 4 + 2 + + _Automatically find column and row labels @@ -119,7 +135,7 @@ 0 - 4 + 5 2 @@ -135,7 +151,7 @@ 0 - 5 + 6