summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-13 14:10:47 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-07-12 22:06:36 -0400
commit4903605762ae843c043eb2f0c72896a14ab9aa68 (patch)
treec44d97bc9a022fda3b668252ebdf0087446de07b /sw
parenta943eec2bd0d161e8d085aecbeb036485ed0e858 (diff)
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 <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit e08e5615c96e4f709871e061b5a4f21333b8f139)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/docvw/SidebarScrollBar.cxx6
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControl.cxx5
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx9
3 files changed, 16 insertions, 4 deletions
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 <SidebarScrollBar.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <comphelper/lok.hxx>
#include <SidebarWin.hxx>
#include <view.hxx>
@@ -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 e3580d3e5615..467eafb22d4b 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -215,7 +215,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 0d3791257708..71a29925098b 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