From e08e5615c96e4f709871e061b5a4f21333b8f139 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 13 Jun 2016 14:10:47 +0200 Subject: sw comments: implement per-view LOK_CALLBACK_INVALIDATE_TILES After registration and invalidation is handled per-view, the scrollbar and the text control of the comments is rendered correctly. Change-Id: I5cfa8b43fdc3a2ce7a008269b0283ee25d141440 Reviewed-on: https://gerrit.libreoffice.org/26218 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- sw/source/uibase/docvw/SidebarScrollBar.cxx | 6 +++++- sw/source/uibase/docvw/SidebarTxtControl.cxx | 5 ++++- sw/source/uibase/docvw/SidebarWin.cxx | 9 +++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) (limited to 'sw/source/uibase') diff --git a/sw/source/uibase/docvw/SidebarScrollBar.cxx b/sw/source/uibase/docvw/SidebarScrollBar.cxx index 7ad9b935172c..86ca488d9a11 100644 --- a/sw/source/uibase/docvw/SidebarScrollBar.cxx +++ b/sw/source/uibase/docvw/SidebarScrollBar.cxx @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -56,7 +57,10 @@ void SidebarScrollBar::LogicInvalidate(const Rectangle* pRectangle) OString sRectangle = aRectangle.toString(); SwWrtShell& rWrtShell = m_rView.GetWrtShell(); - rWrtShell.libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); + if (comphelper::LibreOfficeKit::isViewCallback()) + rWrtShell.GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); + else + rWrtShell.libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); } void SidebarScrollBar::MouseButtonUp(const MouseEvent& /*rMouseEvent*/) diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx index 4ffe03108ad0..9ecfeaeebe26 100644 --- a/sw/source/uibase/docvw/SidebarTxtControl.cxx +++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx @@ -213,7 +213,10 @@ void SidebarTextControl::LogicInvalidate(const Rectangle* pRectangle) OString sRectangle = aRectangle.toString(); SwWrtShell& rWrtShell = mrDocView.GetWrtShell(); - rWrtShell.libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); + if (comphelper::LibreOfficeKit::isViewCallback()) + rWrtShell.GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); + else + rWrtShell.libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); } void SidebarTextControl::KeyInput( const KeyEvent& rKeyEvt ) diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx index d495b2e15f1f..60c78b80dcad 100644 --- a/sw/source/uibase/docvw/SidebarWin.cxx +++ b/sw/source/uibase/docvw/SidebarWin.cxx @@ -614,8 +614,13 @@ void SwSidebarWin::InitControls() if (comphelper::LibreOfficeKit::isActive()) { // If there is a callback already registered, inform the new outliner view about it. - SwDrawModel* pDrawModel = mrView.GetWrtShellPtr()->getIDocumentDrawModelAccess().GetDrawModel(); - mpOutlinerView->registerLibreOfficeKitCallback(pDrawModel); + if (comphelper::LibreOfficeKit::isViewCallback()) + mpOutlinerView->registerLibreOfficeKitViewCallback(&mrView); + else + { + SwDrawModel* pDrawModel = mrView.GetWrtShellPtr()->getIDocumentDrawModelAccess().GetDrawModel(); + mpOutlinerView->registerLibreOfficeKitCallback(pDrawModel); + } } //create Scrollbars -- cgit