]> git.lyx.org Git - lyx.git/commitdiff
Sanitize Ref dialog validation.
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 8 Sep 2016 13:04:58 +0000 (15:04 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 16 Oct 2016 09:49:06 +0000 (11:49 +0200)
Fixes: #10376
src/frontends/qt4/GuiRef.cpp
status.22x

index 549e3ccbc62bd6294522045febe0dbe68ba9ac4f..0d213874e3ac923bb49e4b4488598ead137ed357 100644 (file)
@@ -251,7 +251,8 @@ void GuiRef::updateContents()
        nameL->setHidden(!nameAllowed());
 
        // restore type settings for new insets
-       if (params_["reference"].empty())
+       bool const new_inset = params_["reference"].empty();
+       if (new_inset)
                typeCO->setCurrentIndex(orig_type);
        else
                typeCO->setCurrentIndex(InsetRef::getType(params_.getCmdName()));
@@ -281,7 +282,9 @@ void GuiRef::updateContents()
        active_buffer_ = thebuffer;
 
        updateRefs();
-       bc().setValid(false);
+       // Activate OK/Apply buttons if the users inserts a new ref
+       // and we have a valid pre-setting.
+       bc().setValid(isValid() && new_inset);
 }
 
 
index bc7b4a72a2475125624d3e5b87ec91ab1f29b994..ea926585a75adb7e8333d897225179d0e6cf9047 100644 (file)
@@ -42,6 +42,8 @@ What's new
 
 * USER INTERFACE
 
+- Fix logic of OK/Apply buttons in cross-references dialog (bug 10376).
+
 
 * INTERNALS