summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2010-08-25 23:26:49 +0200
committerJan Holesovsky <kendy@suse.cz>2010-08-26 13:08:39 +0200
commitc4461665bd030a555a8b7ffa5bd6717cfb787b9d (patch)
tree2fef89cd567b094a183d8ca8260ee43f16a14b54 /framework/source
parent5eaf19519a289b248de1e87c0627f438512e15ce (diff)
ui-desktop-integration.diff: Disable UI [toolbars, menus] customization.
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/uielement/toolbarmanager.cxx21
-rw-r--r--framework/source/uielement/toolbarsmenucontroller.cxx4
2 files changed, 24 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 );