summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-09 09:49:36 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-10 06:05:09 +0000
commit7cf66202f233043fff2ece108e877e885bf99ace (patch)
tree1fea94539f7a31277398f43f0a47a79f713d07ec /include
parentconvert Orientation to scoped enum (diff)
downloadcore-7cf66202f233043fff2ece108e877e885bf99ace.tar.gz
core-7cf66202f233043fff2ece108e877e885bf99ace.zip
convert SearchParam::SearchType to scoped enum
and drop unused SRCH_LEVDIST enumerator Change-Id: Ic5118757060656562e04dd7da24a3f143abec3fb Reviewed-on: https://gerrit.libreoffice.org/34065 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/unotools/textsearch.hxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/include/unotools/textsearch.hxx b/include/unotools/textsearch.hxx
index 0a6185e66580..9efa5d2ead3d 100644
--- a/include/unotools/textsearch.hxx
+++ b/include/unotools/textsearch.hxx
@@ -47,9 +47,7 @@ namespace utl
class UNOTOOLS_DLLPUBLIC SearchParam
{
public:
- enum SearchType: int { SRCH_NORMAL, SRCH_REGEXP, SRCH_LEVDIST, SRCH_WILDCARD };
- // fix underlying type (as int, arbitrarily), so that
- // ScDocOptions::eSearchTypeUnknown = -1 does not cause -fsanitize=enum
+ enum class SearchType { Normal, Regexp, Wildcard, Unknown = -1 };
/** Convert configuration and document boolean settings to SearchType.
If bWildcard is true it takes precedence over rbRegExp.
@@ -63,9 +61,9 @@ public:
{
if (rbRegExp)
rbRegExp = false;
- return SRCH_WILDCARD;
+ return SearchType::Wildcard;
}
- return rbRegExp ? SRCH_REGEXP : SRCH_NORMAL;
+ return rbRegExp ? SearchType::Regexp : SearchType::Normal;
}
/** Convert SearchType to configuration and document boolean settings.
@@ -74,16 +72,15 @@ public:
{
switch (eSearchType)
{
- case SRCH_WILDCARD:
+ case SearchType::Wildcard:
rbWildcard = true;
rbRegExp = false;
break;
- case SRCH_REGEXP:
+ case SearchType::Regexp:
rbWildcard = false;
rbRegExp = true;
break;
default:
- // SRCH_LEVDIST is not a persistent setting.
rbWildcard = false;
rbRegExp = false;
break;