diff options
author | Eike Rathke <erack@redhat.com> | 2016-02-25 18:02:25 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-02-26 01:41:49 +0100 |
commit | 3a0abd3019ec3ca29b8f1378cdb32ebf741e6306 (patch) | |
tree | 7c64c5886b9f28e30732176fee6205a2084cf334 /svl | |
parent | 26be25f27d2f67bdee0d2a4ad95d9d252e470780 (diff) |
add SvxSearchItem::GetWildcard() SetWildcard()
Change-Id: I0aeb7fbcedad381a385ffe6649ac51e8c961ca11
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/srchitem.cxx | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx index 99d1a565fd0a..881c464ee1f4 100644 --- a/svl/source/items/srchitem.cxx +++ b/svl/source/items/srchitem.cxx @@ -137,6 +137,11 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) : m_bAsianOptions = aOpt.IsUseAsianOptions(); m_bNotes = aOpt.IsNotes(); + if (aOpt.IsUseWildcard()) + { + m_aSearchOpt.AlgorithmType2 = SearchAlgorithms2::WILDCARD; + m_aSearchOpt.algorithmType = SearchAlgorithms_ABSOLUTE; // something valid + } if (aOpt.IsUseRegularExpression()) { m_aSearchOpt.AlgorithmType2 = SearchAlgorithms2::REGEXP; @@ -348,7 +353,22 @@ void SvxSearchItem::SetRegExp( bool bVal ) m_aSearchOpt.AlgorithmType2 = SearchAlgorithms2::REGEXP; m_aSearchOpt.algorithmType = SearchAlgorithms_REGEXP; } - else if ( SearchAlgorithms_REGEXP == m_aSearchOpt.algorithmType ) + else if ( SearchAlgorithms2::REGEXP == m_aSearchOpt.AlgorithmType2 ) + { + m_aSearchOpt.AlgorithmType2 = SearchAlgorithms2::ABSOLUTE; + m_aSearchOpt.algorithmType = SearchAlgorithms_ABSOLUTE; + } +} + + +void SvxSearchItem::SetWildcard( bool bVal ) +{ + if ( bVal ) + { + m_aSearchOpt.AlgorithmType2 = SearchAlgorithms2::WILDCARD; + m_aSearchOpt.algorithmType = SearchAlgorithms_ABSOLUTE; // something valid + } + else if ( SearchAlgorithms2::REGEXP == m_aSearchOpt.AlgorithmType2 ) { m_aSearchOpt.AlgorithmType2 = SearchAlgorithms2::ABSOLUTE; m_aSearchOpt.algorithmType = SearchAlgorithms_ABSOLUTE; @@ -372,7 +392,7 @@ void SvxSearchItem::SetLevenshtein( bool bVal ) m_aSearchOpt.AlgorithmType2 = SearchAlgorithms2::APPROXIMATE; m_aSearchOpt.algorithmType = SearchAlgorithms_APPROXIMATE; } - else if ( SearchAlgorithms_APPROXIMATE == m_aSearchOpt.algorithmType ) + else if ( SearchAlgorithms2::APPROXIMATE == m_aSearchOpt.AlgorithmType2 ) { m_aSearchOpt.AlgorithmType2 = SearchAlgorithms2::ABSOLUTE; m_aSearchOpt.algorithmType = SearchAlgorithms_ABSOLUTE; |