From: Juergen Spitzmueller Date: Thu, 8 Sep 2016 13:04:58 +0000 (+0200) Subject: Sanitize Ref dialog validation. X-Git-Tag: 2.3.0alpha1~1058 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b95262f487726e1c716698e8ad3ff8a1c125ec9e;p=lyx.git Sanitize Ref dialog validation. Fixes: #10376 --- diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp index 549e3ccbc6..0d213874e3 100644 --- a/src/frontends/qt4/GuiRef.cpp +++ b/src/frontends/qt4/GuiRef.cpp @@ -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); }