TextEditors: remove unnecessary cast

Change-Id: I7c2dc83143aab2c2c0e16736dd26c53c75de024a
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
TextEditors: Make function static

Change-Id: I4297651458f6efb28a3bbeb83b4c038956d64305
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
TextEditors: Move document related function to document

Change-Id: I9d0abacbd1b503390164934a1b833fd305ae3fbe
Reviewed-by: Eike Ziller <eike.ziller@digia.com>