summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-09-14 13:22:45 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-09-26 19:43:54 +0200
commitfac47ae957e893ea050e38bca3f5a25d83798bfd (patch)
treef76ef1b4c15baedc71c0d9ebad84601dc93179cb /sw/source
parent30a10a422003f87d761351606fd2158703b073f3 (diff)
lok: send an invalidation by document size change
It was sent by the kit code earlier. Now we move it to the LO core code, so we can optimize it later. co-author: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/79491 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit cd7ff1797d754018db1d47888781c9d7ecb24dcf) Change-Id: Id0a8991016dbe8d13891071e2d5b4c9250720da9 Reviewed-on: https://gerrit.libreoffice.org/79617 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/view/viewsh.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index c0268da684d9..01757e3d4240 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -20,6 +20,7 @@
#include <config_features.h>
#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <sfx2/viewfrm.hxx>
#include <sfx2/progress.hxx>
#include <svx/srchdlg.hxx>
@@ -74,6 +75,7 @@
#include <wrtsh.hxx>
#include <DocumentSettingManager.hxx>
+#include <unotxdoc.hxx>
#include <view.hxx>
#include <PostItMgr.hxx>
#include <unotools/configmgr.hxx>
@@ -85,6 +87,7 @@
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <comphelper/lok.hxx>
#include <prevwpage.hxx>
+#include <sfx2/lokhelper.hxx>
#if !HAVE_FEATURE_DESKTOP
#include <vcl/sysdata.hxx>
@@ -1073,7 +1076,14 @@ void SwViewShell::SizeChgNotify()
std::stringstream ss;
ss << aDocSize.Width() + 2 * DOCUMENTBORDER << ", " << aDocSize.Height() + 2 * DOCUMENTBORDER;
OString sSize = ss.str().c_str();
- GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sSize.getStr());
+
+ uno::Reference< css::lang::XUnoTunnel > xTunnel(GetSfxViewShell()->GetCurrentDocument(), uno::UNO_QUERY);
+ if(xTunnel.is())
+ {
+ SwXTextDocument* pXDoc = reinterpret_cast< SwXTextDocument * >(
+ sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething(SwXTextDocument::getUnoTunnelId())));
+ SfxLokHelper::notifyDocumentSizeChanged(GetSfxViewShell(), sSize, pXDoc);
+ }
}
}
}