use isEmpty() instead of getLength() where appropriate

Change-Id: I87bb3473af631dc321c5a8c2b06b0b5ccdf8e73b
Reviewed-on: https://gerrit.libreoffice.org/11813
Reviewed-by: Christina Roßmanith <ChrRossmanith@web.de>
Tested-by: Christina Roßmanith <ChrRossmanith@web.de>