]> git.lyx.org Git - lyx.git/commitdiff
Fix crash when attempting to search in selection that contains only math
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 15 Jul 2024 15:41:10 +0000 (17:41 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 15 Jul 2024 16:22:13 +0000 (18:22 +0200)
(cherry picked from commit cca68d0614269edfc256db82b3849afde4640dd7)

src/lyxfind.cpp
status.24x

index aae8b30bffaf691032e578537500da528f1a3822..f72169ae665ab9118a494529141cc940076b2b21 100644 (file)
@@ -240,7 +240,7 @@ int findForward(DocIterator & cur, DocIterator const endcur,
                bool find_del = true, bool onlysel = false)
 {
        for (; cur; cur.forwardChar()) {
-               if (onlysel && endcur.pit() == cur.pit()
+               if (onlysel && cur.inTexted() && endcur.pit() == cur.pit()
                    && endcur.idx() == cur.idx() && endcur.pos() < cur.pos())
                        break;
                if (cur.inTexted()) {
@@ -259,7 +259,7 @@ int findBackwards(DocIterator & cur, DocIterator const endcur,
 {
        while (cur) {
                cur.backwardChar();
-               if (onlysel && endcur.pit() == cur.pit()
+               if (onlysel && cur.inTexted() && endcur.pit() == cur.pit()
                    && endcur.idx() == cur.idx() && endcur.pos() > cur.pos())
                        break;
                if (cur.inTexted()) {
index 6414a40abb949f614ab34d8711e281c42c0c6b1d..aa1cc68f416753f08518ee6767c5694f80e58432 100644 (file)
@@ -49,6 +49,8 @@ What's new
 
 * USER INTERFACE
 
+- Fix crash when attempting to search in selection that contains only math.
+
 - Fix bug where the dialog asking for saving unapplied changes on buffer change
   popped up twice, or sometimes not at all (bug 12954).
 
@@ -87,3 +89,4 @@ What's new
 * BUILD/INSTALLATION
 
 - Fix 'make install' target for autotools builds with autoconf >= 2.72.
+