Resolves fdo#81084 fdo#81696 fdo#80874 fdo#81010 : sort causes crash

Change-Id: I8fb9ec26bc549c264bfbf30177d720b20677b319
Reviewed-on: https://gerrit.libreoffice.org/11102
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>