diff options
-rw-r--r-- | src/Document.cxx | 7 | ||||
-rw-r--r-- | src/Document.h | 3 | ||||
-rw-r--r-- | src/Editor.cxx | 16 |
3 files changed, 6 insertions, 20 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); diff --git a/src/Document.h b/src/Document.h index 5e66dc2b6..923462e7a 100644 --- a/src/Document.h +++ b/src/Document.h @@ -384,8 +384,7 @@ public: bool MatchesWordOptions(bool word, bool wordStart, int pos, int length) const; bool HasCaseFolder(void) const; void SetCaseFolder(CaseFolder *pcf_); - long FindText(int minPos, int maxPos, const char *search, bool caseSensitive, bool word, - bool wordStart, bool regExp, int flags, int *length); + long FindText(int minPos, int maxPos, const char *search, int flags, int *length); const char *SubstituteByPosition(const char *text, int *length); int LinesTotal() const; diff --git a/src/Editor.cxx b/src/Editor.cxx index 77d9ce5e7..ce465808c 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3643,10 +3643,6 @@ long Editor::FindText( static_cast<int>(ft->chrg.cpMin), static_cast<int>(ft->chrg.cpMax), ft->lpstrText, - (wParam & SCFIND_MATCHCASE) != 0, - (wParam & SCFIND_WHOLEWORD) != 0, - (wParam & SCFIND_WORDSTART) != 0, - (wParam & SCFIND_REGEXP) != 0, static_cast<int>(wParam), &lengthFound); if (pos != -1) { @@ -3694,18 +3690,10 @@ long Editor::SearchText( try { if (iMessage == SCI_SEARCHNEXT) { pos = pdoc->FindText(searchAnchor, pdoc->Length(), txt, - (wParam & SCFIND_MATCHCASE) != 0, - (wParam & SCFIND_WHOLEWORD) != 0, - (wParam & SCFIND_WORDSTART) != 0, - (wParam & SCFIND_REGEXP) != 0, static_cast<int>(wParam), &lengthFound); } else { pos = pdoc->FindText(searchAnchor, 0, txt, - (wParam & SCFIND_MATCHCASE) != 0, - (wParam & SCFIND_WHOLEWORD) != 0, - (wParam & SCFIND_WORDSTART) != 0, - (wParam & SCFIND_REGEXP) != 0, static_cast<int>(wParam), &lengthFound); } @@ -3748,10 +3736,6 @@ long Editor::SearchInTarget(const char *text, int length) { pdoc->SetCaseFolder(CaseFolderForEncoding()); try { long pos = pdoc->FindText(targetStart, targetEnd, text, - (searchFlags & SCFIND_MATCHCASE) != 0, - (searchFlags & SCFIND_WHOLEWORD) != 0, - (searchFlags & SCFIND_WORDSTART) != 0, - (searchFlags & SCFIND_REGEXP) != 0, searchFlags, &lengthFound); if (pos != -1) { |