diff options
-rw-r--r-- | framework/source/uielement/toolbarmanager.cxx | 21 | ||||
-rw-r--r-- | framework/source/uielement/toolbarsmenucontroller.cxx | 4 | ||||
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Common.xcs | 7 | ||||
-rw-r--r-- | sfx2/sdi/appslots.sdi | 1 | ||||
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 13 |
5 files changed, 45 insertions, 1 deletions
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index f965d38f6b46..8152ea8519ce 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -256,7 +256,7 @@ ToolBarManager::ToolBarManager( const Reference< XMultiServiceFactory >& rServic m_bUpdateControllers( sal_False ), m_bImageOrientationRegistered( sal_False ), m_bImageMirrored( sal_False ), - m_bCanBeCustomized( sal_True ), + m_bCanBeCustomized( !SvtMiscOptions().DisableUICustomization() ), m_lImageRotation( 0 ), m_pToolBar( pToolBar ), m_aResourceName( rResourceName ), @@ -496,6 +496,24 @@ void ToolBarManager::UpdateControllers() { RTL_LOGFILE_CONTEXT( aLog, "framework (cd100003) ::ToolBarManager::UpdateControllers" ); + if( !m_bCanBeCustomized ) + { + Any a; + Reference< XLayoutManager > xLayoutManager; + Reference< XPropertySet > xFramePropSet( m_xFrame, UNO_QUERY ); + if ( xFramePropSet.is() ) + a = xFramePropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))); + a >>= xLayoutManager; + Reference< XDockableWindow > xDockable( VCLUnoHelper::GetInterface( m_pToolBar ), UNO_QUERY ); + if ( xLayoutManager.is() && xDockable.is() ) + { + ::com::sun::star::awt::Point aPoint; + aPoint.X = aPoint.Y = LONG_MAX; + xLayoutManager->dockWindow( m_aResourceName, DockingArea_DOCKINGAREA_DEFAULT, aPoint ); + xLayoutManager->lockWindow( m_aResourceName ); + } + } + if ( !m_bUpdateControllers ) { m_bUpdateControllers = sal_True; @@ -1805,6 +1823,7 @@ PopupMenu * ToolBarManager::GetToolBarCustomMeun(ToolBox* pToolBar) // Non-configurable toolbars should disable configuration menu items aPopupMenu.EnableItem( MENUITEM_TOOLBAR_VISIBLEBUTTON, sal_False ); aPopupMenu.EnableItem( MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR, sal_False ); + aPopupMenu.EnableItem( MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, sal_False ); } // Disable menu item CLOSE if the toolbar has no closer diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index d0ddeccfab20..65162b96561f 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -79,6 +79,7 @@ #include <unotools/cmdoptions.hxx> #include <dispatch/uieventloghelper.hxx> #include <rtl/logfile.hxx> +#include <svtools/miscopt.hxx> //_________________________________________________________________________________________________________________ // Defines @@ -376,6 +377,9 @@ sal_Bool ToolbarsMenuController::isContextSensitiveToolbarNonVisible() void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopupMenu ) { + if( SvtMiscOptions().DisableUICustomization() ) + return; + vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() ); resetPopupMenu( rPopupMenu ); diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index bad5fbc28c92..7e02dcec7981 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -5775,6 +5775,13 @@ </info> <value>false</value> </prop> + <prop oor:name="DisableUICustomization" oor:type="xs:boolean"> + <info> + <author>RSiddhartha</author> + <desc>Disables the customization of the UI elements.</desc> + </info> + <value>false</value> + </prop> <prop oor:name="SymbolSet" oor:type="xs:short"> <!-- UIHints: Tools Options General View --> <info> diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi index f20cdbd7c385..846f02e44446 100644 --- a/sfx2/sdi/appslots.sdi +++ b/sfx2/sdi/appslots.sdi @@ -177,6 +177,7 @@ interface Application SID_AVAILABLE_TOOLBARS [ ExecMethod = MiscExec_Impl ; + StateMethod = MiscState_Impl ; ] SID_HELP_TUTORIALS [ diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index bd9efc9bca1e..ff96976c3f2a 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -79,6 +79,7 @@ #include <unotools/moduleoptions.hxx> #include <unotools/regoptions.hxx> #include <svtools/helpopt.hxx> +#include <svtools/miscopt.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/shl.hxx> #include <unotools/bootstrap.hxx> @@ -659,6 +660,18 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet) break; } + case SID_CONFIG: + case SID_TOOLBOXOPTIONS: + case SID_CONFIGSTATUSBAR: + case SID_CONFIGMENU: + case SID_CONFIGACCEL: + case SID_CONFIGEVENT: + { + if( SvtMiscOptions().DisableUICustomization() ) + rSet.DisableItem(nWhich); + break; + } + case SID_BASICSTOP: if ( !StarBASIC::IsRunning() ) rSet.DisableItem(nWhich); |