diff options
author | Neil <nyamatongwe@gmail.com> | 2015-06-04 17:47:44 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2015-06-04 17:47:44 +1000 |
commit | 0c48f964dfc4ddeb4e7ff883e5885719724c76bd (patch) | |
tree | 863822c21cc6f8e691e436c482b63e4c1a95c8c1 /src/Document.cxx | |
parent | 8b117752e15d550ed93a3cbce9786b0df48ae49a (diff) | |
download | scintilla-mirror-0c48f964dfc4ddeb4e7ff883e5885719724c76bd.tar.gz |
Move FindText flag decoding from caller to function to minimize code and chance
of mistakes.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 3f365fdf4..3065b1828 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -1646,10 +1646,13 @@ Document::CharacterExtracted Document::ExtractCharacter(int position) const { * Has not been tested with backwards DBCS searches yet. */ long Document::FindText(int minPos, int maxPos, const char *search, - bool caseSensitive, bool word, bool wordStart, bool regExp, int flags, - int *length) { + int flags, int *length) { if (*length <= 0) return minPos; + const bool caseSensitive = (flags & SCFIND_MATCHCASE) != 0; + const bool word = (flags & SCFIND_WHOLEWORD) != 0; + const bool wordStart = (flags & SCFIND_WORDSTART) != 0; + const bool regExp = (flags & SCFIND_REGEXP) != 0; if (regExp) { if (!regex) regex = CreateRegexSearch(&charClass); |