diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-07-16 12:17:01 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-07-16 17:43:58 +0200 |
commit | 3fb7ffeb85d87551ffcddd63b7c90c6b0e573e5f (patch) | |
tree | c675da0ba0229301587f839eca429d61b91bc3ad /sw/source | |
parent | 64fbc0e44d98614d25c81428ec024e36ce27c573 (diff) |
sw comments on frames: avoid overlay that covers only an as-char image
As-char images had their comment arrow on the bottom left corner,
as-char ones had it at the bottom right one.
Standardize on bottom left and avoid the content overlay in case only
the frame itself is selected.
See commit cf5a3cb687a502e7f71cefb5f7001a73925bee56 (Adapt new test to
actual values observed on macOS, 2019-06-24) on why the test is not for
macOS, till somebody can check if this is working there properly.
Change-Id: I83516ea558182ecc7362f8383894ed07a16d3ad2
Reviewed-on: https://gerrit.libreoffice.org/75706
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/fields/postithelper.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx index 35a88931ca0e..c650ef634492 100644 --- a/sw/source/core/fields/postithelper.cxx +++ b/sw/source/core/fields/postithelper.cxx @@ -60,7 +60,22 @@ bool AnnotationMarkCoversCommentAnchor(const sw::mark::IMark* pAnnotationMark, if (rMarkStart != rAnchorPos) { - return false; + // This can be the as-char case: the comment placeholder character is exactly between the + // annotation mark start and end. + SwPosition aPosition(rMarkStart); + ++aPosition.nContent; + if (aPosition != rAnchorPos) + { + return false; + } + + ++aPosition.nContent; + if (aPosition != rMarkEnd) + { + return false; + } + + return true; } if (rMarkStart.nNode != rMarkEnd.nNode) |