summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-07-15 15:33:39 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-07-16 11:23:06 +0200
commit987829152557e34fbc4c7fc227fecf7ef20dac84 (patch)
treed49ad23d217af23870e6ca7f345e33c2670a32cb /sw
parentaabc93537712478db00fa96859b0227397922464 (diff)
sw comments on frames: avoid overlay that covers only an at-char image
The comment is already attached to the image via the anchor, and the overlay would change the image, which is confusing. (cherry picked from commit 5914fae974875366026bb3b1245ef8bffeadd7d2) Change-Id: I7a1c2a25182f628effa224fb82b5bcd71fdf35d4 Reviewed-on: https://gerrit.libreoffice.org/75685 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/postithelper.hxx7
-rw-r--r--sw/source/core/fields/postithelper.cxx1
-rw-r--r--sw/source/uibase/docvw/AnnotationWin2.cxx3
3 files changed, 10 insertions, 1 deletions
diff --git a/sw/inc/postithelper.hxx b/sw/inc/postithelper.hxx
index 1ac716d91e38..8bad2f19ae31 100644
--- a/sw/inc/postithelper.hxx
+++ b/sw/inc/postithelper.hxx
@@ -55,6 +55,12 @@ struct SwLayoutInfo
std::size_t mRedlineAuthor;
+ /**
+ * If true, the overlay arrow points to the comment anchor, otherwise it points to the commented
+ * frame.
+ */
+ bool mPositionFromCommentAnchor;
+
SwLayoutInfo()
: mpAnchorFrame(nullptr)
, mPosition()
@@ -65,6 +71,7 @@ struct SwLayoutInfo
, mnPageNumber(1)
, meSidebarPosition(sw::sidebarwindows::SidebarPosition::NONE)
, mRedlineAuthor(0)
+ , mPositionFromCommentAnchor(true)
{}
};
diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx
index 28db040ace8c..82e8531d4ad7 100644
--- a/sw/source/core/fields/postithelper.cxx
+++ b/sw/source/core/fields/postithelper.cxx
@@ -140,6 +140,7 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos(
{
pTextFrame->GetCharRect(o_rInfo.mPosition, rAnchorPos, nullptr, false);
}
+ o_rInfo.mPositionFromCommentAnchor = bPositionFromCommentAnchor;
}
if (pAnnotationMark != nullptr)
{
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index e7a76574bf22..a64a51b33781 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -793,7 +793,8 @@ void SwAnnotationWin::SetPosAndSize()
if (bDisableMapMode)
EditWin().EnableMapMode(false);
- pTmpCursorForAnnotationTextRange->FillRects();
+ if (mrSidebarItem.maLayoutInfo.mPositionFromCommentAnchor)
+ pTmpCursorForAnnotationTextRange->FillRects();
if (bDisableMapMode)
EditWin().EnableMapMode();