fdo#73606: Avoid calling MarkDataChanged() when nothing is selected.

MarkDataChanged() is quite expensive & in theory unnecessary when no
selection is present.

Change-Id: I6967b914735462403a77568010532b37a1d8f333
(cherry picked from commit 31533d47b24680f76e769949874d41f0fe27134f)
Reviewed-on: https://gerrit.libreoffice.org/7426
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>