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-15 20:33:38 +0200
commit5914fae974875366026bb3b1245ef8bffeadd7d2 (patch)
treecdbafcce4ca71d0e2dded705d52e7ce5a35f4aca /sw
parent643ea4be9011131ab2bcb81077b5fd5e71abcb17 (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. Change-Id: I7a1c2a25182f628effa224fb82b5bcd71fdf35d4 Reviewed-on: https://gerrit.libreoffice.org/75638 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
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 0a0523cc8e4d..d5cd3932a513 100644
--- a/sw/inc/postithelper.hxx
+++ b/sw/inc/postithelper.hxx
@@ -56,6 +56,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()
@@ -66,6 +72,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 f613ae4187e7..35a88931ca0e 100644
--- a/sw/source/core/fields/postithelper.cxx
+++ b/sw/source/core/fields/postithelper.cxx
@@ -142,6 +142,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 e02420809b93..232bfd80c124 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -799,7 +799,8 @@ void SwAnnotationWin::SetPosAndSize()
if (bDisableMapMode)
EditWin().EnableMapMode(false);
- pTmpCursorForAnnotationTextRange->FillRects();
+ if (mrSidebarItem.maLayoutInfo.mPositionFromCommentAnchor)
+ pTmpCursorForAnnotationTextRange->FillRects();
if (bDisableMapMode)
EditWin().EnableMapMode();