framework/Library_fwk.mk | 1 framework/inc/services/layoutmanager.hxx | 6 framework/inc/uielement/addonstoolbarmanager.hxx | 6 framework/inc/uielement/buttontoolbarcontroller.hxx | 7 framework/inc/uielement/comboboxtoolbarcontroller.hxx | 3 framework/inc/uielement/complextoolbarcontroller.hxx | 8 framework/inc/uielement/dropdownboxtoolbarcontroller.hxx | 10 framework/inc/uielement/edittoolbarcontroller.hxx | 10 framework/inc/uielement/generictoolbarcontroller.hxx | 11 framework/inc/uielement/imagebuttontoolbarcontroller.hxx | 8 framework/inc/uielement/spinfieldtoolbarcontroller.hxx | 10 framework/inc/uielement/togglebuttontoolbarcontroller.hxx | 13 - framework/inc/uielement/toolbar.hxx | 62 ----- framework/inc/uielement/toolbarmanager.hxx | 25 +- framework/source/layoutmanager/layoutmanager.cxx | 31 +- framework/source/layoutmanager/toolbarlayoutmanager.cxx | 136 ----------- framework/source/uielement/addonstoolbarmanager.cxx | 4 framework/source/uielement/addonstoolbarwrapper.cxx | 7 framework/source/uielement/buttontoolbarcontroller.cxx | 3 framework/source/uielement/comboboxtoolbarcontroller.cxx | 2 framework/source/uielement/complextoolbarcontroller.cxx | 3 framework/source/uielement/dropdownboxtoolbarcontroller.cxx | 3 framework/source/uielement/edittoolbarcontroller.cxx | 3 framework/source/uielement/generictoolbarcontroller.cxx | 2 framework/source/uielement/imagebuttontoolbarcontroller.cxx | 2 framework/source/uielement/spinfieldtoolbarcontroller.cxx | 3 framework/source/uielement/togglebuttontoolbarcontroller.cxx | 8 framework/source/uielement/toolbar.cxx | 65 ----- framework/source/uielement/toolbarmanager.cxx | 6 framework/source/uielement/toolbarwrapper.cxx | 7 vcl/inc/vcl/toolbox.hxx | 9 vcl/source/window/toolbox.cxx | 9 32 files changed, 129 insertions(+), 354 deletions(-)
New commits: commit 5d67919a5810cf05d6fe53dc14f2b1f073c56719 Author: Jan Holesovsky <ke...@suse.cz> Date: Wed Apr 10 10:37:48 2013 +0200 Kill the ToolBar class, move the needed bits directly to ToolBox. Change-Id: I6aaa396931ce613be64026b53372dc24c6189724 diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk index b1b1660..1ca1ddc 100644 --- a/framework/Library_fwk.mk +++ b/framework/Library_fwk.mk @@ -145,7 +145,6 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\ framework/source/uielement/statusbarwrapper \ framework/source/uielement/statusindicatorinterfacewrapper \ framework/source/uielement/togglebuttontoolbarcontroller \ - framework/source/uielement/toolbar \ framework/source/uielement/toolbarmanager \ framework/source/uielement/toolbarmerger \ framework/source/uielement/toolbarwrapper \ diff --git a/framework/inc/uielement/addonstoolbarmanager.hxx b/framework/inc/uielement/addonstoolbarmanager.hxx index eb6b1db..53384bb 100644 --- a/framework/inc/uielement/addonstoolbarmanager.hxx +++ b/framework/inc/uielement/addonstoolbarmanager.hxx @@ -37,20 +37,18 @@ #include <cppuhelper/weak.hxx> #include <cppuhelper/interfacecontainer.hxx> -#include <vcl/toolbox.hxx> - +class ToolBox; namespace framework { -class ToolBar; class AddonsToolBarManager : public ToolBarManager { public: AddonsToolBarManager( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, const OUString& rResourceName, - ToolBar* pToolBar ); + ToolBox* pToolBar ); virtual ~AddonsToolBarManager(); // XComponent diff --git a/framework/inc/uielement/buttontoolbarcontroller.hxx b/framework/inc/uielement/buttontoolbarcontroller.hxx index 328b3c3..368062d 100644 --- a/framework/inc/uielement/buttontoolbarcontroller.hxx +++ b/framework/inc/uielement/buttontoolbarcontroller.hxx @@ -30,15 +30,16 @@ #include <com/sun/star/frame/ControlCommand.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/frame/XToolbarController.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <comphelper/broadcasthelper.hxx> #include <cppuhelper/weak.hxx> -#include <vcl/toolbox.hxx> + +class ToolBox; namespace framework { -class ToolBar; class ButtonToolbarController : public ::com::sun::star::frame::XStatusListener, public ::com::sun::star::frame::XToolbarController, public ::com::sun::star::lang::XInitialization, @@ -49,7 +50,7 @@ class ButtonToolbarController : public ::com::sun::star::frame::XStatusListener, { public: ButtonToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, - ToolBox* pToolBar, + ToolBox* pToolBar, const OUString& aCommand ); virtual ~ButtonToolbarController(); diff --git a/framework/inc/uielement/comboboxtoolbarcontroller.hxx b/framework/inc/uielement/comboboxtoolbarcontroller.hxx index 8fa205f..442dcd9 100644 --- a/framework/inc/uielement/comboboxtoolbarcontroller.hxx +++ b/framework/inc/uielement/comboboxtoolbarcontroller.hxx @@ -26,10 +26,11 @@ #include <uielement/complextoolbarcontroller.hxx> +#include <vcl/event.hxx> + namespace framework { -class ToolBar; class ComboBoxControl; class IComboBoxListener diff --git a/framework/inc/uielement/complextoolbarcontroller.hxx b/framework/inc/uielement/complextoolbarcontroller.hxx index 3d28cf6..9bb3848 100644 --- a/framework/inc/uielement/complextoolbarcontroller.hxx +++ b/framework/inc/uielement/complextoolbarcontroller.hxx @@ -27,8 +27,10 @@ #include <com/sun/star/frame/XControlNotificationListener.hpp> #include <svtools/toolboxcontroller.hxx> +#include <tools/link.hxx> -#include <vcl/toolbox.hxx> +class ToolBox; +class Window; namespace framework { @@ -48,15 +50,13 @@ struct NotifyInfo ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > aInfoSeq; }; -class ToolBar; - class ComplexToolbarController : public svt::ToolboxController { public: ComplexToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, - ToolBox* pToolBar, + ToolBox* pToolBar, sal_uInt16 nID, const OUString& aCommand ); virtual ~ComplexToolbarController(); diff --git a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx index 6757d11..5886de1 100644 --- a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx +++ b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx @@ -25,13 +25,13 @@ #include <com/sun/star/frame/ControlCommand.hpp> #include <uielement/complextoolbarcontroller.hxx> -#include <vcl/toolbox.hxx> #include <vcl/lstbox.hxx> +class ToolBox; + namespace framework { -class ToolBar; class ListBoxControl; class IListBoxListener @@ -53,9 +53,9 @@ class DropdownToolbarController : public IListBoxListener, public: DropdownToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, - ToolBox* pToolBar, - sal_uInt16 nID, - sal_Int32 nWidth, + ToolBox* pToolBar, + sal_uInt16 nID, + sal_Int32 nWidth, const OUString& aCommand ); virtual ~DropdownToolbarController(); diff --git a/framework/inc/uielement/edittoolbarcontroller.hxx b/framework/inc/uielement/edittoolbarcontroller.hxx index 5905819..c231d0d 100644 --- a/framework/inc/uielement/edittoolbarcontroller.hxx +++ b/framework/inc/uielement/edittoolbarcontroller.hxx @@ -25,13 +25,13 @@ #include <com/sun/star/frame/ControlCommand.hpp> #include <uielement/complextoolbarcontroller.hxx> -#include <vcl/toolbox.hxx> #include <vcl/edit.hxx> +class ToolBox; + namespace framework { -class ToolBar; class EditControl; class IEditListener @@ -54,9 +54,9 @@ class EditToolbarController : public IEditListener, public: EditToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, - ToolBox* pToolBar, - sal_uInt16 nID, - sal_Int32 nWidth, + ToolBox* pToolBar, + sal_uInt16 nID, + sal_Int32 nWidth, const OUString& aCommand ); virtual ~EditToolbarController(); diff --git a/framework/inc/uielement/generictoolbarcontroller.hxx b/framework/inc/uielement/generictoolbarcontroller.hxx index 2eb1697..7ece0f1 100644 --- a/framework/inc/uielement/generictoolbarcontroller.hxx +++ b/framework/inc/uielement/generictoolbarcontroller.hxx @@ -21,23 +21,24 @@ #define __FRAMEWORK_UIELEMENT_GENERICTOOLBARCONTROLLER_HXX_ #include <svtools/toolboxcontroller.hxx> -#include <vcl/toolbox.hxx> #include <memory> +#include <tools/link.hxx> + class PopupMenu; +class ToolBox; namespace framework { struct ExecuteInfo; -class ToolBar; class GenericToolbarController : public svt::ToolboxController { public: GenericToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, ToolBox* pToolBar, - sal_uInt16 nID, + sal_uInt16 nID, const OUString& aCommand ); virtual ~GenericToolbarController(); @@ -50,7 +51,7 @@ class GenericToolbarController : public svt::ToolboxController // XStatusListener virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ); - DECL_STATIC_LINK( GenericToolbarController, ExecuteHdl_Impl, ExecuteInfo* ); + DECL_STATIC_LINK( GenericToolbarController, ExecuteHdl_Impl, ExecuteInfo* ); protected: ToolBox* m_pToolbar; @@ -70,7 +71,7 @@ class MenuToolbarController : public GenericToolbarController MenuToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, ToolBox* pToolBar, - sal_uInt16 nID, + sal_uInt16 nID, const OUString& aCommand, const OUString& aModuleIdentifier, const com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess >& xMenuDesc ); diff --git a/framework/inc/uielement/imagebuttontoolbarcontroller.hxx b/framework/inc/uielement/imagebuttontoolbarcontroller.hxx index c5066d8..7513515 100644 --- a/framework/inc/uielement/imagebuttontoolbarcontroller.hxx +++ b/framework/inc/uielement/imagebuttontoolbarcontroller.hxx @@ -25,21 +25,21 @@ #include <com/sun/star/frame/ControlCommand.hpp> #include <uielement/complextoolbarcontroller.hxx> -#include <vcl/toolbox.hxx> #include <vcl/image.hxx> +class ToolBox; + namespace framework { -class ToolBar; class ImageButtonToolbarController : public ComplexToolbarController { public: ImageButtonToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, - ToolBox* pToolBar, - sal_uInt16 nID, + ToolBox* pToolBar, + sal_uInt16 nID, const OUString& aCommand ); virtual ~ImageButtonToolbarController(); diff --git a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx index ca30f4f..d54b265 100644 --- a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx +++ b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx @@ -25,13 +25,13 @@ #include <com/sun/star/frame/ControlCommand.hpp> #include <uielement/complextoolbarcontroller.hxx> -#include <vcl/toolbox.hxx> #include <vcl/spinfld.hxx> +class ToolBox; + namespace framework { -class ToolBar; class SpinfieldControl; class ISpinfieldListener @@ -60,9 +60,9 @@ class SpinfieldToolbarController : public ISpinfieldListener, public: SpinfieldToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, - ToolBox* pToolBar, - sal_uInt16 nID, - sal_Int32 nWidth, + ToolBox* pToolBar, + sal_uInt16 nID, + sal_Int32 nWidth, const OUString& aCommand ); virtual ~SpinfieldToolbarController(); diff --git a/framework/inc/uielement/togglebuttontoolbarcontroller.hxx b/framework/inc/uielement/togglebuttontoolbarcontroller.hxx index a33e226..ab8e6b4 100644 --- a/framework/inc/uielement/togglebuttontoolbarcontroller.hxx +++ b/framework/inc/uielement/togglebuttontoolbarcontroller.hxx @@ -25,13 +25,14 @@ #include <com/sun/star/frame/ControlCommand.hpp> #include <uielement/complextoolbarcontroller.hxx> -#include <vcl/toolbox.hxx> -#include <vcl/image.hxx> +#include <tools/link.hxx> + +class Menu; +class ToolBox; namespace framework { -class ToolBar; class ToggleButtonToolbarController : public ComplexToolbarController { @@ -45,9 +46,9 @@ class ToggleButtonToolbarController : public ComplexToolbarController ToggleButtonToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, - ToolBox* pToolBar, - sal_uInt16 nID, - Style eStyle, + ToolBox* pToolBar, + sal_uInt16 nID, + Style eStyle, const OUString& aCommand ); virtual ~ToggleButtonToolbarController(); diff --git a/framework/inc/uielement/toolbar.hxx b/framework/inc/uielement/toolbar.hxx deleted file mode 100644 index b7ac587..0000000 --- a/framework/inc/uielement/toolbar.hxx +++ /dev/null @@ -1,57 +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 __FRAMEWORK_UIELEMENT_TOOLBAR_HXX_ -#define __FRAMEWORK_UIELEMENT_TOOLBAR_HXX_ - -#include <vcl/toolbox.hxx> - -namespace framework -{ - -class ToolBarManager; -class ToolBar : public ToolBox -{ - public: - ToolBar( Window* pParent, WinBits nWinBits ); - virtual ~ToolBar(); - - virtual void Command ( const CommandEvent& rCEvt ); - virtual void StateChanged( StateChangedType nType ); - virtual void DataChanged( const DataChangedEvent& rDCEvt ); - - // Provide additional handlers to support external implementations - void SetCommandHdl( const Link& aLink ) { m_aCommandHandler = aLink; } - const Link& GetCommandHdl() const { return m_aCommandHandler; } - void SetStateChangedHdl( const Link& aLink ) { m_aStateChangedHandler = aLink; } - const Link& GetStateChangedHdl() const { return m_aStateChangedHandler; } - void SetDataChangedHdl( const Link& aLink ) { m_aDataChangedHandler = aLink; } - const Link& GetDataChangedHdl() { return m_aDataChangedHandler; } - - private: - Link m_aCommandHandler; - Link m_aStateChangedHandler; - Link m_aDataChangedHandler; -}; - -} - -#endif // __FRAMEWORK_UIELEMENT_TOOLBAR_HXX_ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx index 572bb6b..3e05868 100644 --- a/framework/inc/uielement/toolbarmanager.hxx +++ b/framework/inc/uielement/toolbarmanager.hxx @@ -43,18 +43,22 @@ #include <com/sun/star/ui/ItemStyle.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/ui/XAcceleratorConfiguration.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <rtl/ustring.hxx> #include <cppuhelper/weak.hxx> #include <cppuhelper/interfacecontainer.hxx> -#include <vcl/toolbox.hxx> -#include <vcl/accel.hxx> +#include <tools/link.hxx> +#include <vcl/window.hxx> +#include <vcl/timer.hxx> + +class PopupMenu; +class ToolBox; namespace framework { -class ToolBar; class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener , public ::com::sun::star::frame::XStatusListener , public ::com::sun::star::lang::XComponent , @@ -67,7 +71,7 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener ToolBarManager( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, const OUString& rResourceName, - ToolBar* pToolBar ); + ToolBox* pToolBar ); virtual ~ToolBarManager(); // XInterface, XTypeProvider, XServiceInfo @@ -175,6 +179,7 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener typedef BaseHash< SubToolBarControllerVector > SubToolBarToSubToolBarControllerMap; typedef ::boost::unordered_map< sal_uInt16, ::com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > > MenuDescriptionMap; + bool m_bDisposed : 1, m_bSmallSymbols : 1, m_bModuleIdentified : 1, @@ -183,10 +188,14 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener m_bUpdateControllers : 1, m_bImageOrientationRegistered : 1, m_bImageMirrored : 1; - long m_lImageRotation; - ToolBar* m_pToolBar; - OUString m_aModuleIdentifier; - OUString m_aResourceName; + + long m_lImageRotation; + + ToolBox* m_pToolBar; + + OUString m_aModuleIdentifier; + OUString m_aResourceName; + com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer; com::sun::star::uno::Reference< com::sun::star::frame::XFrame > m_xFrame; com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > m_xUICommandLabels; diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx index 4e897c0..b0992ee 100644 --- a/framework/source/uielement/addonstoolbarmanager.cxx +++ b/framework/source/uielement/addonstoolbarmanager.cxx @@ -20,7 +20,6 @@ #include <uielement/addonstoolbarmanager.hxx> #include <uielement/toolbarmerger.hxx> -#include <uielement/toolbar.hxx> #include <uielement/generictoolbarcontroller.hxx> #include <threadhelp/resetableguard.hxx> #include "services.h" @@ -55,6 +54,7 @@ #include <vcl/menu.hxx> #include <vcl/syswin.hxx> #include <vcl/taskpanelist.hxx> +#include <vcl/toolbox.hxx> //_________________________________________________________________________________________________________________ // namespaces @@ -78,7 +78,7 @@ static const char TOOLBOXITEM_SEPARATOR_STR[] = "private:separator"; AddonsToolBarManager::AddonsToolBarManager( const Reference< XComponentContext >& rxContext, const Reference< XFrame >& rFrame, const OUString& rResourceName, - ToolBar* pToolBar ) : + ToolBox* pToolBar ) : ToolBarManager( rxContext, rFrame, rResourceName, pToolBar ) { m_pToolBar->SetMenuType( TOOLBOX_MENUTYPE_CLIPPEDITEMS ); diff --git a/framework/source/uielement/addonstoolbarwrapper.cxx b/framework/source/uielement/addonstoolbarwrapper.cxx index 75a9fb2..2921b02 100644 --- a/framework/source/uielement/addonstoolbarwrapper.cxx +++ b/framework/source/uielement/addonstoolbarwrapper.cxx @@ -24,8 +24,6 @@ #include <uielement/rootitemcontainer.hxx> #include <uielement/addonstoolbarmanager.hxx> -#include <uielement/toolbar.hxx> - #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -108,7 +106,7 @@ void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArgument if ( xFrame.is() && m_aConfigData.getLength() > 0 ) { // Create VCL based toolbar which will be filled with settings data - ToolBar* pToolBar = 0; + ToolBox* pToolBar = 0; AddonsToolBarManager* pToolBarManager = 0; { SolarMutexGuard aSolarMutexGuard; @@ -117,7 +115,7 @@ void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArgument { sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE; - pToolBar = new ToolBar( pWindow, nStyles ); + pToolBar = new ToolBox( pWindow, nStyles ); pToolBarManager = new AddonsToolBarManager( comphelper::getComponentContext(m_xServiceManager), xFrame, m_aResourceURL, pToolBar ); m_xToolBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY ); } diff --git a/framework/source/uielement/buttontoolbarcontroller.cxx b/framework/source/uielement/buttontoolbarcontroller.cxx index cd827d7..0b8ffb1 100644 --- a/framework/source/uielement/buttontoolbarcontroller.cxx +++ b/framework/source/uielement/buttontoolbarcontroller.cxx @@ -20,8 +20,6 @@ #include "uielement/buttontoolbarcontroller.hxx" -#include "uielement/toolbar.hxx" - #include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> @@ -42,6 +40,7 @@ #include <vcl/graph.hxx> #include <vcl/bitmap.hxx> #include <vcl/graphicfilter.hxx> +#include <vcl/toolbox.hxx> #include <svtools/miscopt.hxx> using namespace ::com::sun::star; diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx index ceb614c..de69836 100644 --- a/framework/source/uielement/comboboxtoolbarcontroller.cxx +++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx @@ -20,8 +20,6 @@ #include "uielement/comboboxtoolbarcontroller.hxx" -#include "uielement/toolbar.hxx" - #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/beans/PropertyValue.hpp> diff --git a/framework/source/uielement/complextoolbarcontroller.cxx b/framework/source/uielement/complextoolbarcontroller.cxx index d5960f8..589bfd8 100644 --- a/framework/source/uielement/complextoolbarcontroller.cxx +++ b/framework/source/uielement/complextoolbarcontroller.cxx @@ -20,8 +20,6 @@ #include "uielement/complextoolbarcontroller.hxx" -#include "uielement/toolbar.hxx" - #include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> @@ -37,6 +35,7 @@ #include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <vcl/mnemonic.hxx> +#include <vcl/toolbox.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::awt; diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx index 69b52f2..fc9ff2f 100644 --- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx +++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx @@ -20,8 +20,6 @@ #include "uielement/dropdownboxtoolbarcontroller.hxx" -#include "uielement/toolbar.hxx" - #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -34,6 +32,7 @@ #include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <vcl/mnemonic.hxx> +#include <vcl/toolbox.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::awt; diff --git a/framework/source/uielement/edittoolbarcontroller.cxx b/framework/source/uielement/edittoolbarcontroller.cxx index 53afe0f..a0ead9a 100644 --- a/framework/source/uielement/edittoolbarcontroller.cxx +++ b/framework/source/uielement/edittoolbarcontroller.cxx @@ -20,8 +20,6 @@ #include "uielement/edittoolbarcontroller.hxx" -#include "uielement/toolbar.hxx" - #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -34,6 +32,7 @@ #include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <vcl/mnemonic.hxx> +#include <vcl/toolbox.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx index 6d44e91..a766860 100644 --- a/framework/source/uielement/generictoolbarcontroller.cxx +++ b/framework/source/uielement/generictoolbarcontroller.cxx @@ -20,8 +20,6 @@ #include "uielement/generictoolbarcontroller.hxx" -#include "uielement/toolbar.hxx" - #include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> diff --git a/framework/source/uielement/imagebuttontoolbarcontroller.cxx b/framework/source/uielement/imagebuttontoolbarcontroller.cxx index 2b01e92..a6ba09b 100644 --- a/framework/source/uielement/imagebuttontoolbarcontroller.cxx +++ b/framework/source/uielement/imagebuttontoolbarcontroller.cxx @@ -21,7 +21,6 @@ #include "uielement/imagebuttontoolbarcontroller.hxx" #include <framework/addonsoptions.hxx> -#include "uielement/toolbar.hxx" #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> @@ -40,6 +39,7 @@ #include <vcl/graph.hxx> #include <vcl/bitmap.hxx> #include <vcl/graphicfilter.hxx> +#include <vcl/toolbox.hxx> #include <svtools/miscopt.hxx> using namespace ::com::sun::star; diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx b/framework/source/uielement/spinfieldtoolbarcontroller.cxx index 9da2523..ea55937 100644 --- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx +++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx @@ -23,8 +23,6 @@ #include "uielement/spinfieldtoolbarcontroller.hxx" -#include "uielement/toolbar.hxx" - #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -37,6 +35,7 @@ #include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <vcl/mnemonic.hxx> +#include <vcl/toolbox.hxx> #ifdef WINNT #include <systools/win32/snprintf.h> #endif diff --git a/framework/source/uielement/togglebuttontoolbarcontroller.cxx b/framework/source/uielement/togglebuttontoolbarcontroller.cxx index dfa2423..9a766a1 100644 --- a/framework/source/uielement/togglebuttontoolbarcontroller.cxx +++ b/framework/source/uielement/togglebuttontoolbarcontroller.cxx @@ -21,15 +21,14 @@ #include "uielement/togglebuttontoolbarcontroller.hxx" #include <framework/addonsoptions.hxx> -#include "uielement/toolbar.hxx" #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/frame/XControlNotificationListener.hpp> -#include "com/sun/star/util/XMacroExpander.hpp" -#include "com/sun/star/uno/XComponentContext.hpp" -#include "com/sun/star/beans/XPropertySet.hpp" +#include <com/sun/star/util/XMacroExpander.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> #include <rtl/uri.hxx> #include <osl/mutex.hxx> @@ -41,6 +40,7 @@ #include <vcl/graph.hxx> #include <vcl/bitmap.hxx> #include <vcl/graphicfilter.hxx> +#include <vcl/toolbox.hxx> #include <svtools/miscopt.hxx> using namespace ::com::sun::star; diff --git a/framework/source/uielement/toolbar.cxx b/framework/source/uielement/toolbar.cxx deleted file mode 100644 index 4e71b6a..0000000 --- a/framework/source/uielement/toolbar.cxx +++ /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 . - */ - -#include <uielement/toolbar.hxx> -#include <uielement/toolbarmanager.hxx> -#include <rtl/logfile.hxx> - -namespace framework -{ - -ToolBar::ToolBar( Window* pParent, WinBits nWinBits ) : - ToolBox( pParent, nWinBits ) -{ -} - -ToolBar::~ToolBar() -{ -} - -void ToolBar::Command( const CommandEvent& rCEvt ) -{ - if ( m_aCommandHandler.IsSet() ) - m_aCommandHandler.Call( (void *)( &rCEvt )); - ToolBox::Command( rCEvt ); -} - -void ToolBar::StateChanged( StateChangedType nType ) -{ - ToolBox::StateChanged( nType ); - if ( m_aStateChangedHandler.IsSet() ) - m_aStateChangedHandler.Call( &nType ); -} - -void ToolBar::DataChanged( const DataChangedEvent& rDCEvt ) -{ - ToolBox::DataChanged( rDCEvt ); - if ( m_aDataChangedHandler.IsSet() ) - m_aDataChangedHandler.Call( (void*)&rDCEvt ); -} - -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 85de30c..ae5fafb 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -19,7 +19,6 @@ #include <uielement/toolbarmanager.hxx> -#include <uielement/toolbar.hxx> #include <uielement/generictoolbarcontroller.hxx> #include <threadhelp/resetableguard.hxx> #include "services.h" @@ -68,6 +67,7 @@ #include <vcl/menu.hxx> #include <vcl/syswin.hxx> #include <vcl/taskpanelist.hxx> +#include <vcl/toolbox.hxx> #include <rtl/logfile.hxx> #include <svtools/menuoptions.hxx> #include <boost/bind.hpp> @@ -201,7 +201,7 @@ DEFINE_XTYPEPROVIDER_6 ( ToolBarManager ToolBarManager::ToolBarManager( const Reference< XComponentContext >& rxContext, const Reference< XFrame >& rFrame, const OUString& rResourceName, - ToolBar* pToolBar ) : + ToolBox* pToolBar ) : ThreadHelpBase( &Application::GetSolarMutex() ), OWeakObject(), m_bDisposed( false ), @@ -751,7 +751,7 @@ void ToolBarManager::setToolBarImage(const Image& _aImage,const CommandToInfoMap { const ::std::vector< sal_uInt16 >& _rIDs = _pIter->second.aIds; m_pToolBar->SetItemImage( _pIter->second.nId, _aImage ); - ::std::for_each(_rIDs.begin(),_rIDs.end(),::boost::bind(&ToolBar::SetItemImage,m_pToolBar,_1,_aImage)); + ::std::for_each(_rIDs.begin(),_rIDs.end(),::boost::bind(&ToolBox::SetItemImage,m_pToolBar,_1,_aImage)); } void SAL_CALL ToolBarManager::elementReplaced( const ::com::sun::star::ui::ConfigurationEvent& Event ) throw (::com::sun::star::uno::RuntimeException) diff --git a/framework/source/uielement/toolbarwrapper.cxx b/framework/source/uielement/toolbarwrapper.cxx index 2dbaa1d..6c40103 100644 --- a/framework/source/uielement/toolbarwrapper.cxx +++ b/framework/source/uielement/toolbarwrapper.cxx @@ -24,8 +24,6 @@ #include <uielement/rootitemcontainer.hxx> #include <uielement/toolbarmanager.hxx> -#include <uielement/toolbar.hxx> - #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/awt/XSystemDependentMenuPeer.hpp> @@ -144,7 +142,7 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments ) th if ( xFrame.is() && m_xConfigSource.is() ) { // Create VCL based toolbar which will be filled with settings data - ToolBar* pToolBar = 0; + ToolBox* pToolBar = 0; ToolBarManager* pToolBarManager = 0; { SolarMutexGuard aSolarMutexGuard; @@ -153,7 +151,7 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments ) th { sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE; - pToolBar = new ToolBar( pWindow, nStyles ); + pToolBar = new ToolBox( pWindow, nStyles ); pToolBarManager = new ToolBarManager( comphelper::getComponentContext(m_xServiceFactory), xFrame, m_aResourceURL, pToolBar ); m_xToolBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY ); pToolBar->WillUsePopupMode( bPopupMode ); diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx index 6106bb1..3b1f69e 100644 --- a/vcl/inc/vcl/toolbox.hxx +++ b/vcl/inc/vcl/toolbox.hxx @@ -207,6 +207,9 @@ private: Link maDeactivateHdl; Link maHighlightHdl; Link maSelectHdl; + Link maCommandHandler; + Link maStateChangedHandler; + Link maDataChangedHandler; public: using Window::ImplInit; @@ -509,6 +512,12 @@ public: const Link& GetHighlightHdl() const { return maHighlightHdl; } void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; } const Link& GetSelectHdl() const { return maSelectHdl; } + void SetCommandHdl( const Link& aLink ) { maCommandHandler = aLink; } + const Link& GetCommandHdl() const { return maCommandHandler; } + void SetStateChangedHdl( const Link& aLink ) { maStateChangedHandler = aLink; } + const Link& GetStateChangedHdl() const { return maStateChangedHandler; } + void SetDataChangedHdl( const Link& aLink ) { maDataChangedHandler = aLink; } + const Link& GetDataChangedHdl() { return maDataChangedHandler; } // support for custom menu (eg for configuration) // note: this menu will also be used to display currently diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 809c8cd..73b4d21 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -4414,6 +4414,9 @@ long ToolBox::Notify( NotifyEvent& rNEvt ) void ToolBox::Command( const CommandEvent& rCEvt ) { + if ( maCommandHandler.IsSet() ) + maCommandHandler.Call( (void *)( &rCEvt )); + // depict StartDrag on MouseButton/Left/Alt if ( (rCEvt.GetCommand() == COMMAND_STARTDRAG) && rCEvt.IsMouseEvent() && mbCustomize && !mbDragging && !mbDrag && !mbSelection && @@ -4506,6 +4509,9 @@ void ToolBox::StateChanged( StateChangedType nType ) ImplInitSettings( sal_False, sal_False, sal_True ); // font, foreground, background Invalidate(); } + + if ( maStateChangedHandler.IsSet() ) + maStateChangedHandler.Call( &nType ); } // ----------------------------------------------------------------------- @@ -4525,6 +4531,9 @@ void ToolBox::DataChanged( const DataChangedEvent& rDCEvt ) ImplInitSettings( sal_True, sal_True, sal_True ); Invalidate(); } + + if ( maDataChangedHandler.IsSet() ) + maDataChangedHandler.Call( (void*)&rDCEvt ); } // ----------------------------------------------------------------------- commit 99d851b3e2b9f41a6616813cbf7a681aa842615e Author: Jan Holesovsky <ke...@suse.cz> Date: Tue Apr 9 22:30:54 2013 +0200 Kill copy'n'paste. Change-Id: I5e5b80f8d8efe91df806bb7ae9750fd84009c6be diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx index c604dde..0e88628 100644 --- a/framework/inc/services/layoutmanager.hxx +++ b/framework/inc/services/layoutmanager.hxx @@ -187,6 +187,12 @@ namespace framework //--------------------------------------------------------------------------------------------------------- virtual void requestLayout( Hint eHint ); + /// Reading of settings - shared with ToolbarLayoutManager. + static sal_Bool readWindowStateData( const OUString& rName, UIElement& rElementData, + LockHelper &rLock, const css::uno::Reference< css::container::XNameAccess > &rPersistentWindowState, + GlobalSettings* &rGlobalSettings, bool &bInGlobalSettings, + const css::uno::Reference< css::uno::XComponentContext > &rComponentContext ); + protected: DECL_LINK(AsyncLayoutHdl, void *); diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index e8b8358..2784927 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -482,23 +482,32 @@ uno::Reference< ui::XUIElement > LayoutManager::implts_findElement( const OUStri sal_Bool LayoutManager::implts_readWindowStateData( const OUString& aName, UIElement& rElementData ) { - sal_Bool bGetSettingsState( sal_False ); + return readWindowStateData( aName, rElementData, m_aLock, m_xPersistentWindowState, + m_pGlobalSettings, m_bGlobalSettings, comphelper::getComponentContext(m_xSMGR) ); +} - WriteGuard aWriteLock( m_aLock ); - Reference< XNameAccess > xPersistentWindowState( m_xPersistentWindowState ); +sal_Bool LayoutManager::readWindowStateData( const OUString& aName, UIElement& rElementData, + LockHelper &rLock, const Reference< XNameAccess > &rPersistentWindowState, + GlobalSettings* &rGlobalSettings, bool &bInGlobalSettings, + const Reference< XComponentContext > &rComponentContext ) +{ + bool bGetSettingsState( false ); + + WriteGuard aWriteLock( rLock ); + Reference< XNameAccess > xPersistentWindowState( rPersistentWindowState ); aWriteLock.unlock(); if ( xPersistentWindowState.is() ) { aWriteLock.lock(); - sal_Bool bGlobalSettings( m_bGlobalSettings ); + bool bGlobalSettings( bInGlobalSettings ); GlobalSettings* pGlobalSettings( 0 ); - if ( m_pGlobalSettings == 0 ) + if ( rGlobalSettings == 0 ) { - m_pGlobalSettings = new GlobalSettings( comphelper::getComponentContext(m_xSMGR) ); - bGetSettingsState = sal_True; + rGlobalSettings = new GlobalSettings( rComponentContext ); + bGetSettingsState = true; } - pGlobalSettings = m_pGlobalSettings; + pGlobalSettings = rGlobalSettings; aWriteLock.unlock(); try @@ -584,12 +593,12 @@ sal_Bool LayoutManager::implts_readWindowStateData( const OUString& aName, UIEle { if ( pGlobalSettings->HasStatesInfo( GlobalSettings::UIELEMENT_TYPE_TOOLBAR )) { - WriteGuard aWriteLock2( m_aLock ); - m_bGlobalSettings = sal_True; + WriteGuard aWriteLock2( rLock ); + bInGlobalSettings = true; aWriteLock2.unlock(); uno::Any aValue; - sal_Bool bValue = sal_Bool(); + sal_Bool bValue = sal_Bool(); if ( pGlobalSettings->GetStateInfo( GlobalSettings::UIELEMENT_TYPE_TOOLBAR, GlobalSettings::STATEINFO_LOCKED, aValue )) diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index dd14cec..421a413 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -20,6 +20,7 @@ #include <toolbarlayoutmanager.hxx> #include <helpers.hxx> #include <services.h> +#include <services/layoutmanager.hxx> #include <classes/resource.hrc> #include <classes/fwkresid.hxx> #include <uiconfiguration/windowstateconfiguration.hxx> @@ -1574,135 +1575,8 @@ void ToolbarLayoutManager::implts_destroyDockingAreaWindows() sal_Bool ToolbarLayoutManager::implts_readWindowStateData( const OUString& aName, UIElement& rElementData ) { - WriteGuard aWriteLock( m_aLock ); - uno::Reference< container::XNameAccess > xPersistentWindowState( m_xPersistentWindowState ); - bool bGetSettingsState( false ); - aWriteLock.unlock(); - - if ( xPersistentWindowState.is() ) - { - aWriteLock.lock(); - bool bGlobalSettings( m_bGlobalSettings ); - GlobalSettings* pGlobalSettings( 0 ); - if ( m_pGlobalSettings == 0 ) - { - m_pGlobalSettings = new GlobalSettings( m_xContext ); - bGetSettingsState = true; - } - pGlobalSettings = m_pGlobalSettings; - aWriteLock.unlock(); - - try - { - uno::Sequence< beans::PropertyValue > aWindowState; - if ( xPersistentWindowState->getByName( aName ) >>= aWindowState ) - { - sal_Bool bValue( sal_False ); - for ( sal_Int32 n = 0; n < aWindowState.getLength(); n++ ) - { - if ( aWindowState[n].Name.equalsAscii( WINDOWSTATE_PROPERTY_DOCKED )) - { - if ( aWindowState[n].Value >>= bValue ) - rElementData.m_bFloating = !bValue; - } - else if ( aWindowState[n].Name.equalsAscii( WINDOWSTATE_PROPERTY_VISIBLE )) - { - if ( aWindowState[n].Value >>= bValue ) - rElementData.m_bVisible = bValue; - } - else if ( aWindowState[n].Name.equalsAscii( WINDOWSTATE_PROPERTY_DOCKINGAREA )) - { - ui::DockingArea eDockingArea; - if ( aWindowState[n].Value >>= eDockingArea ) - rElementData.m_aDockedData.m_nDockedArea = sal_Int16( eDockingArea ); - } - else if ( aWindowState[n].Name.equalsAscii( WINDOWSTATE_PROPERTY_DOCKPOS )) - { - awt::Point aPoint; - if ( aWindowState[n].Value >>= aPoint ) - rElementData.m_aDockedData.m_aPos = aPoint; - } - else if ( aWindowState[n].Name.equalsAscii( WINDOWSTATE_PROPERTY_POS )) - { - awt::Point aPoint; - if ( aWindowState[n].Value >>= aPoint ) - rElementData.m_aFloatingData.m_aPos = aPoint; - } - else if ( aWindowState[n].Name.equalsAscii( WINDOWSTATE_PROPERTY_SIZE )) - { - awt::Size aSize; - if ( aWindowState[n].Value >>= aSize ) - rElementData.m_aFloatingData.m_aSize = aSize; - } - else if ( aWindowState[n].Name.equalsAscii( WINDOWSTATE_PROPERTY_UINAME )) - aWindowState[n].Value >>= rElementData.m_aUIName; - else if ( aWindowState[n].Name.equalsAscii( WINDOWSTATE_PROPERTY_STYLE )) - { - sal_Int32 nStyle = 0; - if ( aWindowState[n].Value >>= nStyle ) - rElementData.m_nStyle = sal_Int16( nStyle ); - } - else if ( aWindowState[n].Name.equalsAscii( WINDOWSTATE_PROPERTY_LOCKED )) - { - if ( aWindowState[n].Value >>= bValue ) - rElementData.m_aDockedData.m_bLocked = bValue; - } - else if ( aWindowState[n].Name.equalsAscii( WINDOWSTATE_PROPERTY_CONTEXT )) - { - if ( aWindowState[n].Value >>= bValue ) - rElementData.m_bContextSensitive = bValue; - } - else if ( aWindowState[n].Name.equalsAscii( WINDOWSTATE_PROPERTY_NOCLOSE )) - { - if ( aWindowState[n].Value >>= bValue ) - rElementData.m_bNoClose = bValue; - } - else if ( aWindowState[n].Name.equalsAscii( WINDOWSTATE_PROPERTY_CONTEXTACTIVE )) - { - if ( aWindowState[n].Value >>= bValue ) - rElementData.m_bContextActive = bValue; - } - else if ( aWindowState[n].Name.equalsAscii( WINDOWSTATE_PROPERTY_SOFTCLOSE )) - { - if ( aWindowState[n].Value >>= bValue ) - rElementData.m_bSoftClose = bValue; - } - } - } - - // oversteer values with global settings - if ( pGlobalSettings && ( bGetSettingsState || bGlobalSettings )) - { - if ( pGlobalSettings->HasStatesInfo( GlobalSettings::UIELEMENT_TYPE_TOOLBAR )) - { - WriteGuard aWriteLock2( m_aLock ); - m_bGlobalSettings = true; - aWriteLock2.unlock(); - - uno::Any aValue; - sal_Bool bValue = sal_Bool(); - if ( pGlobalSettings->GetStateInfo( GlobalSettings::UIELEMENT_TYPE_TOOLBAR, - GlobalSettings::STATEINFO_LOCKED, - aValue )) - aValue >>= rElementData.m_aDockedData.m_bLocked; - if ( pGlobalSettings->GetStateInfo( GlobalSettings::UIELEMENT_TYPE_TOOLBAR, - GlobalSettings::STATEINFO_DOCKED, - aValue )) - { - if ( aValue >>= bValue ) - rElementData.m_bFloating = !bValue; - } - } - } - - return sal_True; - } - catch (const container::NoSuchElementException&) - { - } - } - - return sal_False; + return LayoutManager::readWindowStateData( aName, rElementData, m_aLock, m_xPersistentWindowState, + m_pGlobalSettings, m_bGlobalSettings, m_xContext ); } void ToolbarLayoutManager::implts_writeWindowStateData( const UIElement& rElementData ) @@ -3308,9 +3182,9 @@ void ToolbarLayoutManager::implts_renumberRowColumnData( xPersistentWindowState->getByName( aWindowElements[i] ) >>= aPropValueSeq; for ( sal_Int32 j = 0; j < aPropValueSeq.getLength(); j++ ) { - if ( aPropValueSeq[j].Name.equalsAscii( WINDOWSTATE_PROPERTY_DOCKINGAREA )) + if ( aPropValueSeq[j].Name == WINDOWSTATE_PROPERTY_DOCKINGAREA ) aPropValueSeq[j].Value >>= nDockedArea; - else if ( aPropValueSeq[j].Name.equalsAscii( WINDOWSTATE_PROPERTY_DOCKPOS )) + else if ( aPropValueSeq[j].Name == WINDOWSTATE_PROPERTY_DOCKPOS ) aPropValueSeq[j].Value >>= aDockedPos; } commit 44b1352c540a97b1cb25abcd46cd9ec387288841 Author: Jan Holesovsky <ke...@suse.cz> Date: Tue Apr 9 21:27:10 2013 +0200 Nobody needs pointer to ToolBarManager. Change-Id: I74624b1b28d948e2299014499a1eef309488ad13 diff --git a/framework/inc/uielement/toolbar.hxx b/framework/inc/uielement/toolbar.hxx index 7d67f01..b7ac587 100644 --- a/framework/inc/uielement/toolbar.hxx +++ b/framework/inc/uielement/toolbar.hxx @@ -36,10 +36,6 @@ class ToolBar : public ToolBox virtual void StateChanged( StateChangedType nType ); virtual void DataChanged( const DataChangedEvent& rDCEvt ); - // Toolbar manager - void SetToolBarManager( ToolBarManager* pTbMgr ); - ToolBarManager* GetToolBarManager() const { return m_pToolBarManager; } - // Provide additional handlers to support external implementations void SetCommandHdl( const Link& aLink ) { m_aCommandHandler = aLink; } const Link& GetCommandHdl() const { return m_aCommandHandler; } @@ -52,7 +48,6 @@ class ToolBar : public ToolBox Link m_aCommandHandler; Link m_aStateChangedHandler; Link m_aDataChangedHandler; - ToolBarManager* m_pToolBarManager; }; } diff --git a/framework/source/uielement/addonstoolbarwrapper.cxx b/framework/source/uielement/addonstoolbarwrapper.cxx index a3617ee..75a9fb2 100644 --- a/framework/source/uielement/addonstoolbarwrapper.cxx +++ b/framework/source/uielement/addonstoolbarwrapper.cxx @@ -119,7 +119,6 @@ void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArgument pToolBar = new ToolBar( pWindow, nStyles ); pToolBarManager = new AddonsToolBarManager( comphelper::getComponentContext(m_xServiceManager), xFrame, m_aResourceURL, pToolBar ); - pToolBar->SetToolBarManager( pToolBarManager ); m_xToolBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY ); } } diff --git a/framework/source/uielement/toolbar.cxx b/framework/source/uielement/toolbar.cxx index d1e5dda..4e71b6a 100644 --- a/framework/source/uielement/toolbar.cxx +++ b/framework/source/uielement/toolbar.cxx @@ -26,7 +26,6 @@ namespace framework ToolBar::ToolBar( Window* pParent, WinBits nWinBits ) : ToolBox( pParent, nWinBits ) - , m_pToolBarManager( 0 ) { } @@ -34,11 +33,6 @@ ToolBar::~ToolBar() { } -void ToolBar::SetToolBarManager( ToolBarManager* pTbMgr ) -{ - m_pToolBarManager = pTbMgr; -} - void ToolBar::Command( const CommandEvent& rCEvt ) { if ( m_aCommandHandler.IsSet() ) diff --git a/framework/source/uielement/toolbarwrapper.cxx b/framework/source/uielement/toolbarwrapper.cxx index 20cf3db..2dbaa1d 100644 --- a/framework/source/uielement/toolbarwrapper.cxx +++ b/framework/source/uielement/toolbarwrapper.cxx @@ -155,7 +155,6 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments ) th pToolBar = new ToolBar( pWindow, nStyles ); pToolBarManager = new ToolBarManager( comphelper::getComponentContext(m_xServiceFactory), xFrame, m_aResourceURL, pToolBar ); - pToolBar->SetToolBarManager( pToolBarManager ); m_xToolBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY ); pToolBar->WillUsePopupMode( bPopupMode ); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits