Skip to content

Commit

Permalink
fix: Wrong case sensitive config
Browse files Browse the repository at this point in the history
Change the setting when case sensitive.
调整区分大小写配置时的设置

Log: 修复错误的匹配大小写判断设置
Bug: https://pms.uniontech.com/bug-view-262733.html
  • Loading branch information
rb-union committed Jul 3, 2024
1 parent a754c7b commit 1b632cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/editor/dtextedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1875,7 +1875,7 @@ bool TextEdit::findKeywordForward(const QString &keyword)

QTextDocument::FindFlags options;
if (Qt::CaseSensitive == defaultCaseSensitive) {
options &= QTextDocument::FindCaseSensitively;
options |= QTextDocument::FindCaseSensitively;
}
bool foundOne = find(keyword, options);

Expand All @@ -1893,7 +1893,7 @@ bool TextEdit::findKeywordForward(const QString &keyword)

QTextDocument::FindFlags options;
if (Qt::CaseSensitive == defaultCaseSensitive) {
options &= QTextDocument::FindCaseSensitively;
options |= QTextDocument::FindCaseSensitively;
}
bool foundOne = find(keyword, options);

Expand Down Expand Up @@ -2098,7 +2098,7 @@ bool TextEdit::searchKeywordSeletion(QString keyword, QTextCursor cursor, bool f
if (findNext) {
QTextDocument::FindFlags options;
if (Qt::CaseSensitive == defaultCaseSensitive) {
options &= QTextDocument::FindCaseSensitively;
options |= QTextDocument::FindCaseSensitively;
}

QTextCursor next = document()->find(keyword, cursor, options);
Expand All @@ -2115,7 +2115,7 @@ bool TextEdit::searchKeywordSeletion(QString keyword, QTextCursor cursor, bool f
} else {
QTextDocument::FindFlags options = QTextDocument::FindBackward;
if (Qt::CaseSensitive == defaultCaseSensitive) {
options &= QTextDocument::FindCaseSensitively;
options |= QTextDocument::FindCaseSensitively;
}

QTextCursor prev = document()->find(keyword, cursor, options);
Expand Down

0 comments on commit 1b632cb

Please sign in to comment.