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>
This commit is contained in:
@@ -84,6 +84,7 @@ class SwSidebarWin : public vcl::Window
|
|||||||
inline const SwRect& GetAnchorRect() { return mAnchorRect; }
|
inline const SwRect& GetAnchorRect() { return mAnchorRect; }
|
||||||
inline const std::vector<basegfx::B2DRange>& GetAnnotationTextRanges() { return maAnnotationTextRanges; }
|
inline const std::vector<basegfx::B2DRange>& GetAnnotationTextRanges() { return maAnnotationTextRanges; }
|
||||||
SwEditWin& EditWin();
|
SwEditWin& EditWin();
|
||||||
|
inline SwSidebarItem& GetSidebarItem() { return mrSidebarItem; }
|
||||||
|
|
||||||
inline OutlinerView* GetOutlinerView() { return mpOutlinerView;}
|
inline OutlinerView* GetOutlinerView() { return mpOutlinerView;}
|
||||||
bool HasScrollbar() const;
|
bool HasScrollbar() const;
|
||||||
|
@@ -92,6 +92,7 @@ public:
|
|||||||
VclPtr<sw::sidebarwindows::SwSidebarWin> pPostIt;
|
VclPtr<sw::sidebarwindows::SwSidebarWin> pPostIt;
|
||||||
bool bShow;
|
bool bShow;
|
||||||
bool bFocus;
|
bool bFocus;
|
||||||
|
bool bPendingLayout;
|
||||||
|
|
||||||
SwPostItHelper::SwLayoutStatus mLayoutStatus;
|
SwPostItHelper::SwLayoutStatus mLayoutStatus;
|
||||||
SwLayoutInfo maLayoutInfo;
|
SwLayoutInfo maLayoutInfo;
|
||||||
@@ -100,6 +101,7 @@ public:
|
|||||||
: pPostIt(nullptr)
|
: pPostIt(nullptr)
|
||||||
, bShow(true)
|
, bShow(true)
|
||||||
, bFocus(aFocus)
|
, bFocus(aFocus)
|
||||||
|
, bPendingLayout(false)
|
||||||
, mLayoutStatus( SwPostItHelper::INVISIBLE )
|
, mLayoutStatus( SwPostItHelper::INVISIBLE )
|
||||||
, maLayoutInfo()
|
, maLayoutInfo()
|
||||||
{
|
{
|
||||||
|
@@ -355,17 +355,9 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
|
|||||||
if (bEmpty && !mvPostItFields.empty())
|
if (bEmpty && !mvPostItFields.empty())
|
||||||
PrepareView(true);
|
PrepareView(true);
|
||||||
|
|
||||||
// If LOK has disabled tiled annotations, emit annotation callbacks
|
// True until the layout of this post it finishes
|
||||||
if (comphelper::LibreOfficeKit::isActive() && !comphelper::LibreOfficeKit::isTiledAnnotations())
|
if (pItem)
|
||||||
{
|
pItem->bPendingLayout = true;
|
||||||
CalcRects();
|
|
||||||
Show();
|
|
||||||
|
|
||||||
if (pItem && pItem->pPostIt)
|
|
||||||
{
|
|
||||||
lcl_CommentNotification(mpView, CommentNotificationType::Add, pItem, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -874,6 +866,19 @@ void SwPostItMgr::LayoutPostIts()
|
|||||||
pPage->bScrollbar = false;
|
pPage->bScrollbar = false;
|
||||||
bUpdate = (bOldScrollbar != pPage->bScrollbar) || bUpdate;
|
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();
|
aVisiblePostItList.clear();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user