If text is in edit mode, deactivate it before changing the tool

[#73648682]