From f8949079ef77dab309091a9c86f34f931af762a8 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 15 Jul 2024 17:41:10 +0200 Subject: [PATCH] Fix crash when attempting to search in selection that contains only math (cherry picked from commit cca68d0614269edfc256db82b3849afde4640dd7) --- src/lyxfind.cpp | 4 ++-- status.24x | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index aae8b30bff..f72169ae66 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -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()) { diff --git a/status.24x b/status.24x index 6414a40abb..aa1cc68f41 100644 --- a/status.24x +++ b/status.24x @@ -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. + -- 2.39.5