kogmbh/WebODF — pull request #243 by adityab (2013-12-05 19:33:43+00:00)
Title: Make positioning around annotations more usable/realistic

This PR adds a new method `isInlineRoot` to `OdfUtils`.
This method checks if an element is an `` (or if in gui mode, a `div` with class `"annotationWrapper"`). Such elements are now treated as 'character elements' for positioning purposes, alongwith that already-similarly-treated frames with `"as-char"`.

With this change, I've allowed the cursor to step both to the left and right of an annotation, like in LibreOffice - this behavior is more natural as it affords more editing control. When the cursor is at the left of an annotation, and you trigger a single move to the right, the cursor visually seems to be in the same place, but in the DOM, it has stepped to the right of the annotation. This is how LO also does it.

However, there is one special case - when an annotation has a span or an `annotationHighlight` to it's right. In that situation, and in light of the aforementioned changes, moving to the right of the annotaiton would place the cursor *between* the annotation and the highlight, and you would be able to insert text in that area, which should be disallowed. Therefore, if a grouping element is immediately to the right of an annotaiton, you step directly into the grouping element instead of between both. For this, there is an extra check in `checkLeftRight` in the `TextPositionFilter`.

Appropriate tests have been added -- exposing the newly freed cursor position in `OdtDocumentTests`, and changing the positions of the `SplitParagraph` operations 1 step to the right after adding an `AddAnnotation`.

**Note**: This fix is absolutely required for the upcoming collab fixes for `SplitParagraph` vs `SplitParagaph`.