This diff is a response to T40085.
Current behaviour when multiple objects are highlighted in the outline editor and 'S' is pressed to toggle selectability is that each object's selectability is toggled individually. E.g. 4 objects are highlighted, 3 selectable and 1 with restricted selectability, pressing 'S' to toggle selectability will end up with 3 objects with restricted selectability and 1 selectable.
The improved behaviour causes the objects to be toggled as one. If any of the highlighted objects has restricted selectability ans 'S' is pressed then all objects become selectable, else all object get restricted selectability.
The same rule applies to 'V' visibility and 'R' renderability.
To check if any highlighted object has restricted selectability, visibility or renderability I've added a function:
bool outliner_do_object_query_any_true(...)'.
The restrict flags of highlighted objects are set or cleared depending on the result from this function.