fdo#80908 - avoid lots of alloc/free of common integer values.

Change-Id: Ie170d44af062ec8c8b412b7de271e96a106971aa
Reviewed-on: https://gerrit.libreoffice.org/10559
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>