Blame SOURCES/0111-get-feedback-for-style-font-font-size-in-tiledrender.patch

135360
From 11a1920fb4fca1624efb2210cbb1f51fb74f6264 Mon Sep 17 00:00:00 2001
135360
From: Mihai Varga <mihai.varga@collabora.com>
135360
Date: Mon, 14 Sep 2015 20:06:07 +0300
135360
Subject: [PATCH 111/398] get feedback for style / font / font size in
135360
 tiledrendering
135360
135360
Change-Id: I92fd5022a4a5736a6323732141e9ea7bafec2a44
135360
(cherry picked from commit 6023b797c4570b69d0511b0a45bcf67932f32ba6)
135360
---
135360
 sfx2/source/control/unoctitm.cxx | 45 +++++++++++++++++++++++++++++++++-------
135360
 1 file changed, 38 insertions(+), 7 deletions(-)
135360
135360
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
135360
index bba52c6f9722..bb5d6720029f 100644
135360
--- a/sfx2/source/control/unoctitm.cxx
135360
+++ b/sfx2/source/control/unoctitm.cxx
135360
@@ -28,6 +28,7 @@
135360
 #include <svtools/javacontext.hxx>
135360
 #include <svl/itempool.hxx>
135360
 #include <tools/urlobj.hxx>
135360
+#include <com/sun/star/awt/FontDescriptor.hpp>
135360
 #include <com/sun/star/util/URLTransformer.hpp>
135360
 #include <com/sun/star/util/XURLTransformer.hpp>
135360
 #include <com/sun/star/frame/Desktop.hpp>
135360
@@ -37,8 +38,10 @@
135360
 #include <com/sun/star/frame/XFrame.hpp>
135360
 #include <com/sun/star/frame/FrameActionEvent.hpp>
135360
 #include <com/sun/star/frame/FrameAction.hpp>
135360
+#include <com/sun/star/frame/status/FontHeight.hpp>
135360
 #include <com/sun/star/frame/status/ItemStatus.hpp>
135360
 #include <com/sun/star/frame/status/ItemState.hpp>
135360
+#include <com/sun/star/frame/status/Template.hpp>
135360
 #include <com/sun/star/frame/DispatchResultState.hpp>
135360
 #include <com/sun/star/frame/ModuleManager.hpp>
135360
 #include <com/sun/star/frame/status/Visibility.hpp>
135360
@@ -1059,22 +1062,50 @@ void SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
135360
     if (!objSh || !objSh->isTiledRendering())
135360
         return;
135360
 
135360
+    OUStringBuffer aBuffer;
135360
+    aBuffer.append(aEvent.FeatureURL.Complete);
135360
+    aBuffer.append("=");
135360
+
135360
     if (aEvent.FeatureURL.Path == "Bold" ||
135360
         aEvent.FeatureURL.Path == "Italic" ||
135360
         aEvent.FeatureURL.Path == "Underline" ||
135360
-        aEvent.FeatureURL.Path == "Strikeout")
135360
+        aEvent.FeatureURL.Path == "Strikeout" ||
135360
+        aEvent.FeatureURL.Path == "DefaultBullet" ||
135360
+        aEvent.FeatureURL.Path == "DefaultNumbering" ||
135360
+        aEvent.FeatureURL.Path == "LeftPara" ||
135360
+        aEvent.FeatureURL.Path == "CenterPara" ||
135360
+        aEvent.FeatureURL.Path == "RightPara" ||
135360
+        aEvent.FeatureURL.Path == "JustifyPara")
135360
     {
135360
-
135360
-        OUStringBuffer aBuffer;
135360
-        aBuffer.append(aEvent.FeatureURL.Complete);
135360
-        aBuffer.append("=");
135360
         bool bTemp = false;
135360
         aEvent.State >>= bTemp;
135360
         aBuffer.append(bTemp);
135360
 
135360
-        OUString payload = aBuffer.makeStringAndClear();
135360
-        objSh->libreOfficeKitCallback(LOK_CALLBACK_STATE_CHANGED, payload.toUtf8().getStr());
135360
     }
135360
+    else if (aEvent.FeatureURL.Path == "CharFontName")
135360
+    {
135360
+        ::com::sun::star::awt::FontDescriptor aFontDesc;
135360
+        aEvent.State >>= aFontDesc;
135360
+        aBuffer.append(aFontDesc.Name);
135360
+    }
135360
+    else if (aEvent.FeatureURL.Path == "FontHeight")
135360
+    {
135360
+        ::com::sun::star::frame::status::FontHeight aFontHeight;
135360
+        aEvent.State >>= aFontHeight;
135360
+        aBuffer.append(aFontHeight.Height);
135360
+    }
135360
+    else if (aEvent.FeatureURL.Path == "StyleApply")
135360
+    {
135360
+        ::com::sun::star::frame::status::Template aTemplate;
135360
+        aEvent.State >>= aTemplate;
135360
+        aBuffer.append(aTemplate.StyleName);
135360
+    }
135360
+    else
135360
+    {
135360
+        return;
135360
+    }
135360
+    OUString payload = aBuffer.makeStringAndClear();
135360
+    objSh->libreOfficeKitCallback(LOK_CALLBACK_STATE_CHANGED, payload.toUtf8().getStr());
135360
 }
135360
 
135360
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
135360
-- 
135360
2.12.0
135360