bug 470335: NPE when document is edited in other editor

This bug was caused by calling the ContentPosition constructor with a
null document. The same call was used in some other places that are also
fixed with this change.
There are also some additional tests.

Change-Id: Ife8841dff0e38e360b7da0dd26b15cb0169989d4
Signed-off-by: Carsten Hiesserich <carsten.hie@gmail.com>
4 files changed