summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-02-03 17:00:51 +0530
committerpranavk <pranavk@collabora.co.uk>2017-02-06 03:42:44 +0000
commit5596b3f86f753b7ae0a262ccea84c6a61bdc9ca2 (patch)
tree6d124189d2b0b7c1e96638bd5263c95582e63830 /sw/source/uibase
parenta296a69c984b17cfbcd249cf6bdc191d08dff2a6 (diff)
lok: comments: emit add callback after layout finishes
Change-Id: Ie6eba244dd5eb78813185f8c7aceed841d05d48b Reviewed-on: https://gerrit.libreoffice.org/33877 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx27
1 files changed, 16 insertions, 11 deletions
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 5e07b2e123e8..4db1d62a2a19 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -355,17 +355,9 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
if (bEmpty && !mvPostItFields.empty())
PrepareView(true);
- // If LOK has disabled tiled annotations, emit annotation callbacks
- if (comphelper::LibreOfficeKit::isActive() && !comphelper::LibreOfficeKit::isTiledAnnotations())
- {
- CalcRects();
- Show();
-
- if (pItem && pItem->pPostIt)
- {
- lcl_CommentNotification(mpView, CommentNotificationType::Add, pItem, 0);
- }
- }
+ // True until the layout of this post it finishes
+ if (pItem)
+ pItem->bPendingLayout = true;
}
else
{
@@ -874,6 +866,19 @@ void SwPostItMgr::LayoutPostIts()
pPage->bScrollbar = false;
bUpdate = (bOldScrollbar != pPage->bScrollbar) || bUpdate;
}
+
+ for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i != aVisiblePostItList.end() ; ++i)
+ {
+ if (comphelper::LibreOfficeKit::isActive() && !comphelper::LibreOfficeKit::isTiledAnnotations())
+ {
+ if ((*i)->GetSidebarItem().bPendingLayout)
+ lcl_CommentNotification(mpView, CommentNotificationType::Add, &(*i)->GetSidebarItem(), 0);
+ }
+
+ // Layout for this post it finished now
+ (*i)->GetSidebarItem().bPendingLayout = false;
+ }
+
aVisiblePostItList.clear();
}
else