From: Richard Heck Date: Sat, 18 Jun 2016 22:27:51 +0000 (-0400) Subject: Be a bit more careful about setting and restoring the last reference X-Git-Tag: 2.2.1~109 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c503804eeb9e2606d095f8a7e260d7a3f18c9c9d;p=features.git Be a bit more careful about setting and restoring the last reference when we go to and return from labels. (cherry picked from commit 68b60ec529db2e7bfe642bd09902824ea69e2fb5) --- diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp index 555ccce1a4..795736c728 100644 --- a/src/frontends/qt4/GuiRef.cpp +++ b/src/frontends/qt4/GuiRef.cpp @@ -118,9 +118,12 @@ void GuiRef::gotoClicked() // to which we are going (or from which we are returning) is // restored in the dialog. It's a bit of a hack, but it works, // and no-one seems to have any better idea. - last_reference_ = referenceED->text(); + bool const toggled = last_reference_.empty(); + if (toggled) + last_reference_ = referenceED->text(); gotoRef(); - last_reference_.clear(); + if (toggled) + last_reference_.clear(); }