Related: fdo#84846 move code setting edit mode to a new method

First change in series to fix fdo#84846.

Change-Id: I52dc333c2caa30ee3c75d9cc80862cf24a204f93
Reviewed-on: https://gerrit.libreoffice.org/12148
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>