Sanitize Ref dialog validation.

Fixes: #10376
This commit is contained in:
Juergen Spitzmueller 2016-09-08 15:04:58 +02:00
parent 46c2e2b5d6
commit 90ffcf41eb
2 changed files with 7 additions and 2 deletions

View File

@ -251,7 +251,8 @@ void GuiRef::updateContents()
nameL->setHidden(!nameAllowed()); nameL->setHidden(!nameAllowed());
// restore type settings for new insets // restore type settings for new insets
if (params_["reference"].empty()) bool const new_inset = params_["reference"].empty();
if (new_inset)
typeCO->setCurrentIndex(orig_type); typeCO->setCurrentIndex(orig_type);
else else
typeCO->setCurrentIndex(InsetRef::getType(params_.getCmdName())); typeCO->setCurrentIndex(InsetRef::getType(params_.getCmdName()));
@ -281,7 +282,9 @@ void GuiRef::updateContents()
active_buffer_ = thebuffer; active_buffer_ = thebuffer;
updateRefs(); 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);
} }

View File

@ -42,6 +42,8 @@ What's new
* USER INTERFACE * USER INTERFACE
- Fix logic of OK/Apply buttons in cross-references dialog (bug 10376).
* INTERNALS * INTERNALS