Resolves: fdo#73771 Non-standard behaviour for Function Mid

Change-Id: I90be516235228574dc219447a0eef3a34f83bee2
Reviewed-on: https://gerrit.libreoffice.org/7539
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit ff48f28f71609b0ab4e6b8bc79818f765e48fddd)
(cherry picked from commit 7713dfc9b50b88cf2548d49e65b099a6a81e9d65)
Reviewed-on: https://gerrit.libreoffice.org/7577
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>