fdo#74857: Update the incrementer when skipping over hidden regions.

Otherwise it would over-shoot.

Change-Id: I1f9741345dfe353e0b035ff3bead736ab3fccbef
(cherry picked from commit 637353bb46d3c7d9537e47e4e003aef78a0c0ab3)
Reviewed-on: https://gerrit.libreoffice.org/8117
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
(cherry picked from commit 793c2b2b3ac8c8e74ccdfc6876ce47e5039fb65a)
Reviewed-on: https://gerrit.libreoffice.org/8131
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>