unit test for sort with sheet references and external references, fdo#77018

Change-Id: I4b60fe3f3594fbe13ae25ac29c8701d80870595e