From fac47ae957e893ea050e38bca3f5a25d83798bfd Mon Sep 17 00:00:00 2001 From: Tamás Zolnai Date: Sat, 14 Sep 2019 13:22:45 +0200 Subject: lok: send an invalidation by document size change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://gerrit.libreoffice.org/79491 Reviewed-by: Tamás Zolnai Tested-by: Tamás Zolnai (cherry picked from commit cd7ff1797d754018db1d47888781c9d7ecb24dcf) Change-Id: Id0a8991016dbe8d13891071e2d5b4c9250720da9 Reviewed-on: https://gerrit.libreoffice.org/79617 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tamás Zolnai --- sw/source/core/view/viewsh.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'sw/source') 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 #include +#include #include #include #include @@ -74,6 +75,7 @@ #include #include +#include #include #include #include @@ -85,6 +87,7 @@ #include #include #include +#include #if !HAVE_FEATURE_DESKTOP #include @@ -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); + } } } } -- cgit