Refactor NumRule handling in CopyImpl

The bug fix for i#86492 added a lot of duplicated code. This moves
the code into their own functions and uses macros to make the
resulting code even more readable.

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