kbrown / rpms / libreoffice

Forked from rpms/libreoffice 2 years ago
Clone

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

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