Commit b593acf4 authored by ROOL's avatar ROOL 🤖
Browse files

Fix for being unable to change None and colour setting in a single call

Detail:
  SWI ColourPicker_UpdateDialogue allows the possibility of changing both colour and transparency state by setting bits 1 and 6 of the input flags.
  However, bit 6 has the side effect of using the Set_Values entry point which calls the colour changed model SWI which unsets the 'None' flag because the colour was set. Swap around the order of actioning the flags such that the colour is set before considering the new 'None' setting.
Admin:
  Discovered during Toolbox Unification bounty work.
parent 005d09c2
......@@ -1654,43 +1654,6 @@ os_error *dialogue_update (bits flags, colourpicker_d d,
goto finish;
}
if ((flags & colourpicker_UPDATE_OFFERS_TRANSPARENT) != NONE)
{ if ((dialogue->flags & colourpicker_DIALOGUE_OFFERS_TRANSPARENT) !=
NONE)
{ /*Add a None button to |d|.*/
if ((error = xwimp_set_icon_state (l->main_w, dialogue_PICKER_NONE,
NONE, wimp_ICON_SHADED)) != NULL)
goto finish;
/*Fix MED-xxxx: update record to reflect change. JRC 21st Dec 1994*/
l->flags |= colourpicker_DIALOGUE_OFFERS_TRANSPARENT;
}
else
{ /*Remove the None button from |d|. Deselect transparent, just in
case. (JRC 9th Dec 1994)*/
if ((error = xwimp_set_icon_state (l->main_w, dialogue_PICKER_NONE,
wimp_ICON_SHADED, wimp_ICON_SHADED | wimp_ICON_SELECTED)) !=
NULL)
goto finish;
/*Fix MED-xxxx: update record to reflect change. JRC 21st Dec 1994*/
l->flags &= ~colourpicker_DIALOGUE_OFFERS_TRANSPARENT;
} }
if ((flags & colourpicker_UPDATE_TRANSPARENT) != NONE)
{ osbool none = (dialogue->flags & colourpicker_DIALOGUE_TRANSPARENT) !=
NONE;
/*Set the dialogue box.*/
if ((error = xwimp_set_icon_state (l->main_w, dialogue_PICKER_NONE,
none? wimp_ICON_SELECTED: NONE, wimp_ICON_SELECTED)) != NULL)
goto finish;
/*Send the relevant message.*/
if ((error = Colour_Changed (l, none, /*dragging?*/ FALSE)) != NULL)
goto finish;
}
if ((flags & colourpicker_UPDATE_TYPE) != NONE)
/*Change the message type of |d| from |dialogue|.*/
l->flags = (l->flags & ~colourpicker_DIALOGUE_TYPE) |
......@@ -1803,6 +1766,43 @@ os_error *dialogue_update (bits flags, colourpicker_d d,
goto finish;
}
if ((flags & colourpicker_UPDATE_OFFERS_TRANSPARENT) != NONE)
{ if ((dialogue->flags & colourpicker_DIALOGUE_OFFERS_TRANSPARENT) !=
NONE)
{ /*Add a None button to |d|.*/
if ((error = xwimp_set_icon_state (l->main_w, dialogue_PICKER_NONE,
NONE, wimp_ICON_SHADED)) != NULL)
goto finish;
/*Fix MED-xxxx: update record to reflect change. JRC 21st Dec 1994*/
l->flags |= colourpicker_DIALOGUE_OFFERS_TRANSPARENT;
}
else
{ /*Remove the None button from |d|. Deselect transparent, just in
case. (JRC 9th Dec 1994)*/
if ((error = xwimp_set_icon_state (l->main_w, dialogue_PICKER_NONE,
wimp_ICON_SHADED, wimp_ICON_SHADED | wimp_ICON_SELECTED)) !=
NULL)
goto finish;
/*Fix MED-xxxx: update record to reflect change. JRC 21st Dec 1994*/
l->flags &= ~colourpicker_DIALOGUE_OFFERS_TRANSPARENT;
} }
if ((flags & colourpicker_UPDATE_TRANSPARENT) != NONE)
{ osbool none = (dialogue->flags & colourpicker_DIALOGUE_TRANSPARENT) !=
NONE;
/*Set the dialogue box.*/
if ((error = xwimp_set_icon_state (l->main_w, dialogue_PICKER_NONE,
none? wimp_ICON_SELECTED: NONE, wimp_ICON_SELECTED)) != NULL)
goto finish;
/*Send the relevant message.*/
if ((error = Colour_Changed (l, none, /*dragging?*/ FALSE)) != NULL)
goto finish;
}
if ((flags & colourpicker_UPDATE_IGNORE_HELP) != NONE)
/*Change the ignore help bit.*/
l->flags = (l->flags & ~colourpicker_DIALOGUE_IGNORE_HELP) |
......
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