Commit f3f5a166 authored by Fabio D'Urso's avatar Fabio D'Urso Committed by Albert Astals Cid
Browse files

Editable FormFieldChoice: Clear editedChoice when one of the predefined option is selected

This patch clears the user-entered text when the user interacts with
predefined options.
parent ddcd5dc0
......@@ -1286,20 +1286,30 @@ void FormFieldChoice::unselectAll ()
}
void FormFieldChoice::deselectAll () {
delete editedChoice;
editedChoice = NULL;
unselectAll();
updateSelection();
}
void FormFieldChoice::toggle (int i)
{
delete editedChoice;
editedChoice = NULL;
choices[i].selected = !choices[i].selected;
updateSelection();
}
void FormFieldChoice::select (int i)
{
delete editedChoice;
editedChoice = NULL;
if (!multiselect)
unselectAll();
choices[i].selected = true;
updateSelection();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment