sw: fix inconsistent bookmark behavior around at-char/as-char anchored frames
We have a placeholder character in the sw doc model for as-char anchored frames, so it's possible to have a bookmark before/after the frame or a non-collapsed bookmark which covers the frame. The same is not true for at-char anchored frames, where the anchor points to a doc model position, but there is no placeholder character. If a bookmark is created covering the start and end of the anchor of the frame, internally we create a collapsed bookmark which has the same position as the anchor of the frame. When this doc model is handled by SwXParagraph::createEnumeration(), first the frame and then the bookmark is appended to the text portion enumeration, so your bookmark around the frame is turned into a collapsed bookmark after the frame. (The same happens when we roundtrip an ODT document representing this doc model.) Fix the problem by inserting collapsed bookmarks with affected anchor positions (same position is the anchor for an at-char frame) into the enumeration in two stages: first the start of them before frames and then the end of them + other bookmarks. This way UNO API users get their non-collapsed bookmarks around at-char anchored frames, similar to as-char ones. Change-Id: Ic1f173c85d3824afabb5b7ebf3a8594311eb9007 Reviewed-on: https://gerrit.libreoffice.org/46889Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Showing
Please
register
or
sign in
to comment