[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - desktop/source sfx2/source

Henry Castro hcastro at collabora.com
Sat Jul 2 23:57:01 UTC 2016


 desktop/source/lib/init.cxx      |   12 +++++++-
 sfx2/source/control/unoctitm.cxx |   56 +++++++++++++++++++++++++++++++++++----
 2 files changed, 62 insertions(+), 6 deletions(-)

New commits:
commit 7498be54ba0e288ed8f2572b79a21bbaca1c0a8b
Author: Henry Castro <hcastro at collabora.com>
Date:   Thu Jun 30 10:33:20 2016 -0400

    sc lok: add status bar UNO commands
    
    Change-Id: I2dbed808a23609773baf9154820a7121c7919c70
    Reviewed-on: https://gerrit.libreoffice.org/26809
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 74bcc6f..5a808a7 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -798,7 +798,17 @@ static void doc_iniUnoCommands ()
         OUString(".uno:EntireColumn"),
         OUString(".uno:EntireCell"),
         OUString(".uno:MergeCells"),
-        OUString(".uno:AssignLayout")
+        OUString(".uno:AssignLayout"),
+        OUString(".uno:StatusDocPos"),
+        OUString(".uno:RowColSelCount"),
+        OUString(".uno:StatusPageStyle"),
+        OUString(".uno:InsertMode"),
+        OUString(".uno:StatusSelectionMode"),
+        OUString(".uno:Signature"),
+        OUString(".uno:Position"),
+        OUString(".uno:StateTableCell"),
+        OUString(".uno:StatusBarFunc"),
+        OUString(".uno:Size")
     };
 
     util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index af314f5..e14f7ad 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1061,7 +1061,7 @@ void SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
 
     OUStringBuffer aBuffer;
     aBuffer.append(aEvent.FeatureURL.Complete);
-    aBuffer.append("=");
+    aBuffer.append(static_cast<sal_Unicode>('='));
 
     if (aEvent.FeatureURL.Path == "Bold" ||
         aEvent.FeatureURL.Path == "CenterPara" ||
@@ -1140,16 +1140,62 @@ void SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
     {
         aBuffer.append(OUString::boolean(aEvent.IsEnabled));
     }
-    else if (aEvent.FeatureURL.Path == "AssignLayout")
+    else if (aEvent.FeatureURL.Path == "AssignLayout" ||
+             aEvent.FeatureURL.Path == "StatusSelectionMode" ||
+             aEvent.FeatureURL.Path == "Signature")
     {
-        sal_Int32 nLayout = 0;
-        aEvent.State >>= nLayout;
-        aBuffer.append(nLayout);
+        sal_Int32 aInt32;
+
+        if (aEvent.IsEnabled && (aEvent.State >>= aInt32))
+        {
+            aBuffer.append(OUString::number(aInt32));
+        }
+    }
+    else if (aEvent.FeatureURL.Path == "StatusDocPos" ||
+             aEvent.FeatureURL.Path == "RowColSelCount" ||
+             aEvent.FeatureURL.Path == "StatusPageStyle" ||
+             aEvent.FeatureURL.Path == "StateTableCell")
+    {
+        OUString aString;
+
+        if (aEvent.IsEnabled && (aEvent.State >>= aString))
+        {
+            aBuffer.append(aString);
+        }
+    }
+    else if (aEvent.FeatureURL.Path == "InsertMode")
+    {
+        sal_Bool aBool;
+
+        if (aEvent.IsEnabled && (aEvent.State >>= aBool))
+        {
+            aBuffer.append(OUString::boolean(aBool));
+        }
+    }
+    else if (aEvent.FeatureURL.Path == "Position")
+    {
+        css::awt::Point aPoint;
+
+        if (aEvent.IsEnabled && (aEvent.State >>= aPoint))
+        {
+            aBuffer.append(OUString::number(aPoint.X) + OUString(" / ") + OUString::number(aPoint.Y));
+        }
+    }
+    else if (aEvent.FeatureURL.Path == "StatusBarFunc" ||
+             aEvent.FeatureURL.Path == "Size")
+    {
+        css::awt::Size aSize;
+
+        if (aEvent.IsEnabled && (aEvent.State >>= aSize))
+        {
+            aBuffer.append(OUString::number(aSize.Width) + OUString(" x ") + OUString::number(aSize.Height));
+        }
     }
     else
     {
         return;
     }
+
     OUString payload = aBuffer.makeStringAndClear();
     objSh->libreOfficeKitCallback(LOK_CALLBACK_STATE_CHANGED, payload.toUtf8().getStr());
 }


More information about the Libreoffice-commits mailing list