commit 90ffcf41eb92ea69b7a9844711455b6130ee8c26
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Thu Sep 8 15:04:58 2016 +0200

    Sanitize Ref dialog validation.
    
    Fixes: #10376
---
 src/frontends/qt4/GuiRef.cpp |    7 +++++--
 status.22x                   |    2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp
index 549e3cc..0d21387 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);
 }
 
 
diff --git a/status.22x b/status.22x
index bc7b4a7..ea92658 100644
--- a/status.22x
+++ b/status.22x
@@ -42,6 +42,8 @@ What's new
 
 * USER INTERFACE
 
+- Fix logic of OK/Apply buttons in cross-references dialog (bug 10376).
+
 
 * INTERNALS
 

Reply via email to