From 3c8f3c934d3010e5ad4f0243b99371049f40d831 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Thu, 27 Oct 2011 13:58:53 +0000 Subject: [PATCH] branch: Fix a crash in adv F&R when a manual could not be loaded see r40027. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@40039 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/FindAndReplace.cpp | 9 ++++++++- status.20x | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/FindAndReplace.cpp b/src/frontends/qt4/FindAndReplace.cpp index 0801d4b664..9f7f567d21 100644 --- a/src/frontends/qt4/FindAndReplace.cpp +++ b/src/frontends/qt4/FindAndReplace.cpp @@ -305,6 +305,11 @@ bool FindAndReplaceWidget::findAndReplaceScope(FindAndReplaceOptions & opt, bool guiApp->currentView()->setBusy(true); } buf = theBufferList().getBuffer(fname); + if (!buf) { + view_.setBusy(false); + return false; + } + lyx::dispatch(FuncRequest(LFUN_BUFFER_SWITCH, buf->absFileName())); bv = view_.documentBufferView(); @@ -327,7 +332,9 @@ bool FindAndReplaceWidget::findAndReplaceScope(FindAndReplaceOptions & opt, bool // No match found in current buffer (however old selection might have been replaced) // select next buffer in scope, if any - bool prompt = nextPrevBuffer(buf, opt); + bool const prompt = nextPrevBuffer(buf, opt); + if (!buf) + break; if (prompt) { if (wrap_answer != -1) break; diff --git a/status.20x b/status.20x index 93c718a81d..7833ea4050 100644 --- a/status.20x +++ b/status.20x @@ -212,6 +212,9 @@ What's new * ADVANCED FIND AND REPLACE +- Fix a crash when searching in all manuals, but the manuals could + not be loaded. + * BUILD/INSTALLATION -- 2.39.5