diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk index 884404edd750da9258f508e3843b7bc012dc1c7c..1b2b46dbe300bbdcb0f7c81c1020e93b39a9dfc7 100644 --- a/chart2/Library_chartcontroller.mk +++ b/chart2/Library_chartcontroller.mk @@ -183,7 +183,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/main/PositionAndSizeHelper \ chart2/source/controller/main/SelectionHelper \ chart2/source/controller/main/ShapeController \ - chart2/source/controller/main/ShapeToolbarController \ chart2/source/controller/main/StatusBarCommandDispatch \ chart2/source/controller/main/UndoActions \ chart2/source/controller/main/UndoCommandDispatch \ diff --git a/chart2/inc/pch/precompiled_chartcontroller.hxx b/chart2/inc/pch/precompiled_chartcontroller.hxx index 12b3613f56bb98faaaf2d3c96335b0c72687e572..f6ebf367020e8e942956cbadad5b381bdfa1c61a 100644 --- a/chart2/inc/pch/precompiled_chartcontroller.hxx +++ b/chart2/inc/pch/precompiled_chartcontroller.hxx @@ -270,7 +270,6 @@ #include #include #include -#include #include #include #include diff --git a/chart2/source/controller/chartcontroller.component b/chart2/source/controller/chartcontroller.component index 045d61f244dcd460bbe558df89c61fd33c8786f6..23269baf25fa2fe917527be3b739144c1a264952 100644 --- a/chart2/source/controller/chartcontroller.component +++ b/chart2/source/controller/chartcontroller.component @@ -43,10 +43,6 @@ constructor="com_sun_star_comp_chart2_ChartTypeDialog_get_implementation"> - - - diff --git a/chart2/source/controller/main/ShapeToolbarController.cxx b/chart2/source/controller/main/ShapeToolbarController.cxx deleted file mode 100644 index 999c9bacdd5c149588daea815df1ae6758286027..0000000000000000000000000000000000000000 --- a/chart2/source/controller/main/ShapeToolbarController.cxx +++ /dev/null @@ -1,290 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "ShapeToolbarController.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace com::sun::star; - -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; - -namespace chart -{ - -OUString ShapeToolbarController::getImplementationName() throw (uno::RuntimeException, std::exception) -{ - return getImplementationName_Static(); -} - -OUString ShapeToolbarController::getImplementationName_Static() throw (uno::RuntimeException) -{ - return OUString( "com.sun.star.comp.chart2.ShapeToolbarController" ); -} - -Sequence< OUString > ShapeToolbarController::getSupportedServiceNames_Static() throw (uno::RuntimeException) -{ - Sequence< OUString > aSupported(1); - aSupported.getArray()[0] = "com.sun.star.chart2.ShapeToolbarController"; - return aSupported; -} - -sal_Bool ShapeToolbarController::supportsService( const OUString& ServiceName ) throw (uno::RuntimeException, std::exception) -{ - return cppu::supportsService( this, ServiceName ); -} - -Sequence< OUString > ShapeToolbarController::getSupportedServiceNames() throw (uno::RuntimeException, std::exception) -{ - return getSupportedServiceNames_Static(); -} - -ShapeToolbarController::ShapeToolbarController( const Reference< uno::XComponentContext >& xContext ) - :m_pToolbarController( NULL ) - ,m_nToolBoxId( 1 ) - ,m_nSlotId( 0 ) -{ - osl_atomic_increment( &m_refCount ); - m_xContext = xContext; - osl_atomic_decrement( &m_refCount ); -} - -ShapeToolbarController::~ShapeToolbarController() -{ -} - -// ::com::sun::star::uno::XInterface -uno::Any ShapeToolbarController::queryInterface( const uno::Type& rType ) throw (uno::RuntimeException, std::exception) -{ - uno::Any aReturn = ToolboxController::queryInterface( rType ); - if ( !aReturn.hasValue() ) - { - aReturn = ShapeToolbarController_Base::queryInterface( rType ); - } - return aReturn; -} - -void ShapeToolbarController::acquire() throw () -{ - ToolboxController::acquire(); -} - -void ShapeToolbarController::release() throw () -{ - ToolboxController::release(); -} - -// ::com::sun::star::lang::XInitialization -void ShapeToolbarController::initialize( const Sequence< uno::Any >& rArguments ) throw (uno::Exception, uno::RuntimeException, std::exception) -{ - ToolboxController::initialize( rArguments ); - SolarMutexGuard aSolarMutexGuard; - ::osl::MutexGuard aGuard( m_aMutex ); - - VclPtr< ToolBox > pToolBox = static_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ).get() ); - if ( pToolBox ) - { - const sal_uInt16 nCount = pToolBox->GetItemCount(); - for ( sal_uInt16 nPos = 0; nPos < nCount; ++nPos ) - { - const sal_uInt16 nItemId = pToolBox->GetItemId( nPos ); - if ( pToolBox->GetItemCommand( nItemId ) == m_aCommandURL ) - { - m_nToolBoxId = nItemId; - break; - } - } - if ( m_aCommandURL == ".uno:BasicShapes" ) - { - m_aStates.insert( TCommandState::value_type( ".uno:BasicShapes", sal_True ) ); - m_nSlotId = SID_DRAWTBX_CS_BASIC; - m_pToolbarController = new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox ); - } - else if ( m_aCommandURL == ".uno:SymbolShapes" ) - { - m_aStates.insert( TCommandState::value_type( ".uno:SymbolShapes", sal_True ) ); - m_nSlotId = SID_DRAWTBX_CS_SYMBOL; - m_pToolbarController = new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox ); - } - else if ( m_aCommandURL == ".uno:ArrowShapes" ) - { - m_aStates.insert( TCommandState::value_type( ".uno:ArrowShapes", sal_True ) ); - m_nSlotId = SID_DRAWTBX_CS_ARROW; - m_pToolbarController = new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox); - } - else if ( m_aCommandURL == ".uno:FlowChartShapes" ) - { - m_aStates.insert( TCommandState::value_type( ".uno:FlowChartShapes", sal_True ) ); - m_nSlotId = SID_DRAWTBX_CS_FLOWCHART; - m_pToolbarController = new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox ); - } - else if ( m_aCommandURL == ".uno:CalloutShapes" ) - { - m_aStates.insert( TCommandState::value_type( ".uno:CalloutShapes", sal_True ) ); - m_nSlotId = SID_DRAWTBX_CS_CALLOUT; - m_pToolbarController = new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox ); - } - else if ( m_aCommandURL == ".uno:StarShapes" ) - { - m_aStates.insert( TCommandState::value_type( ".uno:StarShapes" , sal_True ) ); - m_nSlotId = SID_DRAWTBX_CS_STAR; - m_pToolbarController = new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox ); - } - - for ( TCommandState::iterator aIter( m_aStates.begin() ); aIter != m_aStates.end(); ++aIter ) - { - addStatusListener( aIter->first ); - } - - if ( m_pToolbarController.is() ) - { - m_pToolbarController->initialize( rArguments ); - } - - // check if paste special is allowed, when not don't add DROPDOWN - pToolBox->SetItemBits( m_nToolBoxId, pToolBox->GetItemBits( m_nToolBoxId ) | ToolBoxItemBits::DROPDOWN ); - } -} - -// ::com::sun::star::frame::XStatusListener -void ShapeToolbarController::statusChanged( const frame::FeatureStateEvent& Event ) throw ( uno::RuntimeException, std::exception ) -{ - ::osl::MutexGuard aGuard( m_aMutex ); - TCommandState::iterator aFind = m_aStates.find( Event.FeatureURL.Complete ); - if ( aFind != m_aStates.end() ) - { - aFind->second = Event.IsEnabled; - if ( m_pToolbarController.is() ) - { - bool bCheckmark = false; - ToolBox& rTb = m_pToolbarController->GetToolBox(); - - for ( sal_uInt16 i = 0; i < rTb.GetItemCount(); ++i ) - { - sal_uInt16 nId = rTb.GetItemId( i ); - if ( nId == 0 ) - { - continue; - } - OUString aCmd = rTb.GetItemCommand( nId ); - if ( aCmd == Event.FeatureURL.Complete ) - { - rTb.EnableItem( nId, Event.IsEnabled ); - if ( Event.State >>= bCheckmark ) - { - rTb.CheckItem( nId, bCheckmark ); - } - else - { - OUString aItemText; - if ( Event.State >>= aItemText ) - { - rTb.SetItemText( nId, aItemText ); - } - } - } - } - } - } -} - -// ::com::sun::star::frame::XToolbarController -Reference< awt::XWindow > ShapeToolbarController::createPopupWindow() throw (uno::RuntimeException, std::exception) -{ - SolarMutexGuard aSolarMutexGuard; - ::osl::MutexGuard aGuard( m_aMutex ); - - Reference< awt::XWindow > xRet; - if ( m_pToolbarController.is() ) - { - xRet = m_pToolbarController->createPopupWindow(); - } - - return xRet; -} - -void ShapeToolbarController::execute( sal_Int16 KeyModifier ) throw (uno::RuntimeException, std::exception) -{ - auto aArgs(::comphelper::InitPropertySequence({ - { "KeyModifier", uno::makeAny(KeyModifier) } - })); - dispatchCommand( m_aCommandURL, aArgs ); -} - -// ::com::sun::star::frame::XSubToolbarController -sal_Bool ShapeToolbarController::opensSubToolbar() throw (uno::RuntimeException, std::exception) -{ - return ( m_nSlotId == SID_DRAWTBX_CS_BASIC || - m_nSlotId == SID_DRAWTBX_CS_SYMBOL || - m_nSlotId == SID_DRAWTBX_CS_ARROW || - m_nSlotId == SID_DRAWTBX_CS_FLOWCHART || - m_nSlotId == SID_DRAWTBX_CS_CALLOUT || - m_nSlotId == SID_DRAWTBX_CS_STAR ); -} - -OUString ShapeToolbarController::getSubToolbarName() throw (uno::RuntimeException, std::exception) -{ - SolarMutexGuard aSolarMutexGuard; - ::osl::MutexGuard aGuard(m_aMutex); - if ( m_pToolbarController.is() ) - { - return m_pToolbarController->getSubToolbarName(); - } - return OUString(); -} - -void ShapeToolbarController::functionSelected( const OUString& rCommand ) throw (uno::RuntimeException, std::exception) -{ - SolarMutexGuard aSolarMutexGuard; - ::osl::MutexGuard aGuard( m_aMutex ); - if ( m_pToolbarController.is() ) - { - m_aCommandURL = rCommand; - m_pToolbarController->functionSelected( rCommand ); - } -} - -void ShapeToolbarController::updateImage() throw (uno::RuntimeException, std::exception) -{ - SolarMutexGuard aSolarMutexGuard; - ::osl::MutexGuard aGuard( m_aMutex ); - if ( m_pToolbarController.is() ) - { - m_pToolbarController->updateImage(); - } -} - -} // namespace chart - -extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL -com_sun_star_comp_chart2_ShapeToolbarController_get_implementation(css::uno::XComponentContext *context, - css::uno::Sequence const &) -{ - return cppu::acquire(new ::chart::ShapeToolbarController(context)); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ShapeToolbarController.hxx b/chart2/source/controller/main/ShapeToolbarController.hxx deleted file mode 100644 index f067e401ccb02eaf5452adbb61912aecf98b522d..0000000000000000000000000000000000000000 --- a/chart2/source/controller/main/ShapeToolbarController.hxx +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_SHAPETOOLBARCONTROLLER_HXX -#define INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_SHAPETOOLBARCONTROLLER_HXX - -#include - -#include - -#include -#include -#include - -#include -#include -#include - -class SfxToolBoxControl; - -namespace chart -{ - -typedef ::cppu::ImplHelper2 < ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::frame::XSubToolbarController> ShapeToolbarController_Base; - -typedef rtl::Reference TToolbarHelper; - -class ShapeToolbarController : public ::svt::ToolboxController - ,public ShapeToolbarController_Base -{ - typedef std::map TCommandState; - TCommandState m_aStates; - TToolbarHelper m_pToolbarController; - sal_uInt16 m_nToolBoxId; - sal_uInt16 m_nSlotId; - ShapeToolbarController( const ShapeToolbarController& ) SAL_DELETED_FUNCTION; - void operator =( const ShapeToolbarController& ) SAL_DELETED_FUNCTION; - -public: - explicit ShapeToolbarController( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); - virtual ~ShapeToolbarController(); - - // ::com::sun::star::uno::XInterface - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual void SAL_CALL acquire() throw () SAL_OVERRIDE; - virtual void SAL_CALL release() throw () SAL_OVERRIDE; - - // ::com::sun::star::lang::XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - // needed by registration - static OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException ); - static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - // ::com::sun::star::lang::XInitialization - virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - // ::com::sun::star::frame::XStatusListener - virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - // ::com::sun::star::frame::XToolbarController - virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - // ::com::sun::star::frame::XSubToolbarController - virtual sal_Bool SAL_CALL opensSubToolbar() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual OUString SAL_CALL getSubToolbarName() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual void SAL_CALL functionSelected( const OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual void SAL_CALL updateImage() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; -}; - -} // namespace chart - -#endif // INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_SHAPETOOLBARCONTROLLER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk index 74e72a9cf13631bcd91152f5e42f754564ce48ef..197910160c337396c7620984e0476f179fd14f68 100644 --- a/framework/Library_fwk.mk +++ b/framework/Library_fwk.mk @@ -151,6 +151,7 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\ framework/source/uielement/statusbarmerger \ framework/source/uielement/statusbarwrapper \ framework/source/uielement/statusindicatorinterfacewrapper \ + framework/source/uielement/subtoolbarcontroller \ framework/source/uielement/togglebuttontoolbarcontroller \ framework/source/uielement/toolbarmanager \ framework/source/uielement/toolbarmerger \ diff --git a/framework/inc/uifactory/factoryconfiguration.hxx b/framework/inc/uifactory/factoryconfiguration.hxx index d2313f4e750f8020562bf6225b560c6d8c1c7a19..d63bdc20188235a4a69c098e59415442cbdccc54 100644 --- a/framework/inc/uifactory/factoryconfiguration.hxx +++ b/framework/inc/uifactory/factoryconfiguration.hxx @@ -46,7 +46,7 @@ class ConfigurationAccess_ControllerFactory : // interfaces public ::cppu::WeakImplHelper1< ::com::sun::star::container::XContainerListener> { public: - ConfigurationAccess_ControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const OUString& _sRoot,bool _bAskValue = false ); + ConfigurationAccess_ControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const OUString& _sRoot ); virtual ~ConfigurationAccess_ControllerFactory(); void readConfigurationData(); @@ -56,7 +56,6 @@ public: OUString getValueFromCommandModule( const OUString& rCommandURL, const OUString& rModule ) const; void addServiceToCommandModule( const OUString& rCommandURL, const OUString& rModule, const OUString& rServiceSpecifier ); void removeServiceFromCommandModule( const OUString& rCommandURL, const OUString& rModule ); - inline bool hasValue() const { return m_bAskValue; } // container.XContainerListener virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; @@ -98,7 +97,6 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xConfigAccess; ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener > m_xConfigAccessListener; bool m_bConfigAccessInitialized; - bool m_bAskValue; }; } // namespace framework diff --git a/framework/source/uielement/subtoolbarcontroller.cxx b/framework/source/uielement/subtoolbarcontroller.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2b6e307f5b3122aad23eef0ec24ef0e2c167eaab --- /dev/null +++ b/framework/source/uielement/subtoolbarcontroller.cxx @@ -0,0 +1,458 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +typedef cppu::ImplInheritanceHelper< svt::ToolboxController, + css::frame::XSubToolbarController, + css::awt::XDockableWindowListener, + css::lang::XServiceInfo > ToolBarBase; + +class SubToolBarController : public ToolBarBase +{ + OUString m_aSubTbName; + OUString m_aLastCommand; + css::uno::Reference< css::ui::XUIElement > m_xUIElement; + void disposeUIElement(); +public: + explicit SubToolBarController( const css::uno::Sequence< css::uno::Any >& rxArgs ); + virtual ~SubToolBarController(); + + // XStatusListener + virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + + // XToolbarController + virtual void SAL_CALL execute( sal_Int16 nKeyModifier ) throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + + // XSubToolbarController + virtual sal_Bool SAL_CALL opensSubToolbar() throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + virtual OUString SAL_CALL getSubToolbarName() throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + virtual void SAL_CALL functionSelected( const OUString& rCommand ) throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + virtual void SAL_CALL updateImage() throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + + // XDockableWindowListener + virtual void SAL_CALL startDocking( const css::awt::DockingEvent& e ) throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + virtual css::awt::DockingData SAL_CALL docking( const css::awt::DockingEvent& e ) throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + virtual void SAL_CALL endDocking( const css::awt::EndDockingEvent& e ) throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + virtual sal_Bool SAL_CALL prepareToggleFloatingMode( const css::lang::EventObject& e ) throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + virtual void SAL_CALL toggleFloatingMode( const css::lang::EventObject& e ) throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + virtual void SAL_CALL closed( const css::lang::EventObject& e ) throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + virtual void SAL_CALL endPopupMode( const css::awt::EndPopupModeEvent& e ) throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + + // XEventListener + virtual void SAL_CALL disposing( const css::lang::EventObject& e ) throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + + // XUpdatable + virtual void SAL_CALL update() throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + + // XComponent + virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw ( css::uno::RuntimeException ) SAL_OVERRIDE; + virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw ( css::uno::RuntimeException ) SAL_OVERRIDE; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw ( css::uno::RuntimeException ) SAL_OVERRIDE; +}; + +SubToolBarController::SubToolBarController( const css::uno::Sequence< css::uno::Any >& rxArgs ) +{ + css::beans::PropertyValue aPropValue; + for ( sal_Int32 i = 0; i < rxArgs.getLength(); ++i ) + { + rxArgs[i] >>= aPropValue; + if ( aPropValue.Name == "Value" ) + { + OUString aValue; + aPropValue.Value >>= aValue; + m_aSubTbName = aValue.getToken(0, ';'); + m_aLastCommand = aValue.getToken(1, ';'); + break; + } + } +} + +SubToolBarController::~SubToolBarController() +{ + disposeUIElement(); + m_xUIElement = 0; +} + +void SubToolBarController::disposeUIElement() +{ + if ( m_xUIElement.is() ) + { + css::uno::Reference< css::lang::XComponent > xComponent( m_xUIElement, css::uno::UNO_QUERY ); + xComponent->dispose(); + } +} + +void SubToolBarController::statusChanged( const css::frame::FeatureStateEvent& Event ) + throw ( css::uno::RuntimeException, std::exception ) +{ + SolarMutexGuard aSolarMutexGuard; + + if ( m_bDisposed ) + return; + + ToolBox* pToolBox = 0; + sal_uInt16 nId = 0; + if ( getToolboxId( nId, &pToolBox ) ) + { + pToolBox->EnableItem( nId, Event.IsEnabled ); + ToolBoxItemBits nItemBits = pToolBox->GetItemBits( nId ); + nItemBits &= ~ToolBoxItemBits::CHECKABLE; + TriState eTri = TRISTATE_FALSE; + + bool bValue; + OUString aStrValue; + css::frame::status::ItemStatus aItemState; + css::frame::status::Visibility aItemVisibility; + + if ( Event.State >>= bValue ) + { + // Boolean, treat it as checked/unchecked + pToolBox->SetItemBits( nId, nItemBits ); + pToolBox->CheckItem( nId, bValue ); + if ( bValue ) + eTri = TRISTATE_TRUE; + nItemBits |= ToolBoxItemBits::CHECKABLE; + } + else if ( Event.State >>= aStrValue ) + { + pToolBox->SetItemText( nId, aStrValue ); + } + else if ( Event.State >>= aItemState ) + { + eTri = TRISTATE_INDET; + nItemBits |= ToolBoxItemBits::CHECKABLE; + } + else if ( Event.State >>= aItemVisibility ) + { + pToolBox->ShowItem( nId, aItemVisibility.bVisible ); + } + + pToolBox->SetItemState( nId, eTri ); + pToolBox->SetItemBits( nId, nItemBits ); + } +} + +void SubToolBarController::execute( sal_Int16 nKeyModifier ) + throw ( css::uno::RuntimeException, std::exception ) +{ + if ( !m_aLastCommand.isEmpty() ) + { + auto aArgs( comphelper::InitPropertySequence( { + { "KeyModifier", css::uno::makeAny( nKeyModifier ) } + } ) ); + dispatchCommand( m_aLastCommand, aArgs ); + } +} + +css::uno::Reference< css::awt::XWindow > SubToolBarController::createPopupWindow() + throw ( css::uno::RuntimeException, std::exception ) +{ + SolarMutexGuard aGuard; + + ToolBox* pToolBox = 0; + sal_uInt16 nId = 0; + if ( getToolboxId( nId, &pToolBox ) ) + { + css::uno::Reference< css::frame::XFrame > xFrame ( getFrameInterface() ); + + // create element with factory + static css::uno::WeakReference< css::ui::XUIElementFactoryManager > xWeakUIElementFactory; + css::uno::Reference< css::ui::XUIElement > xUIElement; + css::uno::Reference< css::ui::XUIElementFactoryManager > xUIElementFactory; + + xUIElementFactory = xWeakUIElementFactory; + if ( !xUIElementFactory.is() ) + { + xUIElementFactory = css::ui::theUIElementFactoryManager::get( m_xContext ); + xWeakUIElementFactory = xUIElementFactory; + } + + auto aPropSeq( comphelper::InitPropertySequence( { + { "Frame", css::uno::makeAny( xFrame ) }, + { "Persistent", css::uno::makeAny( false ) }, + { "PopupMode", css::uno::makeAny( true ) } + } ) ); + + try + { + xUIElement = xUIElementFactory->createUIElement( "private:resource/toolbar/" + m_aSubTbName, aPropSeq ); + } + catch ( css::container::NoSuchElementException& ) + {} + catch ( css::lang::IllegalArgumentException& ) + {} + + if ( xUIElement.is() ) + { + css::uno::Reference< css::awt::XWindow > xParent = xFrame->getContainerWindow(); + css::uno::Reference< css::awt::XWindow > xSubToolBar( xUIElement->getRealInterface(), css::uno::UNO_QUERY ); + if ( xSubToolBar.is() ) + { + css::uno::Reference< css::awt::XDockableWindow > xDockWindow( xSubToolBar, css::uno::UNO_QUERY ); + xDockWindow->addDockableWindowListener( css::uno::Reference< css::awt::XDockableWindowListener >( + static_cast< OWeakObject * >( this ), css::uno::UNO_QUERY ) ); + xDockWindow->enableDocking( sal_True ); + + // keep reference to UIElement to avoid its destruction + disposeUIElement(); + m_xUIElement = xUIElement; + + vcl::Window* pTbxWindow = VCLUnoHelper::GetWindow( xSubToolBar ); + if ( pTbxWindow && pTbxWindow->GetType() == WINDOW_TOOLBOX ) + { + ToolBox* pToolBar = static_cast< ToolBox* >( pTbxWindow ); + pToolBar->SetParent( pToolBox ); + // calc and set size for popup mode + Size aSize = pToolBar->CalcPopupWindowSizePixel(); + pToolBar->SetSizePixel( aSize ); + // open subtoolbox in popup mode + vcl::Window::GetDockingManager()->StartPopupMode( pToolBox, pToolBar ); + } + } + } + } + return css::uno::Reference< css::awt::XWindow >(); +} + +sal_Bool SubToolBarController::opensSubToolbar() + throw ( css::uno::RuntimeException, std::exception ) +{ + return sal_True; +} + +OUString SubToolBarController::getSubToolbarName() + throw ( css::uno::RuntimeException, std::exception ) +{ + return m_aSubTbName; +} + +void SubToolBarController::functionSelected( const OUString& rCommand ) + throw ( css::uno::RuntimeException, std::exception ) +{ + if ( !m_aLastCommand.isEmpty() ) + { + m_aLastCommand = rCommand; + updateImage(); + } +} + +void SubToolBarController::updateImage() + throw ( css::uno::RuntimeException, std::exception ) +{ + SolarMutexGuard aGuard; + if ( !m_aLastCommand.isEmpty() ) + { + ToolBox* pToolBox = 0; + sal_uInt16 nId = 0; + if ( getToolboxId( nId, &pToolBox ) ) + { + Image aImage = framework::GetImageFromURL( getFrameInterface(), m_aLastCommand, pToolBox->GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE ); + if ( !!aImage ) + pToolBox->SetItemImage( nId, aImage ); + } + } +} + +void SubToolBarController::startDocking( const css::awt::DockingEvent& ) + throw ( css::uno::RuntimeException, std::exception ) +{ +} + +css::awt::DockingData SubToolBarController::docking( const css::awt::DockingEvent& ) + throw ( css::uno::RuntimeException, std::exception ) +{ + return css::awt::DockingData(); +} + +void SubToolBarController::endDocking( const css::awt::EndDockingEvent& ) + throw ( css::uno::RuntimeException, std::exception ) +{ +} + +sal_Bool SubToolBarController::prepareToggleFloatingMode( const css::lang::EventObject& ) + throw ( css::uno::RuntimeException, std::exception ) +{ + return sal_False; +} + +void SubToolBarController::toggleFloatingMode( const css::lang::EventObject& ) + throw ( css::uno::RuntimeException, std::exception ) +{ +} + +void SubToolBarController::closed( const css::lang::EventObject& ) + throw ( css::uno::RuntimeException, std::exception ) +{ +} + +void SubToolBarController::endPopupMode( const css::awt::EndPopupModeEvent& e ) + throw ( css::uno::RuntimeException, std::exception ) +{ + SolarMutexGuard aGuard; + + OUString aSubToolBarResName; + if ( m_xUIElement.is() ) + { + css::uno::Reference< css::beans::XPropertySet > xPropSet( m_xUIElement, css::uno::UNO_QUERY ); + if ( xPropSet.is() ) + { + try + { + xPropSet->getPropertyValue("ResourceURL") >>= aSubToolBarResName; + } + catch ( css::beans::UnknownPropertyException& ) + {} + catch ( css::lang::WrappedTargetException& ) + {} + } + disposeUIElement(); + } + m_xUIElement = 0; + + // if the toolbar was teared-off recreate it and place it at the given position + if( e.bTearoff ) + { + css::uno::Reference< css::ui::XUIElement > xUIElement; + css::uno::Reference< css::frame::XLayoutManager > xLayoutManager = getLayoutManager(); + + if ( !xLayoutManager.is() ) + return; + + xLayoutManager->createElement( aSubToolBarResName ); + xUIElement = xLayoutManager->getElement( aSubToolBarResName ); + if ( xUIElement.is() ) + { + css::uno::Reference< css::awt::XWindow > xParent = getFrameInterface()->getContainerWindow(); + css::uno::Reference< css::awt::XWindow > xSubToolBar( xUIElement->getRealInterface(), css::uno::UNO_QUERY ); + css::uno::Reference< css::beans::XPropertySet > xProp( xUIElement, css::uno::UNO_QUERY ); + if ( xSubToolBar.is() && xProp.is() ) + { + OUString aPersistentString( "Persistent" ); + try + { + vcl::Window* pTbxWindow = VCLUnoHelper::GetWindow( xSubToolBar ); + if ( pTbxWindow && pTbxWindow->GetType() == WINDOW_TOOLBOX ) + { + css::uno::Any a = xProp->getPropertyValue( aPersistentString ); + xProp->setPropertyValue( aPersistentString, css::uno::makeAny( false ) ); + + xLayoutManager->hideElement( aSubToolBarResName ); + xLayoutManager->floatWindow( aSubToolBarResName ); + + xLayoutManager->setElementPos( aSubToolBarResName, e.FloatingPosition ); + xLayoutManager->showElement( aSubToolBarResName ); + + xProp->setPropertyValue("Persistent", a ); + } + } + catch ( css::uno::RuntimeException& ) + { + throw; + } + catch ( css::uno::Exception& ) + {} + } + } + } +} + +void SubToolBarController::disposing( const css::lang::EventObject& e ) + throw ( css::uno::RuntimeException, std::exception ) +{ + svt::ToolboxController::disposing( e ); +} + +void SubToolBarController::update() + throw ( css::uno::RuntimeException, std::exception ) +{ + svt::ToolboxController::update(); + + ToolBox* pToolBox = 0; + sal_uInt16 nId = 0; + if ( getToolboxId( nId, &pToolBox ) ) + { + if ( m_aLastCommand.isEmpty() ) + pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ToolBoxItemBits::DROPDOWNONLY ); + else + pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ToolBoxItemBits::DROPDOWN ); + } + updateImage(); +} + +void SubToolBarController::dispose() + throw ( css::uno::RuntimeException, std::exception ) +{ + if ( m_bDisposed ) + return; + + svt::ToolboxController::dispose(); + disposeUIElement(); + m_xUIElement = 0; +} + +OUString SubToolBarController::getImplementationName() + throw ( css::uno::RuntimeException ) +{ + return OUString( "com.sun.star.comp.framework.SubToolBarController" ); +} + +sal_Bool SubToolBarController::supportsService( const OUString& rServiceName ) + throw ( css::uno::RuntimeException ) +{ + return cppu::supportsService( this, rServiceName ); +} + +css::uno::Sequence< OUString > SubToolBarController::getSupportedServiceNames() + throw ( css::uno::RuntimeException ) +{ + css::uno::Sequence< OUString > aRet( 1 ); + aRet[0] = "com.sun.star.frame.ToolbarController"; + return aRet; +} + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_framework_SubToolBarController_get_implementation( + css::uno::XComponentContext*, + css::uno::Sequence& rxArgs ) +{ + return cppu::acquire( new SubToolBarController( rxArgs ) ); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uifactory/factoryconfiguration.cxx b/framework/source/uifactory/factoryconfiguration.cxx index 3f69ae5b299edc2e8ae8a0321a0925dd8be01c14..ca432e11e303a86f926281b07f0331af7031a3f6 100644 --- a/framework/source/uifactory/factoryconfiguration.cxx +++ b/framework/source/uifactory/factoryconfiguration.cxx @@ -54,14 +54,13 @@ OUString getHashKeyFromStrings( const OUString& aCommandURL, const OUString& aMo // XInterface, XTypeProvider -ConfigurationAccess_ControllerFactory::ConfigurationAccess_ControllerFactory( const Reference< XComponentContext >& rxContext, const OUString& _sRoot,bool _bAskValue ) : +ConfigurationAccess_ControllerFactory::ConfigurationAccess_ControllerFactory( const Reference< XComponentContext >& rxContext, const OUString& _sRoot ) : m_aPropCommand( "Command" ), m_aPropModule( "Module" ), m_aPropController( "Controller" ), m_aPropValue( "Value" ), m_sRoot(_sRoot), - m_bConfigAccessInitialized( false ), - m_bAskValue(_bAskValue) + m_bConfigAccessInitialized( false ) { m_xConfigProvider = configuration::theDefaultProvider::get( rxContext ); } @@ -276,8 +275,7 @@ bool ConfigurationAccess_ControllerFactory::impl_getElementProps( const Any& aEl xPropertySet->getPropertyValue( m_aPropCommand ) >>= aCommand; xPropertySet->getPropertyValue( m_aPropModule ) >>= aModule; xPropertySet->getPropertyValue( m_aPropController ) >>= aServiceSpecifier; - if ( m_bAskValue ) - xPropertySet->getPropertyValue( m_aPropValue ) >>= aValue; + xPropertySet->getPropertyValue( m_aPropValue ) >>= aValue; } catch ( const com::sun::star::beans::UnknownPropertyException& ) { diff --git a/framework/source/uifactory/uicontrollerfactory.cxx b/framework/source/uifactory/uicontrollerfactory.cxx index 7ff63a55e24a341c792eb26deab6bfc3c61ea877..c962987aa0692f42febcad9eb851e8844ced4b48 100644 --- a/framework/source/uifactory/uicontrollerfactory.cxx +++ b/framework/source/uifactory/uicontrollerfactory.cxx @@ -147,8 +147,7 @@ throw (Exception, RuntimeException, std::exception) Sequence< Any > aNewArgs( Arguments ); sal_Int32 nAppendIndex = aNewArgs.getLength(); - bool bHasValue = m_pConfigAccess->hasValue(); - aNewArgs.realloc( aNewArgs.getLength() + (bHasValue ? 2 : 1) ); + aNewArgs.realloc( aNewArgs.getLength() + 2 ); // Append the command URL to the Arguments sequence so that one controller can be // used for more than one command URL. @@ -156,15 +155,12 @@ throw (Exception, RuntimeException, std::exception) aPropValue.Value <<= ServiceSpecifier; aNewArgs[nAppendIndex] <<= aPropValue; - if ( bHasValue ) - { - // Append the optional value argument. It's an empty string if no additional info - // is provided to the controller. - OUString aValue = m_pConfigAccess->getValueFromCommandModule( ServiceSpecifier, aPropName ); - aPropValue.Name = aPropValueName; - aPropValue.Value <<= aValue; - aNewArgs[nAppendIndex+1] <<= aPropValue; - } + // Append the optional value argument. It's an empty string if no additional info + // is provided to the controller. + OUString aValue = m_pConfigAccess->getValueFromCommandModule( ServiceSpecifier, aPropName ); + aPropValue.Name = aPropValueName; + aPropValue.Value <<= aValue; + aNewArgs[nAppendIndex+1] <<= aPropValue; { OUString aServiceName; diff --git a/framework/util/fwk.component b/framework/util/fwk.component index 6541f1406f3f001a11de197203f13bad1a6ee623..477d524cac343250a860475960edaf09defa6cf0 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -196,4 +196,8 @@ constructor="org_apache_openoffice_comp_framework_WizardsToolbarController_get_implementation"> + + + diff --git a/include/svx/tbxcustomshapes.hxx b/include/svx/tbxcustomshapes.hxx deleted file mode 100644 index 2d55c8a49ba2568862701e389b115ea2eeda1cbb..0000000000000000000000000000000000000000 --- a/include/svx/tbxcustomshapes.hxx +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_SVX_TBXCUSTOMSHAPES_HXX -#define INCLUDED_SVX_TBXCUSTOMSHAPES_HXX - -#include -#include - -/************************************************************************* -|* -|* SvxTbxCtlCustomShapes -|* -\************************************************************************/ - -class SVX_DLLPUBLIC SvxTbxCtlCustomShapes : public SfxToolBoxControl -{ -public: - virtual void Select(sal_uInt16 nSelectModifier) SAL_OVERRIDE; - virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, - const SfxPoolItem* pState ) SAL_OVERRIDE; - virtual VclPtr CreatePopupWindow() SAL_OVERRIDE; - - SFX_DECL_TOOLBOX_CONTROL(); - - SvxTbxCtlCustomShapes( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); - virtual ~SvxTbxCtlCustomShapes() {} - - //interface XSubToolbarController: - virtual sal_Bool SAL_CALL opensSubToolbar() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual OUString SAL_CALL getSubToolbarName() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual void SAL_CALL functionSelected( const OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual void SAL_CALL updateImage() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - -private: - OUString m_aSubTbName; - OUString m_aSubTbxResName; - OUString m_aCommand; -}; - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu index 74acecb4a710d178af6137df2ec987cf9497bc11..165f8638d654c655652f38c5d51971f721211d1c 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu @@ -341,70 +341,88 @@ com.sun.star.comp.chart.ElementSelectorToolbarController - + .uno:BasicShapes - com.sun.star.chart2.ChartDocument + - com.sun.star.comp.chart2.ShapeToolbarController + com.sun.star.comp.framework.SubToolBarController + + + basicshapes;.uno:BasicShapes.diamond - + .uno:SymbolShapes - com.sun.star.chart2.ChartDocument + - com.sun.star.comp.chart2.ShapeToolbarController + com.sun.star.comp.framework.SubToolBarController + + + symbolshapes;.uno:SymbolShapes.smiley - + .uno:ArrowShapes - com.sun.star.chart2.ChartDocument + - com.sun.star.comp.chart2.ShapeToolbarController + com.sun.star.comp.framework.SubToolBarController + + + arrowshapes;.uno:ArrowShapes.left-right-arrow - + .uno:FlowChartShapes - com.sun.star.chart2.ChartDocument + - com.sun.star.comp.chart2.ShapeToolbarController + com.sun.star.comp.framework.SubToolBarController + + + flowchartshapes;.uno:FlowChartShapes.flowchart-internal-storage - + .uno:CalloutShapes - com.sun.star.chart2.ChartDocument + - com.sun.star.comp.chart2.ShapeToolbarController + com.sun.star.comp.framework.SubToolBarController + + + calloutshapes;.uno:CalloutShapes.round-rectangular-callout - + .uno:StarShapes - com.sun.star.chart2.ChartDocument + - com.sun.star.comp.chart2.ShapeToolbarController + com.sun.star.comp.framework.SubToolBarController + + + starshapes;.uno:StarShapes.star5 @@ -517,72 +535,6 @@ com.sun.star.report.ReportToolboxController - - - .uno:BasicShapes - - - com.sun.star.report.ReportDefinition - - - com.sun.star.report.ReportToolboxController - - - - - .uno:SymbolShapes - - - com.sun.star.report.ReportDefinition - - - com.sun.star.report.ReportToolboxController - - - - - .uno:ArrowShapes - - - com.sun.star.report.ReportDefinition - - - com.sun.star.report.ReportToolboxController - - - - - .uno:FlowChartShapes - - - com.sun.star.report.ReportDefinition - - - com.sun.star.report.ReportToolboxController - - - - - .uno:CalloutShapes - - - com.sun.star.report.ReportDefinition - - - com.sun.star.report.ReportToolboxController - - - - - .uno:StarShapes - - - com.sun.star.report.ReportDefinition - - - com.sun.star.report.ReportToolboxController - - .uno:CharFontName diff --git a/reportdesign/inc/pch/precompiled_rptui.hxx b/reportdesign/inc/pch/precompiled_rptui.hxx index d1d7c32023dd578044fd1116fe372c9e162d781c..00268a8a1ea2bde3b69e03d91d65c4e9640f6360 100644 --- a/reportdesign/inc/pch/precompiled_rptui.hxx +++ b/reportdesign/inc/pch/precompiled_rptui.hxx @@ -257,7 +257,6 @@ #include #include #include -#include #include #include #include diff --git a/reportdesign/source/ui/misc/toolboxcontroller.cxx b/reportdesign/source/ui/misc/toolboxcontroller.cxx index 9c9e844744779a2efcfe0946f4d065931eb9b6a4..390c9b99c2590c9ffe803be20ff1ba753d55ecad 100644 --- a/reportdesign/source/ui/misc/toolboxcontroller.cxx +++ b/reportdesign/source/ui/misc/toolboxcontroller.cxx @@ -39,7 +39,6 @@ #include #include #include -#include #include @@ -140,37 +139,7 @@ void SAL_CALL OToolboxController::initialize( const Sequence< Any >& _rArguments break; } } - if ( m_aCommandURL == ".uno:BasicShapes" ) - { - m_aStates.insert(TCommandState::value_type(OUString(".uno:BasicShapes"),sal_True)); - m_pToolbarController = new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_BASIC,m_nToolBoxId,*pToolBox); - } - else if ( m_aCommandURL == ".uno:SymbolShapes" ) - { - m_aStates.insert(TCommandState::value_type(OUString(".uno:SymbolShapes"),sal_True)); - m_pToolbarController = new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_SYMBOL,m_nToolBoxId,*pToolBox); - } - else if ( m_aCommandURL == ".uno:ArrowShapes" ) - { - m_aStates.insert(TCommandState::value_type(OUString(".uno:ArrowShapes"),sal_True)); - m_pToolbarController = new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_ARROW,m_nToolBoxId,*pToolBox); - } - else if ( m_aCommandURL == ".uno:FlowChartShapes" ) - { - m_aStates.insert(TCommandState::value_type(OUString(".uno:FlowChartShapes"),sal_True)); - m_pToolbarController = new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_FLOWCHART,m_nToolBoxId,*pToolBox); - } - else if ( m_aCommandURL == ".uno:CalloutShapes" ) - { - m_aStates.insert(TCommandState::value_type(OUString(".uno:CalloutShapes"),sal_True)); - m_pToolbarController = new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_CALLOUT,m_nToolBoxId,*pToolBox); - } - else if ( m_aCommandURL == ".uno:StarShapes" ) - { - m_aStates.insert(TCommandState::value_type(OUString(".uno:StarShapes"),sal_True)); - m_pToolbarController = new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_STAR,m_nToolBoxId,*pToolBox); - } - else if ( m_aCommandURL == ".uno:CharFontName" ) + if ( m_aCommandURL == ".uno:CharFontName" ) { m_aStates.insert(TCommandState::value_type(OUString(".uno:CharFontName"),sal_True)); m_pToolbarController = new SvxFontNameToolBoxControl/*SvxStyleToolBoxControl*/(m_nSlotId = SID_ATTR_CHAR_FONT,m_nToolBoxId,*pToolBox); @@ -208,9 +177,6 @@ void SAL_CALL OToolboxController::statusChanged( const FeatureStateEvent& Event if ( m_pToolbarController.is() ) { // All other status events will be processed here - bool bSetCheckmark = false; - bool bCheckmark = false; - //m_pToolbarController->GetToolBox().Enable(Event.IsEnabled); ToolBox& rTb = m_pToolbarController->GetToolBox(); for ( sal_uInt16 i = 0; i < rTb.GetItemCount(); i++ ) { @@ -223,20 +189,6 @@ void SAL_CALL OToolboxController::statusChanged( const FeatureStateEvent& Event { // Enable/disable item rTb.EnableItem( nId, Event.IsEnabled ); - - // Checkmark - if ( Event.State >>= bCheckmark ) - bSetCheckmark = true; - - if ( bSetCheckmark ) - rTb.CheckItem( nId, bCheckmark ); - else - { - OUString aItemText; - - if ( Event.State >>= aItemText ) - rTb.SetItemText( nId, aItemText ); - } } } @@ -289,21 +241,11 @@ sal_Bool SAL_CALL OToolboxController::opensSubToolbar() throw (uno::RuntimeExcep OUString SAL_CALL OToolboxController::getSubToolbarName() throw (uno::RuntimeException, std::exception) { - SolarMutexGuard aSolarMutexGuard; - ::osl::MutexGuard aGuard(m_aMutex); - if ( m_pToolbarController.is() ) - return m_pToolbarController->getSubToolbarName(); return OUString(); } -void SAL_CALL OToolboxController::functionSelected( const OUString& rCommand ) throw (uno::RuntimeException, std::exception) +void SAL_CALL OToolboxController::functionSelected( const OUString& /*rCommand*/ ) throw (uno::RuntimeException, std::exception) { - SolarMutexGuard aSolarMutexGuard; - ::osl::MutexGuard aGuard(m_aMutex); - if ( m_pToolbarController.is() ) - { - m_pToolbarController->functionSelected(m_aCommandURL = rCommand); - } } void SAL_CALL OToolboxController::updateImage( ) throw (uno::RuntimeException, std::exception) diff --git a/sc/inc/pch/precompiled_sc.hxx b/sc/inc/pch/precompiled_sc.hxx index d2b620fe20a984e4e619b8885aeefc8bfaadc510..646f9690aa8a562e2aeb2bf8014f2b962c0659dd 100644 --- a/sc/inc/pch/precompiled_sc.hxx +++ b/sc/inc/pch/precompiled_sc.hxx @@ -814,7 +814,6 @@ #include #include #include -#include #include #include #include diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index f303727de1b65880015443deb0439568ffe7d4d8..47b0534b835b670be3e0a616a248aecea4a22012 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -34,7 +34,6 @@ #include #include #include -#include #include #include @@ -161,12 +160,6 @@ void ScDLL::Init() // SvxToolboxController SvxTbxCtlDraw ::RegisterControl(SID_INSERT_DRAW, pMod); - SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_BASIC, pMod); - SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_SYMBOL, pMod); - SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_ARROW, pMod); - SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_FLOWCHART, pMod); - SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_CALLOUT, pMod); - SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_STAR, pMod); SvxTbxCtlAlign ::RegisterControl(SID_OBJECT_ALIGN, pMod); SvxFillToolBoxControl ::RegisterControl(0, pMod); SvxLineStyleToolBoxControl ::RegisterControl(0, pMod); diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx index 3429aeec4660b12eeca04c41cdbd906b242227a9..e52dda083ba811d14c3740bc80f18d4097f37562 100644 --- a/sd/inc/pch/precompiled_sd.hxx +++ b/sd/inc/pch/precompiled_sd.hxx @@ -753,7 +753,6 @@ #include #include #include -#include #include #include #include diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx index 1a4c79712532cc62e29d87cdc653e8c6b53e2bc6..4b499455d61f46c4fc5a9c2b70d36a6b34a76868 100644 --- a/sd/source/ui/app/sddll.cxx +++ b/sd/source/ui/app/sddll.cxx @@ -85,7 +85,6 @@ #include #include #include -#include #include #include #include @@ -177,13 +176,6 @@ void SdDLL::RegisterControllers() SdTbxControl::RegisterControl( SID_DRAWTBX_CONNECTORS, pMod ); SdTbxControl::RegisterControl( SID_DRAWTBX_INSERT, pMod ); - SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_BASIC, pMod ); - SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_SYMBOL, pMod ); - SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_ARROW, pMod ); - SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_FLOWCHART, pMod ); - SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_CALLOUT, pMod ); - SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_STAR, pMod ); - SdTbxCtlDiaPages::RegisterControl( SID_PAGES_PER_ROW, pMod ); SdTbxCtlGlueEscDir::RegisterControl( SID_GLUE_ESCDIR, pMod ); diff --git a/sd/source/ui/func/fuconcs.cxx b/sd/source/ui/func/fuconcs.cxx index bf49a373fa80e992c47d0e8932ee1ecad4c66b98..af30ec286d9be9dafd66b31be60ca11ab8e641ff 100644 --- a/sd/source/ui/func/fuconcs.cxx +++ b/sd/source/ui/func/fuconcs.cxx @@ -43,7 +43,6 @@ #include #include #include -#include #include #include diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx index 535dd54b503d26bfd54cff876e0508010f370e99..607c54dbb8a9477c0d5f504d2ad65caa751ba605 100644 --- a/sd/source/ui/view/drviews6.cxx +++ b/sd/source/ui/view/drviews6.cxx @@ -33,7 +33,6 @@ #include "optsitem.hxx" #include #include -#include #include #include "app.hrc" diff --git a/sd/source/ui/view/drvwshrg.cxx b/sd/source/ui/view/drvwshrg.cxx index 75d0c1781a483f5358fb86fbe03f7039fbc93378..0ac29d4738594e194b9fc5f50d66836c65afe210 100644 --- a/sd/source/ui/view/drvwshrg.cxx +++ b/sd/source/ui/view/drvwshrg.cxx @@ -29,7 +29,6 @@ #include #include #include -#include #include #include diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index 44ea48a62320a746dc61497a12591c81a55ffd06..48e5e0c0c789da59c2026a341845a3935f1bb958 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -103,7 +103,6 @@ $(eval $(call gb_Library_add_exception_objects,svx,\ svx/source/customshapes/EnhancedCustomShapeEngine \ svx/source/customshapes/EnhancedCustomShapeFontWork \ svx/source/customshapes/EnhancedCustomShapeHandle \ - svx/source/customshapes/tbxcustomshapes \ svx/source/dialog/_bmpmask \ svx/source/dialog/charmap \ svx/source/dialog/connctrl \ diff --git a/svx/source/customshapes/tbxcustomshapes.cxx b/svx/source/customshapes/tbxcustomshapes.cxx deleted file mode 100644 index 7042e7024be2ffe2599c95072d45a2bb02186519..0000000000000000000000000000000000000000 --- a/svx/source/customshapes/tbxcustomshapes.cxx +++ /dev/null @@ -1,157 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include "svx/tbxcustomshapes.hxx" - -SFX_IMPL_TOOLBOX_CONTROL(SvxTbxCtlCustomShapes, SfxBoolItem); - -SvxTbxCtlCustomShapes::SvxTbxCtlCustomShapes( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) : - SfxToolBoxControl( nSlotId, nId, rTbx ), - m_aSubTbxResName( "private:resource/toolbar/" ) -{ - switch( nSlotId ) - { - default : - DBG_ASSERT( false, "SvxTbxCtlCustomShapes: unknown slot executed. ?" ); - //fall-through - case SID_DRAWTBX_CS_BASIC : - { - m_aCommand = ".uno:BasicShapes.diamond"; - m_aSubTbName = "basicshapes"; - } - break; - - case SID_DRAWTBX_CS_SYMBOL : - { - m_aCommand = ".uno:SymbolShapes.smiley"; - m_aSubTbName = "symbolshapes"; - } - break; - - case SID_DRAWTBX_CS_ARROW : - { - m_aCommand = ".uno:ArrowShapes.left-right-arrow"; - m_aSubTbName = "arrowshapes"; - } - break; - case SID_DRAWTBX_CS_FLOWCHART : - { - m_aCommand = ".uno:FlowChartShapes.flowchart-internal-storage"; - m_aSubTbName = "flowchartshapes"; - } - break; - case SID_DRAWTBX_CS_CALLOUT : - { - m_aCommand = ".uno:CalloutShapes.round-rectangular-callout"; - m_aSubTbName = "calloutshapes"; - } - break; - case SID_DRAWTBX_CS_STAR : - { - m_aCommand = ".uno:StarShapes.star5"; - m_aSubTbName = "starshapes"; - } - break; - } - m_aSubTbxResName += m_aSubTbName; - rTbx.SetItemBits( nId, ToolBoxItemBits::DROPDOWN | rTbx.GetItemBits( nId ) ); - rTbx.Invalidate(); -} - -// Notification when the application status has changed -void SvxTbxCtlCustomShapes::StateChanged( sal_uInt16 nSID, SfxItemState eState, - const SfxPoolItem* pState ) -{ - SfxToolBoxControl::StateChanged( nSID, eState, pState ); -} - -// Here is the window created -// The location of the Toolbox is queried through GetToolBox() -// rItemRect are the screen coordinates -VclPtr SvxTbxCtlCustomShapes::CreatePopupWindow() -{ - createAndPositionSubToolBar( m_aSubTbxResName ); - return NULL; -} - - - -void SvxTbxCtlCustomShapes::Select(sal_uInt16 nSelectModifier) -{ - if ( !m_aCommand.isEmpty() ) - { - com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aParamSeq( 1 ); - aParamSeq[0].Name = "KeyModifier"; - aParamSeq[0].Value <<= static_cast< sal_Int16 >( nSelectModifier ); - Dispatch( m_aCommand, aParamSeq ); - } -} - - -sal_Bool SAL_CALL SvxTbxCtlCustomShapes::opensSubToolbar() throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - // We control a sub-toolbar therefore we have to return true. - return sal_True; -} - -OUString SAL_CALL SvxTbxCtlCustomShapes::getSubToolbarName() throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - // Provide the controlled sub-toolbar name, so we are notified whenever - // this toolbar executes a function. - return m_aSubTbName; -} - -void SAL_CALL SvxTbxCtlCustomShapes::functionSelected( const OUString& rCommand ) throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - // remember the new command - m_aCommand = rCommand; - - // Our sub-toolbar wants to execute a function. - // We have to change the image of our toolbar button to reflect the new function. - updateImage(); -} - -void SAL_CALL SvxTbxCtlCustomShapes::updateImage( ) throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - // We should update the button image of our parent (toolbar). - // Use the stored command to set the correct current image. - SolarMutexGuard aGuard; - if ( !m_aCommand.isEmpty() ) - { - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame( getFrameInterface()); - Image aImage = GetImage( xFrame, m_aCommand, hasBigImages() ); - if ( !!aImage ) - GetToolBox().SetItemImage( GetId(), aImage ); - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx index 576c7214205a062519549f48da2bb12c9d4ba251..d26b462cef7d2c861ae0a44e8b97e0715a789404 100644 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -953,7 +953,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index f945531e79c04404d445ab0518e27dcddd69259d..ba06d42122e428356de581a0f4a596c480275269 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -297,13 +296,6 @@ void SwDLL::RegisterControls() SwTbxAutoTextCtrl::RegisterControl(FN_GLOSSARY_DLG, pMod ); svx::ParaLineSpacingPopup::RegisterControl(SID_ATTR_PARA_LINESPACE, pMod); - SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_BASIC, pMod ); - SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_SYMBOL, pMod ); - SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_ARROW, pMod ); - SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_FLOWCHART, pMod ); - SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_CALLOUT, pMod ); - SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_STAR, pMod ); - SvxColorToolBoxControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod ); svx::FontWorkShapeTypeControl::RegisterControl( SID_FONTWORK_SHAPE_TYPE, pMod ); diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx index 460a68bd7dc8663c1c21b7334121b42687d2f3ae..d63451dadc41c775d61c892a2b0032ff3eed291e 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include