Refactor text retrieval of the code paster plugin.

Try to obtain text via ITextEditorDocument.

Task-number: QTCREATORBUG-9669
Change-Id: Ie3816d84ea715691256f757fdd9a7b666fb6c27c
Reviewed-by: Eike Ziller <eike.ziller@digia.com>