[Libreoffice-commits] core.git: framework/source officecfg/registry

Szymon Kłos eszkadev at gmail.com
Wed Feb 22 08:54:59 UTC 2017


 framework/source/uielement/toolbarmodemenucontroller.cxx             |   13 ++++++++++
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |    3 --
 officecfg/registry/data/org/openoffice/Office/UI/ToolbarMode.xcu     |    9 ++++++
 officecfg/registry/schema/org/openoffice/Office/UI/ToolbarMode.xcs   |    5 +++
 4 files changed, 27 insertions(+), 3 deletions(-)

New commits:
commit 50468779725c9eaccae17e4e39a6651f12e49340
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Sun Feb 19 16:36:08 2017 +0100

    tdf#103323 Single Toolbar without experimental mode
    
    Only Notebookbar mode should be marked as experimental.
    This patch allows to enable Single Toolbar or Sidebar
    mode without experimental mode activation.
    
    Change-Id: I9dcf1602b2f560aaa9ea29c07c4a7ed473be0352
    Reviewed-on: https://gerrit.libreoffice.org/34431
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/framework/source/uielement/toolbarmodemenucontroller.cxx b/framework/source/uielement/toolbarmodemenucontroller.cxx
index 69aa1a6..1e6cc36 100644
--- a/framework/source/uielement/toolbarmodemenucontroller.cxx
+++ b/framework/source/uielement/toolbarmodemenucontroller.cxx
@@ -117,6 +117,7 @@ void ToolbarModeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
 
     const Sequence<OUString> aModeNodeNames (aModesNode.getNodeNames());
     const sal_Int32 nCount(aModeNodeNames.getLength());
+    SvtMiscOptions aMiscOptions;
 
     for ( sal_Int32 nReadIndex = 0; nReadIndex < nCount; ++nReadIndex )
     {
@@ -128,6 +129,18 @@ void ToolbarModeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
         OUString aCommandArg = comphelper::getString( aModeNode.getNodeValue( "CommandArg" ) );
         long nPosition = comphelper::getINT32( aModeNode.getNodeValue( "MenuPosition" ) );
 
+        bool isExperimental = false;
+        if ( aModeNode.hasByName( "IsExperimental" ) )
+        {
+            Any aExperimentalNode = aModeNode.getNodeValue( "IsExperimental" );
+            if( aExperimentalNode.hasValue() )
+                isExperimental = comphelper::getBOOL( aExperimentalNode );
+        }
+
+        // Allow Notebookbar only in experimental mode
+        if ( isExperimental && !aMiscOptions.IsExperimentalMode() )
+            continue;
+
         m_xPopupMenu->insertItem( nReadIndex+1, aLabel, css::awt::MenuItemStyle::RADIOCHECK, nPosition );
         rPopupMenu->setCommand( nReadIndex+1, aCommandArg );
     }
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 7b78273..0b860f7 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -5893,9 +5893,6 @@
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Toolbar Layout</value>
         </prop>
-        <prop oor:name="IsExperimental" oor:type="xs:boolean">
-          <value>true</value>
-        </prop>
       </node>
       <node oor:name=".uno:AvailableToolbars" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ToolbarMode.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ToolbarMode.xcu
index a78d90e..4ee4b4f 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/ToolbarMode.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/ToolbarMode.xcu
@@ -93,6 +93,9 @@
           <prop oor:name="HasNotebookbar">
             <value>true</value>
           </prop>
+          <prop oor:name="IsExperimental">
+            <value>true</value>
+          </prop>
           <prop oor:name="MenuPosition">
             <value>3</value>
           </prop>
@@ -204,6 +207,9 @@
           <prop oor:name="HasNotebookbar">
             <value>true</value>
           </prop>
+          <prop oor:name="IsExperimental">
+            <value>true</value>
+          </prop>
           <prop oor:name="MenuPosition">
             <value>3</value>
           </prop>
@@ -290,6 +296,9 @@
           <prop oor:name="HasNotebookbar">
             <value>true</value>
           </prop>
+          <prop oor:name="IsExperimental">
+            <value>true</value>
+          </prop>
           <prop oor:name="MenuPosition">
             <value>3</value>
           </prop>
diff --git a/officecfg/registry/schema/org/openoffice/Office/UI/ToolbarMode.xcs b/officecfg/registry/schema/org/openoffice/Office/UI/ToolbarMode.xcs
index 4a2a5ad..50759f8 100644
--- a/officecfg/registry/schema/org/openoffice/Office/UI/ToolbarMode.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/UI/ToolbarMode.xcs
@@ -41,6 +41,11 @@
           <desc>Position in the menu.</desc>
         </info>
       </prop>
+      <prop oor:name="IsExperimental" oor:type="xs:boolean" oor:nillable="true">
+        <info>
+          <desc>Enables entry only in the experimental mode.</desc>
+        </info>
+      </prop>
       <prop oor:name="HasNotebookbar" oor:type="xs:boolean" oor:nillable="false">
         <info>
           <desc>Determines if Notebookbar is visible.</desc>


More information about the Libreoffice-commits mailing list