]> git.lyx.org Git - features.git/commitdiff
Be a bit more careful about setting and restoring the last reference
authorRichard Heck <rgheck@lyx.org>
Sat, 18 Jun 2016 22:27:51 +0000 (18:27 -0400)
committerRichard Heck <rgheck@lyx.org>
Sat, 18 Jun 2016 22:27:51 +0000 (18:27 -0400)
when we go to and return from labels.

src/frontends/qt4/GuiRef.cpp

index 555ccce1a40a6a8aa094cc70b5f8b8feef4e7e6f..795736c7283048d72aa9442adaed2014332e5fb3 100644 (file)
@@ -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();
 }