From aac2be8ef9583ddccbb18ed281d7cf525ddb7b09 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 4 Jun 2015 17:47:44 +1000 Subject: Move FindText flag decoding from caller to function to minimize code and chance of mistakes. --- src/Document.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Document.cxx') 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); -- cgit v1.2.3