resolved fdo#79441 keep 3D references intact during sort

Change-Id: I9e96d8e7cb99a3c280dd24495eefb9efd6d10888
(cherry picked from commit e463de2a56453a0d2cb0b5b58e96f7639f37cdd1)
Reviewed-on: https://gerrit.libreoffice.org/10240
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Tested-by: Kohei Yoshida <libreoffice@kohei.us>