[Libreoffice-commits] core.git: officecfg/registry sc/source sc/uiconfig sc/UIConfig_scalc.mk

Maxim Monastirsky momonasmon at gmail.com
Thu Apr 26 20:16:29 UTC 2018


 officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu |    5 ++
 sc/UIConfig_scalc.mk                                                 |    1 
 sc/source/ui/app/inputwin.cxx                                        |   14 ++++++++
 sc/uiconfig/scalc/popupmenu/formulabar.xml                           |   17 ++++++++++
 4 files changed, 37 insertions(+)

New commits:
commit 9d9076cb00c474ba7f13d458f1e280e31f5d4bac
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Wed Apr 18 02:49:37 2018 +0300

    tdf#57000 Add a context menu to the formula bar input field
    
    As a side effect also fixes tdf#70597
    
    Change-Id: Idd872d93f7a9da50f67c91a11e7e0231c7ac924e
    Reviewed-on: https://gerrit.libreoffice.org/53513
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu
index 7614ea3827c0..b9948964babf 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu
@@ -65,6 +65,11 @@
           <value xml:lang="en-US">Text Box Formatting</value>
         </prop>
       </node>
+      <node oor:name="private:resource/popupmenu/formulabar" oor:op="replace">
+        <prop oor:name="UIName" oor:type="xs:string">
+          <value xml:lang="en-US">Formula Bar</value>
+        </prop>
+      </node>
       <node oor:name="private:resource/popupmenu/graphic" oor:op="replace">
         <prop oor:name="UIName" oor:type="xs:string">
           <value xml:lang="en-US">Image</value>
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index bfbf46305226..6eb7c34d49f9 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -26,6 +26,7 @@ $(eval $(call gb_UIConfig_add_popupmenufiles,modules/scalc,\
 	sc/uiconfig/scalc/popupmenu/drawtext \
 	sc/uiconfig/scalc/popupmenu/form \
 	sc/uiconfig/scalc/popupmenu/formrichtext \
+	sc/uiconfig/scalc/popupmenu/formulabar \
 	sc/uiconfig/scalc/popupmenu/freezepanes \
 	sc/uiconfig/scalc/popupmenu/graphic \
 	sc/uiconfig/scalc/popupmenu/media \
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index fd97dc58d21c..4389cb643cec 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1418,6 +1418,20 @@ void ScTextWnd::Command( const CommandEvent& rCEvt )
                 rBindings.Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
             }
         }
+        else if ( nCommand == CommandEventId::ContextMenu )
+        {
+            SfxViewFrame* pViewFrm = SfxViewFrame::Current();
+            if (pViewFrm)
+            {
+                Point aPos = rCEvt.GetMousePosPixel();
+                if (!rCEvt.IsMouseEvent())
+                {
+                    Size aSize = GetOutputSizePixel();
+                    aPos = Point(aSize.Width() / 2, aSize.Height() / 2);
+                }
+                pViewFrm->GetDispatcher()->ExecutePopup("formulabar", this, &aPos);
+            }
+        }
         else if ( nCommand == CommandEventId::Wheel )
         {
             //don't call InputChanged for CommandEventId::Wheel
diff --git a/sc/uiconfig/scalc/popupmenu/formulabar.xml b/sc/uiconfig/scalc/popupmenu/formulabar.xml
new file mode 100644
index 000000000000..ce6abf1d393d
--- /dev/null
+++ b/sc/uiconfig/scalc/popupmenu/formulabar.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu">
+  <menu:menuitem menu:id=".uno:Cut"/>
+  <menu:menuitem menu:id=".uno:Copy"/>
+  <menu:menuitem menu:id=".uno:Paste"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:SelectAll"/>
+  <menu:menuitem menu:id=".uno:InsertSymbol"/>
+</menu:menupopup>


More information about the Libreoffice-commits mailing list