Kaydet (Commit) 2aea9e37 authored tarafından Maxim Monastirsky's avatar Maxim Monastirsky

Introduce generic sub toolbar controller

Currently many toolbar controllers are basically doing the
same thing - show some docked toolbar. So the idea here is
to have one generic controller that will handle all these
cases in a unified way. It will get the name of the toolbar
that it's supposed to show from the configuration, based on
the command it was registered for.

Right now it can handle both simple (i.e. with DROPDOWNONLY
bits) and split (i.e. with DROPDOWN bits) scenarios, where
for split kind it replaces the function (and the image) of
the main part of the button, with the last selected function,
for easy reusing. A button is considered to be a split one,
if the name of the initial default command was passed along
with the sub toolbar name, otherwise it will be a simple
button.

The core change is in framework/. Other parts are a usage
example, in form of converting the custom shapes buttons
to this new controller.

Change-Id: I087cc58c3db1889ca69a26546d4f00fe07e2a58d
Reviewed-on: https://gerrit.libreoffice.org/16967Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMaxim Monastirsky <momonasmon@gmail.com>
üst 9c2a8065
...@@ -183,7 +183,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ ...@@ -183,7 +183,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/main/PositionAndSizeHelper \ chart2/source/controller/main/PositionAndSizeHelper \
chart2/source/controller/main/SelectionHelper \ chart2/source/controller/main/SelectionHelper \
chart2/source/controller/main/ShapeController \ chart2/source/controller/main/ShapeController \
chart2/source/controller/main/ShapeToolbarController \
chart2/source/controller/main/StatusBarCommandDispatch \ chart2/source/controller/main/StatusBarCommandDispatch \
chart2/source/controller/main/UndoActions \ chart2/source/controller/main/UndoActions \
chart2/source/controller/main/UndoCommandDispatch \ chart2/source/controller/main/UndoCommandDispatch \
......
...@@ -270,7 +270,6 @@ ...@@ -270,7 +270,6 @@
#include <svx/svxdlg.hxx> #include <svx/svxdlg.hxx>
#include <svx/svxgrahicitem.hxx> #include <svx/svxgrahicitem.hxx>
#include <svx/tabline.hxx> #include <svx/tabline.hxx>
#include <svx/tbxcustomshapes.hxx>
#include <svx/unoapi.hxx> #include <svx/unoapi.hxx>
#include <svx/unofill.hxx> #include <svx/unofill.hxx>
#include <svx/unomodel.hxx> #include <svx/unomodel.hxx>
......
...@@ -43,10 +43,6 @@ ...@@ -43,10 +43,6 @@
constructor="com_sun_star_comp_chart2_ChartTypeDialog_get_implementation"> constructor="com_sun_star_comp_chart2_ChartTypeDialog_get_implementation">
<service name="com.sun.star.chart2.ChartTypeDialog"/> <service name="com.sun.star.chart2.ChartTypeDialog"/>
</implementation> </implementation>
<implementation name="com.sun.star.comp.chart2.ShapeToolbarController"
constructor="com_sun_star_comp_chart2_ShapeToolbarController_get_implementation">
<service name="com.sun.star.chart2.ShapeToolbarController"/>
</implementation>
<implementation name="com.sun.star.comp.chart2.WizardDialog" <implementation name="com.sun.star.comp.chart2.WizardDialog"
constructor="com_sun_star_comp_chart2_WizardDialog_get_implementation"> constructor="com_sun_star_comp_chart2_WizardDialog_get_implementation">
<service name="com.sun.star.chart2.WizardDialog"/> <service name="com.sun.star.chart2.WizardDialog"/>
......
/* -*- 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 <sal/config.h>
#include <map>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/frame/XSubToolbarController.hpp>
#include <cppuhelper/implbase2.hxx>
#include <rtl/ref.hxx>
#include <svtools/toolboxcontroller.hxx>
class SfxToolBoxControl;
namespace chart
{
typedef ::cppu::ImplHelper2 < ::com::sun::star::lang::XServiceInfo,
::com::sun::star::frame::XSubToolbarController> ShapeToolbarController_Base;
typedef rtl::Reference<SfxToolBoxControl> TToolbarHelper;
class ShapeToolbarController : public ::svt::ToolboxController
,public ShapeToolbarController_Base
{
typedef std::map<OUString, sal_Bool> 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: */
...@@ -151,6 +151,7 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\ ...@@ -151,6 +151,7 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
framework/source/uielement/statusbarmerger \ framework/source/uielement/statusbarmerger \
framework/source/uielement/statusbarwrapper \ framework/source/uielement/statusbarwrapper \
framework/source/uielement/statusindicatorinterfacewrapper \ framework/source/uielement/statusindicatorinterfacewrapper \
framework/source/uielement/subtoolbarcontroller \
framework/source/uielement/togglebuttontoolbarcontroller \ framework/source/uielement/togglebuttontoolbarcontroller \
framework/source/uielement/toolbarmanager \ framework/source/uielement/toolbarmanager \
framework/source/uielement/toolbarmerger \ framework/source/uielement/toolbarmerger \
......
...@@ -46,7 +46,7 @@ class ConfigurationAccess_ControllerFactory : // interfaces ...@@ -46,7 +46,7 @@ class ConfigurationAccess_ControllerFactory : // interfaces
public ::cppu::WeakImplHelper1< ::com::sun::star::container::XContainerListener> public ::cppu::WeakImplHelper1< ::com::sun::star::container::XContainerListener>
{ {
public: 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(); virtual ~ConfigurationAccess_ControllerFactory();
void readConfigurationData(); void readConfigurationData();
...@@ -56,7 +56,6 @@ public: ...@@ -56,7 +56,6 @@ public:
OUString getValueFromCommandModule( const OUString& rCommandURL, const OUString& rModule ) const; OUString getValueFromCommandModule( const OUString& rCommandURL, const OUString& rModule ) const;
void addServiceToCommandModule( const OUString& rCommandURL, const OUString& rModule, const OUString& rServiceSpecifier ); void addServiceToCommandModule( const OUString& rCommandURL, const OUString& rModule, const OUString& rServiceSpecifier );
void removeServiceFromCommandModule( const OUString& rCommandURL, const OUString& rModule ); void removeServiceFromCommandModule( const OUString& rCommandURL, const OUString& rModule );
inline bool hasValue() const { return m_bAskValue; }
// container.XContainerListener // container.XContainerListener
virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; 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: ...@@ -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::XNameAccess > m_xConfigAccess;
::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener > m_xConfigAccessListener; ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener > m_xConfigAccessListener;
bool m_bConfigAccessInitialized; bool m_bConfigAccessInitialized;
bool m_bAskValue;
}; };
} // namespace framework } // namespace framework
......
...@@ -54,14 +54,13 @@ OUString getHashKeyFromStrings( const OUString& aCommandURL, const OUString& aMo ...@@ -54,14 +54,13 @@ OUString getHashKeyFromStrings( const OUString& aCommandURL, const OUString& aMo
// XInterface, XTypeProvider // 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_aPropCommand( "Command" ),
m_aPropModule( "Module" ), m_aPropModule( "Module" ),
m_aPropController( "Controller" ), m_aPropController( "Controller" ),
m_aPropValue( "Value" ), m_aPropValue( "Value" ),
m_sRoot(_sRoot), m_sRoot(_sRoot),
m_bConfigAccessInitialized( false ), m_bConfigAccessInitialized( false )
m_bAskValue(_bAskValue)
{ {
m_xConfigProvider = configuration::theDefaultProvider::get( rxContext ); m_xConfigProvider = configuration::theDefaultProvider::get( rxContext );
} }
...@@ -276,8 +275,7 @@ bool ConfigurationAccess_ControllerFactory::impl_getElementProps( const Any& aEl ...@@ -276,8 +275,7 @@ bool ConfigurationAccess_ControllerFactory::impl_getElementProps( const Any& aEl
xPropertySet->getPropertyValue( m_aPropCommand ) >>= aCommand; xPropertySet->getPropertyValue( m_aPropCommand ) >>= aCommand;
xPropertySet->getPropertyValue( m_aPropModule ) >>= aModule; xPropertySet->getPropertyValue( m_aPropModule ) >>= aModule;
xPropertySet->getPropertyValue( m_aPropController ) >>= aServiceSpecifier; 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& ) catch ( const com::sun::star::beans::UnknownPropertyException& )
{ {
......
...@@ -147,8 +147,7 @@ throw (Exception, RuntimeException, std::exception) ...@@ -147,8 +147,7 @@ throw (Exception, RuntimeException, std::exception)
Sequence< Any > aNewArgs( Arguments ); Sequence< Any > aNewArgs( Arguments );
sal_Int32 nAppendIndex = aNewArgs.getLength(); sal_Int32 nAppendIndex = aNewArgs.getLength();
bool bHasValue = m_pConfigAccess->hasValue(); aNewArgs.realloc( aNewArgs.getLength() + 2 );
aNewArgs.realloc( aNewArgs.getLength() + (bHasValue ? 2 : 1) );
// Append the command URL to the Arguments sequence so that one controller can be // Append the command URL to the Arguments sequence so that one controller can be
// used for more than one command URL. // used for more than one command URL.
...@@ -156,15 +155,12 @@ throw (Exception, RuntimeException, std::exception) ...@@ -156,15 +155,12 @@ throw (Exception, RuntimeException, std::exception)
aPropValue.Value <<= ServiceSpecifier; aPropValue.Value <<= ServiceSpecifier;
aNewArgs[nAppendIndex] <<= aPropValue; aNewArgs[nAppendIndex] <<= aPropValue;
if ( bHasValue ) // Append the optional value argument. It's an empty string if no additional info
{ // is provided to the controller.
// Append the optional value argument. It's an empty string if no additional info OUString aValue = m_pConfigAccess->getValueFromCommandModule( ServiceSpecifier, aPropName );
// is provided to the controller. aPropValue.Name = aPropValueName;
OUString aValue = m_pConfigAccess->getValueFromCommandModule( ServiceSpecifier, aPropName ); aPropValue.Value <<= aValue;
aPropValue.Name = aPropValueName; aNewArgs[nAppendIndex+1] <<= aPropValue;
aPropValue.Value <<= aValue;
aNewArgs[nAppendIndex+1] <<= aPropValue;
}
{ {
OUString aServiceName; OUString aServiceName;
......
...@@ -196,4 +196,8 @@ ...@@ -196,4 +196,8 @@
constructor="org_apache_openoffice_comp_framework_WizardsToolbarController_get_implementation"> constructor="org_apache_openoffice_comp_framework_WizardsToolbarController_get_implementation">
<service name="com.sun.star.frame.ToolbarController"/> <service name="com.sun.star.frame.ToolbarController"/>
</implementation> </implementation>
<implementation name="com.sun.star.comp.framework.SubToolBarController"
constructor="com_sun_star_comp_framework_SubToolBarController_get_implementation">
<service name="com.sun.star.frame.ToolbarController"/>
</implementation>
</component> </component>
/* -*- 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 <sfx2/tbxctrl.hxx>
#include <svx/svxdllapi.h>
/*************************************************************************
|*
|* 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<SfxPopupWindow> 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: */
...@@ -341,70 +341,88 @@ ...@@ -341,70 +341,88 @@
<value>com.sun.star.comp.chart.ElementSelectorToolbarController</value> <value>com.sun.star.comp.chart.ElementSelectorToolbarController</value>
</prop> </prop>
</node> </node>
<node oor:name="com.sun.star.chart2.BasicShapesToolbarController" oor:op="replace"> <node oor:name="BasicShapesToolbarController" oor:op="replace">
<prop oor:name="Command"> <prop oor:name="Command">
<value>.uno:BasicShapes</value> <value>.uno:BasicShapes</value>
</prop> </prop>
<prop oor:name="Module"> <prop oor:name="Module">
<value>com.sun.star.chart2.ChartDocument</value> <value/>
</prop> </prop>
<prop oor:name="Controller"> <prop oor:name="Controller">
<value>com.sun.star.comp.chart2.ShapeToolbarController</value> <value>com.sun.star.comp.framework.SubToolBarController</value>
</prop>
<prop oor:name="Value">
<value>basicshapes;.uno:BasicShapes.diamond</value>
</prop> </prop>
</node> </node>
<node oor:name="com.sun.star.chart2.SymbolShapesToolbarController" oor:op="replace"> <node oor:name="SymbolShapesToolbarController" oor:op="replace">
<prop oor:name="Command"> <prop oor:name="Command">
<value>.uno:SymbolShapes</value> <value>.uno:SymbolShapes</value>
</prop> </prop>
<prop oor:name="Module"> <prop oor:name="Module">
<value>com.sun.star.chart2.ChartDocument</value> <value/>
</prop> </prop>
<prop oor:name="Controller"> <prop oor:name="Controller">
<value>com.sun.star.comp.chart2.ShapeToolbarController</value> <value>com.sun.star.comp.framework.SubToolBarController</value>
</prop>
<prop oor:name="Value">
<value>symbolshapes;.uno:SymbolShapes.smiley</value>
</prop> </prop>
</node> </node>
<node oor:name="com.sun.star.chart2.ArrowShapesToolbarController" oor:op="replace"> <node oor:name="ArrowShapesToolbarController" oor:op="replace">
<prop oor:name="Command"> <prop oor:name="Command">
<value>.uno:ArrowShapes</value> <value>.uno:ArrowShapes</value>
</prop> </prop>
<prop oor:name="Module"> <prop oor:name="Module">
<value>com.sun.star.chart2.ChartDocument</value> <value/>
</prop> </prop>
<prop oor:name="Controller"> <prop oor:name="Controller">
<value>com.sun.star.comp.chart2.ShapeToolbarController</value> <value>com.sun.star.comp.framework.SubToolBarController</value>
</prop>
<prop oor:name="Value">
<value>arrowshapes;.uno:ArrowShapes.left-right-arrow</value>
</prop> </prop>
</node> </node>
<node oor:name="com.sun.star.chart2.FlowChartShapesToolbarController" oor:op="replace"> <node oor:name="FlowChartShapesToolbarController" oor:op="replace">
<prop oor:name="Command"> <prop oor:name="Command">
<value>.uno:FlowChartShapes</value> <value>.uno:FlowChartShapes</value>
</prop> </prop>
<prop oor:name="Module"> <prop oor:name="Module">
<value>com.sun.star.chart2.ChartDocument</value> <value/>
</prop> </prop>
<prop oor:name="Controller"> <prop oor:name="Controller">
<value>com.sun.star.comp.chart2.ShapeToolbarController</value> <value>com.sun.star.comp.framework.SubToolBarController</value>
</prop>
<prop oor:name="Value">
<value>flowchartshapes;.uno:FlowChartShapes.flowchart-internal-storage</value>
</prop> </prop>
</node> </node>
<node oor:name="com.sun.star.chart2.CalloutShapesToolbarController" oor:op="replace"> <node oor:name="CalloutShapesToolbarController" oor:op="replace">
<prop oor:name="Command"> <prop oor:name="Command">
<value>.uno:CalloutShapes</value> <value>.uno:CalloutShapes</value>
</prop> </prop>
<prop oor:name="Module"> <prop oor:name="Module">
<value>com.sun.star.chart2.ChartDocument</value> <value/>
</prop> </prop>
<prop oor:name="Controller"> <prop oor:name="Controller">
<value>com.sun.star.comp.chart2.ShapeToolbarController</value> <value>com.sun.star.comp.framework.SubToolBarController</value>
</prop>
<prop oor:name="Value">
<value>calloutshapes;.uno:CalloutShapes.round-rectangular-callout</value>
</prop> </prop>
</node> </node>
<node oor:name="com.sun.star.chart2.StarShapesToolbarController" oor:op="replace"> <node oor:name="StarShapesToolbarController" oor:op="replace">
<prop oor:name="Command"> <prop oor:name="Command">
<value>.uno:StarShapes</value> <value>.uno:StarShapes</value>
</prop> </prop>
<prop oor:name="Module"> <prop oor:name="Module">
<value>com.sun.star.chart2.ChartDocument</value> <value/>
</prop> </prop>
<prop oor:name="Controller"> <prop oor:name="Controller">
<value>com.sun.star.comp.chart2.ShapeToolbarController</value> <value>com.sun.star.comp.framework.SubToolBarController</value>
</prop>
<prop oor:name="Value">
<value>starshapes;.uno:StarShapes.star5</value>
</prop> </prop>
</node> </node>
<node oor:name="com.sun.star.svx.FindTextToolboxController" oor:op="replace"> <node oor:name="com.sun.star.svx.FindTextToolboxController" oor:op="replace">
...@@ -517,72 +535,6 @@ ...@@ -517,72 +535,6 @@
<value>com.sun.star.report.ReportToolboxController</value> <value>com.sun.star.report.ReportToolboxController</value>
</prop> </prop>
</node> </node>
<node oor:name="c7" oor:op="replace" install:module="reportbuilder">
<prop oor:name="Command">
<value>.uno:BasicShapes</value>
</prop>
<prop oor:name="Module">
<value>com.sun.star.report.ReportDefinition</value>
</prop>
<prop oor:name="Controller">
<value>com.sun.star.report.ReportToolboxController</value>
</prop>
</node>
<node oor:name="c8" oor:op="replace" install:module="reportbuilder">
<prop oor:name="Command">
<value>.uno:SymbolShapes</value>
</prop>
<prop oor:name="Module">
<value>com.sun.star.report.ReportDefinition</value>
</prop>
<prop oor:name="Controller">
<value>com.sun.star.report.ReportToolboxController</value>
</prop>
</node>
<node oor:name="c9" oor:op="replace" install:module="reportbuilder">
<prop oor:name="Command">
<value>.uno:ArrowShapes</value>
</prop>
<prop oor:name="Module">
<value>com.sun.star.report.ReportDefinition</value>
</prop>
<prop oor:name="Controller">
<value>com.sun.star.report.ReportToolboxController</value>
</prop>
</node>
<node oor:name="c10" oor:op="replace" install:module="reportbuilder">
<prop oor:name="Command">
<value>.uno:FlowChartShapes</value>
</prop>
<prop oor:name="Module">
<value>com.sun.star.report.ReportDefinition</value>
</prop>
<prop oor:name="Controller">
<value>com.sun.star.report.ReportToolboxController</value>
</prop>
</node>
<node oor:name="c11" oor:op="replace" install:module="reportbuilder">
<prop oor:name="Command">
<value>.uno:CalloutShapes</value>
</prop>
<prop oor:name="Module">
<value>com.sun.star.report.ReportDefinition</value>
</prop>
<prop oor:name="Controller">
<value>com.sun.star.report.ReportToolboxController</value>
</prop>
</node>
<node oor:name="c12" oor:op="replace" install:module="reportbuilder">
<prop oor:name="Command">
<value>.uno:StarShapes</value>
</prop>
<prop oor:name="Module">
<value>com.sun.star.report.ReportDefinition</value>
</prop>
<prop oor:name="Controller">
<value>com.sun.star.report.ReportToolboxController</value>
</prop>
</node>
<node oor:name="c14" oor:op="replace" install:module="reportbuilder"> <node oor:name="c14" oor:op="replace" install:module="reportbuilder">
<prop oor:name="Command"> <prop oor:name="Command">
<value>.uno:CharFontName</value> <value>.uno:CharFontName</value>
......
...@@ -257,7 +257,6 @@ ...@@ -257,7 +257,6 @@
#include <svx/svxdlg.hxx> #include <svx/svxdlg.hxx>
#include <svx/tbcontrl.hxx> #include <svx/tbcontrl.hxx>
#include <svx/tbxcolorupdate.hxx> #include <svx/tbxcolorupdate.hxx>
#include <svx/tbxcustomshapes.hxx>
#include <svx/unopage.hxx> #include <svx/unopage.hxx>
#include <svx/unoprov.hxx> #include <svx/unoprov.hxx>
#include <svx/unoshape.hxx> #include <svx/unoshape.hxx>
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include <editeng/fhgtitem.hxx> #include <editeng/fhgtitem.hxx>
#include <svx/tbcontrl.hxx> #include <svx/tbcontrl.hxx>
#include <editeng/colritem.hxx> #include <editeng/colritem.hxx>
#include <svx/tbxcustomshapes.hxx>
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
...@@ -140,37 +139,7 @@ void SAL_CALL OToolboxController::initialize( const Sequence< Any >& _rArguments ...@@ -140,37 +139,7 @@ void SAL_CALL OToolboxController::initialize( const Sequence< Any >& _rArguments
break; break;
} }
} }
if ( m_aCommandURL == ".uno:BasicShapes" ) if ( m_aCommandURL == ".uno:CharFontName" )
{
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" )
{ {
m_aStates.insert(TCommandState::value_type(OUString(".uno:CharFontName"),sal_True)); 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); 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 ...@@ -208,9 +177,6 @@ void SAL_CALL OToolboxController::statusChanged( const FeatureStateEvent& Event
if ( m_pToolbarController.is() ) if ( m_pToolbarController.is() )
{ {
// All other status events will be processed here // 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(); ToolBox& rTb = m_pToolbarController->GetToolBox();
for ( sal_uInt16 i = 0; i < rTb.GetItemCount(); i++ ) for ( sal_uInt16 i = 0; i < rTb.GetItemCount(); i++ )
{ {
...@@ -223,20 +189,6 @@ void SAL_CALL OToolboxController::statusChanged( const FeatureStateEvent& Event ...@@ -223,20 +189,6 @@ void SAL_CALL OToolboxController::statusChanged( const FeatureStateEvent& Event
{ {
// Enable/disable item // Enable/disable item
rTb.EnableItem( nId, Event.IsEnabled ); 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 ...@@ -289,21 +241,11 @@ sal_Bool SAL_CALL OToolboxController::opensSubToolbar() throw (uno::RuntimeExcep
OUString SAL_CALL OToolboxController::getSubToolbarName() throw (uno::RuntimeException, std::exception) OUString SAL_CALL OToolboxController::getSubToolbarName() throw (uno::RuntimeException, std::exception)
{ {