[Libreoffice-commits] core.git: sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Jun 13 12:42:29 UTC 2016
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(-)
New commits:
commit e08e5615c96e4f709871e061b5a4f21333b8f139
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Jun 13 14:10:47 2016 +0200
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 at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/sw/source/uibase/docvw/SidebarScrollBar.cxx b/sw/source/uibase/docvw/SidebarScrollBar.cxx
index 7ad9b93..86ca488 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 4ffe031..9ecfeae 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 d495b2e..60c78b8 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
More information about the Libreoffice-commits
mailing list