summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-02-03 17:02:26 +0530
committerAndras Timar <andras.timar@collabora.com>2017-02-18 00:53:21 +0100
commit66e1a0d65adc373c148f57d386500602a8d25bc4 (patch)
treeafdef5ef27238ed0b0f230abab67b658121aec3a /sw
parentcff06958fbd04f546d2448b2b6f54c6f66e6f06a (diff)
lok: Emit modify comment callback when anchor changes
Change-Id: Ibe4a66b93768eb446a04cab8cfdd4bdebee13d1f Reviewed-on: https://gerrit.libreoffice.org/33878 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk> (cherry picked from commit a51faf9ead8ab3797e9a70bf2e487f26643ce9d0)
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/SidebarWin.hxx3
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx5
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx3
3 files changed, 11 insertions, 0 deletions
diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx
index de109fb4b5c4..af4e5a41d4dc 100644
--- a/sw/inc/SidebarWin.hxx
+++ b/sw/inc/SidebarWin.hxx
@@ -82,6 +82,8 @@ class SwSidebarWin : public vcl::Window
inline Point GetAnchorPos() { return mAnchorRect.Pos(); }
inline const SwRect& GetAnchorRect() { return mAnchorRect; }
+ inline bool IsAnchorRectChanged() { return mbAnchorRectChanged; }
+ inline void ResetAnchorRectChanged() { mbAnchorRectChanged = false; }
inline const std::vector<basegfx::B2DRange>& GetAnnotationTextRanges() { return maAnnotationTextRanges; }
SwEditWin& EditWin();
inline SwSidebarItem& GetSidebarItem() { return mrSidebarItem; }
@@ -243,6 +245,7 @@ class SwSidebarWin : public vcl::Window
Rectangle mPosSize;
SwRect mAnchorRect;
long mPageBorder;
+ bool mbAnchorRectChanged;
std::vector<basegfx::B2DRange> maAnnotationTextRanges;
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 3c87288e1bc3..61a4d0e56a1f 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -874,6 +874,11 @@ void SwPostItMgr::LayoutPostIts()
{
if ((*i)->GetSidebarItem().bPendingLayout)
lcl_CommentNotification(mpView, CommentNotificationType::Add, &(*i)->GetSidebarItem(), 0);
+ else if ((*i)->IsAnchorRectChanged())
+ {
+ lcl_CommentNotification(mpView, CommentNotificationType::Modify, &(*i)->GetSidebarItem(), 0);
+ (*i)->ResetAnchorRectChanged();
+ }
}
// Layout for this post it finished now
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index e4eb830309c4..beae53206353 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -183,6 +183,7 @@ SwSidebarWin::SwSidebarWin(SwEditWin& rEditWin,
, mPosSize()
, mAnchorRect()
, mPageBorder(0)
+ , mbAnchorRectChanged(false)
, mbMouseOver(false)
, mLayoutStatus(SwPostItHelper::INVISIBLE)
, mbReadonly(false)
@@ -509,6 +510,8 @@ void SwSidebarWin::SetPosSizePixelRect(long nX, long nY, long nWidth, long nHeig
const SwRect& aAnchorRect, const long aPageBorder)
{
mPosSize = Rectangle(Point(nX,nY),Size(nWidth,nHeight));
+ if (!mAnchorRect.IsEmpty() && mAnchorRect != aAnchorRect)
+ mbAnchorRectChanged = true;
mAnchorRect = aAnchorRect;
mPageBorder = aPageBorder;
}