]> git.lyx.org Git - features.git/blobdiff - src/Paragraph.cpp
Consider inset strings in simple find/replaceAll (#12049)
[features.git] / src / Paragraph.cpp
index 8181b1c4b6a34c34a6233350ef739e8bca657f8d..994098df484582bb48e876138917566a2bf2ac11 100644 (file)
@@ -4403,8 +4403,13 @@ int Paragraph::find(docstring const & str, bool cs, bool mw,
                                break;
                        odocstringstream os;
                        inset->toString(os);
-                       if (!os.str().empty())
-                               break;
+                       if (!os.str().empty()) {
+                               int const insetstringsize = os.str().length();
+                               for (int j = 0; j < insetstringsize && pos < parsize; ++i, ++j) {
+                                       if (str[i] != os.str()[j])
+                                               break;
+                               }
+                       }
                        pos++;
                }
                if (cs && str[i] != d->text_[pos])