summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2017-02-19 16:36:08 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-02-22 08:54:35 +0000
commit50468779725c9eaccae17e4e39a6651f12e49340 (patch)
treed5806e5307bfbb3281a0626f243009429c33421d /framework
parentab92c84dfe600f320f37b6126cab11385a6fbdd1 (diff)
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@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/toolbarmodemenucontroller.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/framework/source/uielement/toolbarmodemenucontroller.cxx b/framework/source/uielement/toolbarmodemenucontroller.cxx
index 69aa1a6a027f..1e6cc36f31ca 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 );
}