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 () ...@@ -1286,20 +1286,30 @@ void FormFieldChoice::unselectAll ()
} }
void FormFieldChoice::deselectAll () { void FormFieldChoice::deselectAll () {
delete editedChoice;
editedChoice = NULL;
unselectAll(); unselectAll();
updateSelection(); updateSelection();
} }
void FormFieldChoice::toggle (int i) void FormFieldChoice::toggle (int i)
{ {
delete editedChoice;
editedChoice = NULL;
choices[i].selected = !choices[i].selected; choices[i].selected = !choices[i].selected;
updateSelection(); updateSelection();
} }
void FormFieldChoice::select (int i) void FormFieldChoice::select (int i)
{ {
delete editedChoice;
editedChoice = NULL;
if (!multiselect) if (!multiselect)
unselectAll(); unselectAll();
choices[i].selected = true; choices[i].selected = true;
updateSelection(); 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