Kaydet (Commit) e08e5615 authored tarafından Miklos Vajna's avatar Miklos Vajna

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/26218Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst e11f90fb
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <SidebarScrollBar.hxx> #include <SidebarScrollBar.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <comphelper/lok.hxx>
#include <SidebarWin.hxx> #include <SidebarWin.hxx>
#include <view.hxx> #include <view.hxx>
...@@ -56,7 +57,10 @@ void SidebarScrollBar::LogicInvalidate(const Rectangle* pRectangle) ...@@ -56,7 +57,10 @@ void SidebarScrollBar::LogicInvalidate(const Rectangle* pRectangle)
OString sRectangle = aRectangle.toString(); OString sRectangle = aRectangle.toString();
SwWrtShell& rWrtShell = m_rView.GetWrtShell(); 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*/) void SidebarScrollBar::MouseButtonUp(const MouseEvent& /*rMouseEvent*/)
......
...@@ -213,7 +213,10 @@ void SidebarTextControl::LogicInvalidate(const Rectangle* pRectangle) ...@@ -213,7 +213,10 @@ void SidebarTextControl::LogicInvalidate(const Rectangle* pRectangle)
OString sRectangle = aRectangle.toString(); OString sRectangle = aRectangle.toString();
SwWrtShell& rWrtShell = mrDocView.GetWrtShell(); 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 ) void SidebarTextControl::KeyInput( const KeyEvent& rKeyEvt )
......
...@@ -614,8 +614,13 @@ void SwSidebarWin::InitControls() ...@@ -614,8 +614,13 @@ void SwSidebarWin::InitControls()
if (comphelper::LibreOfficeKit::isActive()) if (comphelper::LibreOfficeKit::isActive())
{ {
// If there is a callback already registered, inform the new outliner view about it. // If there is a callback already registered, inform the new outliner view about it.
SwDrawModel* pDrawModel = mrView.GetWrtShellPtr()->getIDocumentDrawModelAccess().GetDrawModel(); if (comphelper::LibreOfficeKit::isViewCallback())
mpOutlinerView->registerLibreOfficeKitCallback(pDrawModel); mpOutlinerView->registerLibreOfficeKitViewCallback(&mrView);
else
{
SwDrawModel* pDrawModel = mrView.GetWrtShellPtr()->getIDocumentDrawModelAccess().GetDrawModel();
mpOutlinerView->registerLibreOfficeKitCallback(pDrawModel);
}
} }
//create Scrollbars //create Scrollbars
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment