Fix char offset calculations
When dealing with multi-paragraph layouts, the char offsets of the items are expected to be relative to the beginning of the text, not relative to the beginning of the current paragraph.
This error was introduced in a03bf5bc.
Fixes: #716 (closed)