pages with equal Priority and Class getting dropped

Change-Id: Ib053dc4b6e5fb5f01f48c71a4b295a53c0ec6715
(cherry picked from commit 9790588da4b2de455ffc7a2cc69f26539823c3da)
(cherry picked from commit be366ad7690b190c5ef4dc42311a4df6b7dcce4b)
Reviewed-on: https://gerrit.libreoffice.org/7054
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>