summaryrefslogtreecommitdiff
path: root/include/svl
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-02-25 18:02:25 +0100
committerEike Rathke <erack@redhat.com>2016-02-26 01:41:49 +0100
commit3a0abd3019ec3ca29b8f1378cdb32ebf741e6306 (patch)
tree7c64c5886b9f28e30732176fee6205a2084cf334 /include/svl
parent26be25f27d2f67bdee0d2a4ad95d9d252e470780 (diff)
add SvxSearchItem::GetWildcard() SetWildcard()
Change-Id: I0aeb7fbcedad381a385ffe6649ac51e8c961ca11
Diffstat (limited to 'include/svl')
-rw-r--r--include/svl/srchitem.hxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/include/svl/srchitem.hxx b/include/svl/srchitem.hxx
index dd7afac19f2b..6c997d5ade6c 100644
--- a/include/svl/srchitem.hxx
+++ b/include/svl/srchitem.hxx
@@ -135,6 +135,9 @@ public:
inline bool GetRegExp() const;
void SetRegExp( bool bVal );
+ inline bool GetWildcard() const;
+ void SetWildcard( bool bVal );
+
bool GetPattern() const { return m_bPattern; }
void SetPattern(bool bNewPattern) { m_bPattern = bNewPattern; }
@@ -239,7 +242,17 @@ bool SvxSearchItem::GetRegExp() const
// adapted to use only new types.
assert( (m_aSearchOpt.algorithmType == css::util::SearchAlgorithms_REGEXP) ==
(m_aSearchOpt.AlgorithmType2 == css::util::SearchAlgorithms2::REGEXP));
- return m_aSearchOpt.algorithmType == css::util::SearchAlgorithms_REGEXP ;
+ return m_aSearchOpt.AlgorithmType2 == css::util::SearchAlgorithms2::REGEXP ;
+}
+
+bool SvxSearchItem::GetWildcard() const
+{
+ // Ensure old and new algorithm types are in sync, in this case old is not
+ // REGEXP or APPROXIMATE.
+ assert( (m_aSearchOpt.AlgorithmType2 == css::util::SearchAlgorithms2::WILDCARD) ?
+ (m_aSearchOpt.algorithmType != css::util::SearchAlgorithms_REGEXP &&
+ m_aSearchOpt.algorithmType != css::util::SearchAlgorithms_APPROXIMATE) : true );
+ return m_aSearchOpt.AlgorithmType2 == css::util::SearchAlgorithms2::WILDCARD ;
}
bool SvxSearchItem::IsLEVRelaxed() const
@@ -283,7 +296,7 @@ bool SvxSearchItem::IsLevenshtein() const
// adapted to use only new types.
assert( (m_aSearchOpt.algorithmType == css::util::SearchAlgorithms_APPROXIMATE) ==
(m_aSearchOpt.AlgorithmType2 == css::util::SearchAlgorithms2::APPROXIMATE));
- return m_aSearchOpt.algorithmType == css::util::SearchAlgorithms_APPROXIMATE;
+ return m_aSearchOpt.AlgorithmType2 == css::util::SearchAlgorithms2::APPROXIMATE;
}
const css::util::SearchOptions2 & SvxSearchItem::GetSearchOptions() const