Blob Blame History Raw
From d5adff883259a0f4128e6c88fe96a33aabd579c9 Mon Sep 17 00:00:00 2001
From: Henry Castro <hcastro@collabora.com>
Date: Thu, 13 Aug 2015 14:00:47 -0400
Subject: [PATCH 092/398] sc: LOK_CALLBACK_DOCUMENT_SIZE_CHANGED callback

Handle the LOK_CALLBACK_DOCUMENT_SIZE_CHANGED callback.

Change-Id: I855b1e23cfc6ec66e2a0eec603e38e9dd1e28cc5
(cherry picked from commit 8f6c7f3ca1baa6c29161cbbe41494c03b0a9d000)
---
 sc/source/ui/view/tabview5.cxx | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 768c4b39d5a6..5644feaf7a2e 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -51,7 +51,10 @@
 #include <vcl/svapp.hxx>
 #include <vcl/settings.hxx>
 
+#include <comphelper/lok.hxx>
 #include <officecfg/Office/Calc.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+
 
 using namespace com::sun::star;
 
@@ -298,6 +301,22 @@ void ScTabView::TabChanged( bool bSameTabButMoved )
                 pImp->SheetChanged( bSameTabButMoved );
         }
     }
+
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        ScDocShell* pDocSh;
+        ScModelObj* pModelObj;
+
+        if ( ( pDocSh = GetViewData().GetDocShell() ) &&
+             ( pModelObj = ScModelObj::getImplementation( pDocSh->GetModel() )) )
+        {
+            Size aDocSize = pModelObj->getDocumentSize();
+            std::stringstream ss;
+            ss << aDocSize.Width() << ", " << aDocSize.Height();
+            OString sRect = ss.str().c_str();
+            pDocSh->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sRect.getStr());
+        }
+    }
 }
 
 void ScTabView::UpdateLayerLocks()
-- 
2.12.0