summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-13 14:10:47 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-06-13 12:42:02 +0000
commite08e5615c96e4f709871e061b5a4f21333b8f139 (patch)
tree9e730f488f4d3d8ddaa796485283fdec6fafda15 /sw/source/uibase
parente11f90fb28487503ffda1880857036f50430ef79 (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>
Diffstat (limited to 'sw/source/uibase')
-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 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