Consider case (in)sensitivity when querying special char insets

This commit is contained in:
Juergen Spitzmueller 2021-02-17 15:50:54 +01:00
parent ca160da07d
commit ab1cc8e1c2

View File

@ -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;
}