aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2015-06-04 17:47:44 +1000
committerNeil <nyamatongwe@gmail.com>2015-06-04 17:47:44 +1000
commitaac2be8ef9583ddccbb18ed281d7cf525ddb7b09 (patch)
treefb0c89a566986914229873b14550812da53dcde2 /src/Document.cxx
parent0701b3c87a62d2a9413b5330b7f01d69d0ba91b3 (diff)
downloadscintilla-mirror-aac2be8ef9583ddccbb18ed281d7cf525ddb7b09.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.cxx7
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);