[LyX/master] Consider case (in)sensitivity when querying special char insets
Juergen Spitzmueller
spitz at lyx.org
Wed Feb 17 14:47:54 UTC 2021
commit ab1cc8e1c2ab05819e3f86e6cf989e1bf312ac18
Author: Juergen Spitzmueller <spitz at lyx.org>
Date: Wed Feb 17 15:50:54 2021 +0100
Consider case (in)sensitivity when querying special char insets
---
src/Paragraph.cpp | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 7b0120a..aca858c 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -4502,10 +4502,12 @@ int Paragraph::find(docstring const & str, bool cs, bool mw,
break;
odocstringstream os;
inset->toString(os);
- if (!os.str().empty()) {
- int const insetstringsize = os.str().length();
+ docstring const insetstring = os.str();
+ if (!insetstring.empty()) {
+ int const insetstringsize = insetstring.length();
for (int j = 0; j < insetstringsize && pos < parsize; ++i, ++j) {
- if (str[i] != os.str()[j]) {
+ if ((cs && str[i] != insetstring[j])
+ || (!cs && uppercase(str[i]) != uppercase(insetstring[j]))) {
nonmatch = true;
break;
}
More information about the lyx-cvs
mailing list