Blame SOURCES/0092-sc-LOK_CALLBACK_DOCUMENT_SIZE_CHANGED-callback.patch

135360
From d5adff883259a0f4128e6c88fe96a33aabd579c9 Mon Sep 17 00:00:00 2001
135360
From: Henry Castro <hcastro@collabora.com>
135360
Date: Thu, 13 Aug 2015 14:00:47 -0400
135360
Subject: [PATCH 092/398] sc: LOK_CALLBACK_DOCUMENT_SIZE_CHANGED callback
135360
135360
Handle the LOK_CALLBACK_DOCUMENT_SIZE_CHANGED callback.
135360
135360
Change-Id: I855b1e23cfc6ec66e2a0eec603e38e9dd1e28cc5
135360
(cherry picked from commit 8f6c7f3ca1baa6c29161cbbe41494c03b0a9d000)
135360
---
135360
 sc/source/ui/view/tabview5.cxx | 19 +++++++++++++++++++
135360
 1 file changed, 19 insertions(+)
135360
135360
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
135360
index 768c4b39d5a6..5644feaf7a2e 100644
135360
--- a/sc/source/ui/view/tabview5.cxx
135360
+++ b/sc/source/ui/view/tabview5.cxx
135360
@@ -51,7 +51,10 @@
135360
 #include <vcl/svapp.hxx>
135360
 #include <vcl/settings.hxx>
135360
 
135360
+#include <comphelper/lok.hxx>
135360
 #include <officecfg/Office/Calc.hxx>
135360
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
135360
+
135360
 
135360
 using namespace com::sun::star;
135360
 
135360
@@ -298,6 +301,22 @@ void ScTabView::TabChanged( bool bSameTabButMoved )
135360
                 pImp->SheetChanged( bSameTabButMoved );
135360
         }
135360
     }
135360
+
135360
+    if (comphelper::LibreOfficeKit::isActive())
135360
+    {
135360
+        ScDocShell* pDocSh;
135360
+        ScModelObj* pModelObj;
135360
+
135360
+        if ( ( pDocSh = GetViewData().GetDocShell() ) &&
135360
+             ( pModelObj = ScModelObj::getImplementation( pDocSh->GetModel() )) )
135360
+        {
135360
+            Size aDocSize = pModelObj->getDocumentSize();
135360
+            std::stringstream ss;
135360
+            ss << aDocSize.Width() << ", " << aDocSize.Height();
135360
+            OString sRect = ss.str().c_str();
135360
+            pDocSh->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sRect.getStr());
135360
+        }
135360
+    }
135360
 }
135360
 
135360
 void ScTabView::UpdateLayerLocks()
135360
-- 
135360
2.12.0
135360