From 0ea9ce5341bd6544d10fcf95521b1cecbd70aba3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 13 Aug 2004 19:19:24 +0000 Subject: [PATCH] fix bug #1562 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8908 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_hullinset.C | 18 ++++++++++-------- src/mathed/math_scriptinset.C | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index 232fa8ebdf..8741af399f 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -368,13 +368,12 @@ void MathHullInset::addPreview(lyx::graphics::PreviewLoader & ploader) const void MathHullInset::notifyCursorLeaves(LCursor & cur) { - if (RenderPreview::status() != LyXRC::PREVIEW_ON) - return; - - Buffer const & buffer = cur.buffer(); - string const snippet = latex_string(*this); - preview_->addPreview(snippet, buffer); - preview_->startLoading(buffer); + if (RenderPreview::status() == LyXRC::PREVIEW_ON) { + Buffer const & buffer = cur.buffer(); + string const snippet = latex_string(*this); + preview_->addPreview(snippet, buffer); + preview_->startLoading(buffer); + } } @@ -949,7 +948,10 @@ void MathHullInset::priv_dispatch(LCursor & cur, FuncRequest & cmd) pair const res = old_label.empty() ? Alert::askForText(_("Enter new label to insert:"), default_label) : Alert::askForText(_("Enter label:"), old_label); - new_label = lyx::support::trim(res.second); + if (res.first) + new_label = lyx::support::trim(res.second); + else + new_label = old_label; } if (!new_label.empty()) diff --git a/src/mathed/math_scriptinset.C b/src/mathed/math_scriptinset.C index dffd25c0c9..bb6cbe81e5 100644 --- a/src/mathed/math_scriptinset.C +++ b/src/mathed/math_scriptinset.C @@ -560,7 +560,7 @@ void MathScriptInset::notifyCursorLeaves(LCursor & cur) lyxerr << "MathScriptInset::notifyCursorLeaves: 1 " << cur << endl; // remove empty scripts if possible -if (0) { +if (1) { if (nargs() > 2 && cur.idx() == 2 && cell(2).empty()) { // must be a subscript... removeScript(false); -- 2.39.2