Author: af Date: Fri Apr 19 09:51:45 2013 New Revision: 1469765 URL: http://svn.apache.org/r1469765 Log: 121960: Extend the sidebar::ControllerItem to check Disabled state. Converted TextPropertyPanel to use this new functionality.
Added: openoffice/trunk/main/default_images/res/commandimagelist/lc_characterbackgroundpattern.png (with props) openoffice/trunk/main/default_images/res/commandimagelist/lc_spacing.png (with props) openoffice/trunk/main/default_images/res/commandimagelist/lch_characterbackgroundpattern.png (with props) openoffice/trunk/main/default_images/res/commandimagelist/lch_spacing.png (with props) openoffice/trunk/main/default_images/res/commandimagelist/sc_characterbackgroundpattern.png (with props) openoffice/trunk/main/default_images/res/commandimagelist/sc_spacing.png (with props) openoffice/trunk/main/default_images/res/commandimagelist/sch_characterbackgroundpattern.png (with props) openoffice/trunk/main/default_images/res/commandimagelist/sch_spacing.png (with props) openoffice/trunk/main/sfx2/source/sidebar/CommandInfoProvider.cxx openoffice/trunk/main/sfx2/source/sidebar/CommandInfoProvider.hxx Modified: openoffice/trunk/main/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu openoffice/trunk/main/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx openoffice/trunk/main/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx openoffice/trunk/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx openoffice/trunk/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx openoffice/trunk/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx openoffice/trunk/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx openoffice/trunk/main/sfx2/Library_sfx.mk openoffice/trunk/main/sfx2/inc/sfx2/sidebar/ControllerItem.hxx openoffice/trunk/main/sfx2/source/sidebar/ControllerItem.cxx openoffice/trunk/main/sfx2/source/sidebar/Deck.cxx openoffice/trunk/main/sfx2/source/sidebar/DeckLayouter.cxx openoffice/trunk/main/sfx2/source/sidebar/FocusManager.cxx openoffice/trunk/main/sfx2/source/sidebar/SidebarChildWindow.cxx openoffice/trunk/main/svx/Library_svx.mk openoffice/trunk/main/svx/source/sidebar/area/AreaPropertyPanel.cxx openoffice/trunk/main/svx/source/sidebar/area/AreaPropertyPanel.hxx openoffice/trunk/main/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx openoffice/trunk/main/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx openoffice/trunk/main/svx/source/sidebar/line/LinePropertyPanel.cxx openoffice/trunk/main/svx/source/sidebar/line/LinePropertyPanel.hxx openoffice/trunk/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx openoffice/trunk/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx openoffice/trunk/main/svx/source/sidebar/text/TextCharacterSpacingControl.cxx openoffice/trunk/main/svx/source/sidebar/text/TextCharacterSpacingControl.hxx openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.cxx openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.hrc openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.hxx openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.src openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.cxx openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.hxx openoffice/trunk/main/sw/source/ui/sidebar/PagePropertyPanel.cxx openoffice/trunk/main/sw/source/ui/sidebar/PagePropertyPanel.hxx openoffice/trunk/main/sw/source/ui/sidebar/WrapPropertyPanel.cxx openoffice/trunk/main/sw/source/ui/sidebar/WrapPropertyPanel.hxx Added: openoffice/trunk/main/default_images/res/commandimagelist/lc_characterbackgroundpattern.png URL: http://svn.apache.org/viewvc/openoffice/trunk/main/default_images/res/commandimagelist/lc_characterbackgroundpattern.png?rev=1469765&view=auto ============================================================================== Binary file - no diff available. Propchange: openoffice/trunk/main/default_images/res/commandimagelist/lc_characterbackgroundpattern.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: openoffice/trunk/main/default_images/res/commandimagelist/lc_spacing.png URL: http://svn.apache.org/viewvc/openoffice/trunk/main/default_images/res/commandimagelist/lc_spacing.png?rev=1469765&view=auto ============================================================================== Binary file - no diff available. Propchange: openoffice/trunk/main/default_images/res/commandimagelist/lc_spacing.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: openoffice/trunk/main/default_images/res/commandimagelist/lch_characterbackgroundpattern.png URL: http://svn.apache.org/viewvc/openoffice/trunk/main/default_images/res/commandimagelist/lch_characterbackgroundpattern.png?rev=1469765&view=auto ============================================================================== Binary file - no diff available. Propchange: openoffice/trunk/main/default_images/res/commandimagelist/lch_characterbackgroundpattern.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: openoffice/trunk/main/default_images/res/commandimagelist/lch_spacing.png URL: http://svn.apache.org/viewvc/openoffice/trunk/main/default_images/res/commandimagelist/lch_spacing.png?rev=1469765&view=auto ============================================================================== Binary file - no diff available. Propchange: openoffice/trunk/main/default_images/res/commandimagelist/lch_spacing.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: openoffice/trunk/main/default_images/res/commandimagelist/sc_characterbackgroundpattern.png URL: http://svn.apache.org/viewvc/openoffice/trunk/main/default_images/res/commandimagelist/sc_characterbackgroundpattern.png?rev=1469765&view=auto ============================================================================== Binary file - no diff available. Propchange: openoffice/trunk/main/default_images/res/commandimagelist/sc_characterbackgroundpattern.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: openoffice/trunk/main/default_images/res/commandimagelist/sc_spacing.png URL: http://svn.apache.org/viewvc/openoffice/trunk/main/default_images/res/commandimagelist/sc_spacing.png?rev=1469765&view=auto ============================================================================== Binary file - no diff available. Propchange: openoffice/trunk/main/default_images/res/commandimagelist/sc_spacing.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: openoffice/trunk/main/default_images/res/commandimagelist/sch_characterbackgroundpattern.png URL: http://svn.apache.org/viewvc/openoffice/trunk/main/default_images/res/commandimagelist/sch_characterbackgroundpattern.png?rev=1469765&view=auto ============================================================================== Binary file - no diff available. Propchange: openoffice/trunk/main/default_images/res/commandimagelist/sch_characterbackgroundpattern.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: openoffice/trunk/main/default_images/res/commandimagelist/sch_spacing.png URL: http://svn.apache.org/viewvc/openoffice/trunk/main/default_images/res/commandimagelist/sch_spacing.png?rev=1469765&view=auto ============================================================================== Binary file - no diff available. Propchange: openoffice/trunk/main/default_images/res/commandimagelist/sch_spacing.png ------------------------------------------------------------------------------ svn:mime-type = image/png Modified: openoffice/trunk/main/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu URL: http://svn.apache.org/viewvc/openoffice/trunk/main/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu (original) +++ openoffice/trunk/main/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu Fri Apr 19 09:51:45 2013 @@ -1004,6 +1004,14 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:CharacterBackgroundPattern" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Highlight Color</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> <node oor:name=".uno:CharFontName" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Font Name</value> @@ -4832,6 +4840,14 @@ <value>15</value> </prop> </node> + <node oor:name=".uno:Spacing" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Character Spacing</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> <node oor:name=".uno:SpellDialog" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Spelling...</value> Modified: openoffice/trunk/main/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx (original) +++ openoffice/trunk/main/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx Fri Apr 19 09:51:45 2013 @@ -386,8 +386,11 @@ void AlignmentPropertyPanel::HandleConte void AlignmentPropertyPanel::NotifyItemUpdate( sal_uInt16 nSID, SfxItemState eState, - const SfxPoolItem* pState) + const SfxPoolItem* pState, + const bool bIsEnabled) { + (void)bIsEnabled; + switch(nSID) { case SID_H_ALIGNCELL: Modified: openoffice/trunk/main/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx (original) +++ openoffice/trunk/main/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx Fri Apr 19 09:51:45 2013 @@ -57,7 +57,8 @@ public: virtual void NotifyItemUpdate( const sal_uInt16 nSId, const SfxItemState eState, - const SfxPoolItem* pState); + const SfxPoolItem* pState, + const bool bIsEnabled); SfxBindings* GetBindings(); Modified: openoffice/trunk/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx (original) +++ openoffice/trunk/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx Fri Apr 19 09:51:45 2013 @@ -461,8 +461,11 @@ void CellAppearancePropertyPanel::Handle void CellAppearancePropertyPanel::NotifyItemUpdate( sal_uInt16 nSID, SfxItemState eState, - const SfxPoolItem* pState) + const SfxPoolItem* pState, + const bool bIsEnabled) { + (void)bIsEnabled; + switch(nSID) { case SID_BACKGROUND_COLOR: Modified: openoffice/trunk/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx (original) +++ openoffice/trunk/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx Fri Apr 19 09:51:45 2013 @@ -65,7 +65,8 @@ public: virtual void NotifyItemUpdate( const sal_uInt16 nSId, const SfxItemState eState, - const SfxPoolItem* pState); + const SfxPoolItem* pState, + const bool bIsEnabled); SfxBindings* GetBindings(); Modified: openoffice/trunk/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx (original) +++ openoffice/trunk/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx Fri Apr 19 09:51:45 2013 @@ -267,8 +267,11 @@ void NumberFormatPropertyPanel::HandleCo void NumberFormatPropertyPanel::NotifyItemUpdate( sal_uInt16 nSID, SfxItemState eState, - const SfxPoolItem* pState) + const SfxPoolItem* pState, + const bool bIsEnabled) { + (void)bIsEnabled; + switch(nSID) { case SID_NUMBER_TYPE_FORMAT: Modified: openoffice/trunk/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx (original) +++ openoffice/trunk/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx Fri Apr 19 09:51:45 2013 @@ -54,7 +54,8 @@ public: virtual void NotifyItemUpdate( const sal_uInt16 nSId, const SfxItemState eState, - const SfxPoolItem* pState); + const SfxPoolItem* pState, + const bool bIsEnabled); SfxBindings* GetBindings(); Modified: openoffice/trunk/main/sfx2/Library_sfx.mk URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/Library_sfx.mk?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/Library_sfx.mk (original) +++ openoffice/trunk/main/sfx2/Library_sfx.mk Fri Apr 19 09:51:45 2013 @@ -219,6 +219,7 @@ $(eval $(call gb_Library_add_exception_o sfx2/source/sidebar/SidebarPanelBase \ sfx2/source/sidebar/SidebarToolBox \ sfx2/source/sidebar/AsynchronousCall \ + sfx2/source/sidebar/CommandInfoProvider \ sfx2/source/sidebar/Context \ sfx2/source/sidebar/ContextChangeBroadcaster \ sfx2/source/sidebar/ContextList \ Modified: openoffice/trunk/main/sfx2/inc/sfx2/sidebar/ControllerItem.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/inc/sfx2/sidebar/ControllerItem.hxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/inc/sfx2/sidebar/ControllerItem.hxx (original) +++ openoffice/trunk/main/sfx2/inc/sfx2/sidebar/ControllerItem.hxx Fri Apr 19 09:51:45 2013 @@ -24,11 +24,33 @@ #include <sfx2/ctrlitem.hxx> +#include <cppuhelper/compbase1.hxx> +#include <cppuhelper/basemutex.hxx> +#include <unotools/cmdoptions.hxx> +#include <vcl/image.hxx> + +#include <com/sun/star/frame/XFrame.hpp> + #include <boost/function.hpp> +namespace css = ::com::sun::star; +namespace cssu = ::com::sun::star::uno; + +class SfxViewFrame; +class ToolBox; + + namespace sfx2 { namespace sidebar { +/** The sfx2::sidebar::ControllerItem is a wrapper around the + SfxControllerItem that becomes necessary to allow objects (think + sidebar panels) to receive state changes without having one + SfxControllerItem per supported item as base class (which is not + possible in C++ anyway). + + It also gives access to the label and icon of a slot/command. +*/ class SFX2_DLLPUBLIC ControllerItem : public SfxControllerItem { @@ -39,18 +61,82 @@ public: virtual void NotifyItemUpdate( const sal_uInt16 nSId, const SfxItemState eState, - const SfxPoolItem* pState) = 0; + const SfxPoolItem* pState, + const bool bIsEnabled) = 0; }; + + /** This is the preferred constructor that allows the created + controller item to return non-empty values for GetLable() and + GetIcon() calls. + */ + ControllerItem ( + const sal_uInt16 nSlotId, + SfxBindings &rBindings, + ItemUpdateReceiverInterface& rItemUpdateReceiver, + const ::rtl::OUString& rsCommandName, + const cssu::Reference<css::frame::XFrame>& rxFrame); + + /** This is the simpler constructor variant that still exists for + compatibility resons. Note that GetLabel() and GetIcon() will + return empty strings/images. + */ ControllerItem ( const sal_uInt16 nId, SfxBindings &rBindings, ItemUpdateReceiverInterface& rItemUpdateReceiver); + virtual ~ControllerItem (void); + /** Returns </TRUE> when the slot/command has not been disabled. + Changes of this state are notified via the + ItemUpdateReceiverInterface::NotifyContextChang() method. + */ + bool IsEnabled (void) const; + + /** Force the controller item to call its NotifyItemUpdate + callback with up-to-date data. + */ + void RequestUpdate (void); + + /** Return the label for the command. It contains the keyboard + accelerator when one exists. + */ + ::rtl::OUString GetLabel (void) const; + + /** Return the icon for the command. Uses the system high contrast mode state. + */ + Image GetIcon (void) const; + + /** Return the icon for the command. Allows the user to override + the high contrast mode state. + */ + Image GetIcon (const bool bIsHighContrastMode) const; + + /** Convenience method for setting all relevant properties for the + slot/command represented by the called object at the given tool + box. + */ + void SetupToolBoxItem (ToolBox& rToolBox, const sal_uInt16 nIndex); + + /** Do not call. Used by local class only. Should be a member of + a local and hidden interface. + */ + void NotifyFrameContextChange (void); + /** Do not call. Used by local class only. Should be a member of + a local and hidden interface. + */ + void ResetFrame (void); + +protected: virtual void StateChanged (sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem* pState); private: ItemUpdateReceiverInterface& mrItemUpdateReceiver; + cssu::Reference<css::frame::XFrame> mxFrame; + cssu::Reference<css::lang::XComponent> mxFrameActionListener; + const ::rtl::OUString msCommandName; + + void SetupCommandURL (const sal_Char* sCommandName); }; } } // end of namespace sfx2::sidebar Added: openoffice/trunk/main/sfx2/source/sidebar/CommandInfoProvider.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/CommandInfoProvider.cxx?rev=1469765&view=auto ============================================================================== --- openoffice/trunk/main/sfx2/source/sidebar/CommandInfoProvider.cxx (added) +++ openoffice/trunk/main/sfx2/source/sidebar/CommandInfoProvider.cxx Fri Apr 19 09:51:45 2013 @@ -0,0 +1,359 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#include "precompiled_sfx2.hxx" + +#include "CommandInfoProvider.hxx" + +#include <comphelper/processfactory.hxx> +#include <svtools/acceleratorexecute.hxx> +#include <cppuhelper/compbase1.hxx> +#include <cppuhelper/basemutex.hxx> + +#include <com/sun/star/frame/XModuleManager.hpp> +#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> + +using namespace css; +using namespace cssu; +using ::rtl::OUString; + + +#define A2S(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) + + +namespace +{ + typedef ::cppu::WeakComponentImplHelper1 < + css::lang::XEventListener + > FrameListenerInterfaceBase; + class FrameListener + : public ::cppu::BaseMutex, + public FrameListenerInterfaceBase + { + public: + FrameListener (sfx2::sidebar::CommandInfoProvider& rInfoProvider, const Reference<frame::XFrame>& rxFrame) + : FrameListenerInterfaceBase(m_aMutex), + mrInfoProvider(rInfoProvider), + mxFrame(rxFrame) + { + if (mxFrame.is()) + mxFrame->addEventListener(this); + } + virtual ~FrameListener (void) + { + } + virtual void SAL_CALL disposing (void) + { + if (mxFrame.is()) + mxFrame->removeEventListener(this); + } + virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent) + throw (cssu::RuntimeException) + { + (void)rEvent; + mrInfoProvider.SetFrame(NULL); + mxFrame = NULL; + } + + private: + sfx2::sidebar::CommandInfoProvider& mrInfoProvider; + Reference<frame::XFrame> mxFrame; + }; +} + + + +namespace sfx2 { namespace sidebar { + +CommandInfoProvider& CommandInfoProvider::Instance (void) +{ + static CommandInfoProvider aProvider; + return aProvider; +} + + + + +CommandInfoProvider::CommandInfoProvider (void) + : mxServiceFactory(comphelper::getProcessServiceFactory()), + mxCachedDataFrame(), + mxCachedDocumentAcceleratorConfiguration(), + mxCachedModuleAcceleratorConfiguration(), + mxCachedGlobalAcceleratorConfiguration(), + msCachedModuleIdentifier(), + mxFrameListener() +{ +} + + + + +CommandInfoProvider::~CommandInfoProvider (void) +{ + if (mxFrameListener.is()) + { + mxFrameListener->dispose(); + mxFrameListener = NULL; + } +} + + + + +OUString CommandInfoProvider::GetLabelForCommand ( + const OUString& rsCommandName, + const Reference<frame::XFrame>& rxFrame) +{ + SetFrame(rxFrame); + + const OUString sLabel (GetCommandLabel(rsCommandName)); + const OUString sShortCut (GetCommandShortcut(rsCommandName)); + if (sShortCut.getLength() > 0) + return sLabel + A2S(" (") + sShortCut + A2S(")"); + else + return sLabel; +} + + + + +void CommandInfoProvider::SetFrame (const Reference<frame::XFrame>& rxFrame) +{ + if (rxFrame != mxCachedDataFrame) + { + // Detach from the old frame. + if (mxFrameListener.is()) + { + mxFrameListener->dispose(); + mxFrameListener = NULL; + } + + // Release objects that are tied to the old frame. + mxCachedDocumentAcceleratorConfiguration = NULL; + mxCachedModuleAcceleratorConfiguration = NULL; + msCachedModuleIdentifier = OUString(); + mxCachedDataFrame = rxFrame; + + // Connect to the new frame. + if (rxFrame.is()) + mxFrameListener = new FrameListener(*this, rxFrame); + } +} + + + + +Reference<ui::XAcceleratorConfiguration> CommandInfoProvider::GetDocumentAcceleratorConfiguration (void) +{ + if ( ! mxCachedDocumentAcceleratorConfiguration.is()) + { + // Get the accelerator configuration for the document. + if (mxCachedDataFrame.is()) + { + Reference<frame::XController> xController = mxCachedDataFrame->getController(); + if (xController.is()) + { + Reference<frame::XModel> xModel (xController->getModel()); + if (xModel.is()) + { + Reference<ui::XUIConfigurationManagerSupplier> xSupplier (xModel, UNO_QUERY); + if (xSupplier.is()) + { + Reference<ui::XUIConfigurationManager> xConfigurationManager( + xSupplier->getUIConfigurationManager(), + UNO_QUERY); + if (xConfigurationManager.is()) + { + mxCachedDocumentAcceleratorConfiguration = Reference<ui::XAcceleratorConfiguration>( + xConfigurationManager->getShortCutManager(), + UNO_QUERY); + } + } + } + } + } + } + return mxCachedDocumentAcceleratorConfiguration; +} + + + + +Reference<ui::XAcceleratorConfiguration> CommandInfoProvider::GetModuleAcceleratorConfiguration (void) +{ + if ( ! mxCachedModuleAcceleratorConfiguration.is()) + { + try + { + Reference<ui::XModuleUIConfigurationManagerSupplier> xSupplier ( + mxServiceFactory->createInstance(A2S("com.sun.star.ui.ModuleUIConfigurationManagerSupplier")), + UNO_QUERY); + Reference<ui::XUIConfigurationManager> xManager ( + xSupplier->getUIConfigurationManager(GetModuleIdentifier())); + if (xManager.is()) + { + mxCachedModuleAcceleratorConfiguration = Reference<ui::XAcceleratorConfiguration>( + xManager->getShortCutManager(), + UNO_QUERY); + } + } + catch (Exception&) + { + } + } + return mxCachedModuleAcceleratorConfiguration; +} + + + + +Reference<ui::XAcceleratorConfiguration> CommandInfoProvider::GetGlobalAcceleratorConfiguration (void) +{ + // Get the global accelerator configuration. + if ( ! mxCachedGlobalAcceleratorConfiguration.is()) + { + mxCachedGlobalAcceleratorConfiguration = Reference<ui::XAcceleratorConfiguration>( + mxServiceFactory->createInstance(A2S("com.sun.star.ui.GlobalAcceleratorConfiguration")), + UNO_QUERY); + } + + return mxCachedGlobalAcceleratorConfiguration; +} + + + + +OUString CommandInfoProvider::GetModuleIdentifier (void) +{ + if (msCachedModuleIdentifier.getLength() == 0) + { + Reference<frame::XModuleManager> xModuleManager ( + mxServiceFactory->createInstance(A2S("com.sun.star.frame.ModuleManager")), + UNO_QUERY); + if (xModuleManager.is()) + msCachedModuleIdentifier = xModuleManager->identify(mxCachedDataFrame); + } + return msCachedModuleIdentifier; +} + + + + +OUString CommandInfoProvider::GetCommandShortcut (const OUString& rsCommandName) +{ + OUString sShortcut; + + sShortcut = RetrieveShortcutsFromConfiguration(GetDocumentAcceleratorConfiguration(), rsCommandName); + if (sShortcut.getLength() > 0) + return sShortcut; + + sShortcut = RetrieveShortcutsFromConfiguration(GetModuleAcceleratorConfiguration(), rsCommandName); + if (sShortcut.getLength() > 0) + return sShortcut; + + sShortcut = RetrieveShortcutsFromConfiguration(GetGlobalAcceleratorConfiguration(), rsCommandName); + if (sShortcut.getLength() > 0) + return sShortcut; + + return OUString(); +} + + + + +OUString CommandInfoProvider::RetrieveShortcutsFromConfiguration( + const Reference<ui::XAcceleratorConfiguration>& rxConfiguration, + const OUString& rsCommandName) +{ + if (rxConfiguration.is()) + { + try + { + Sequence<OUString> aCommands(1); + aCommands[0] = rsCommandName; + + Sequence<Any> aKeyCodes (rxConfiguration->getPreferredKeyEventsForCommandList(aCommands)); + if (aCommands.getLength() == 1) + { + css::awt::KeyEvent aKeyEvent; + if (aKeyCodes[0] >>= aKeyEvent) + { + return svt::AcceleratorExecute::st_AWTKey2VCLKey(aKeyEvent).GetName(); + } + } + } + catch (lang::IllegalArgumentException&) + { + } + } + return OUString(); +} + + + + +Sequence<beans::PropertyValue> CommandInfoProvider::GetCommandProperties (const OUString& rsCommandName) +{ + Sequence<beans::PropertyValue> aProperties; + + try + { + const OUString sModuleIdentifier (GetModuleIdentifier()); + if (sModuleIdentifier.getLength() > 0) + { + Reference<container::XNameAccess> xNameAccess ( + mxServiceFactory->createInstance( + OUString::createFromAscii("com.sun.star.frame.UICommandDescription")), + UNO_QUERY); + Reference<container::XNameAccess> xUICommandLabels; + if (xNameAccess.is()) + if (xNameAccess->getByName(sModuleIdentifier) >>= xUICommandLabels) + xUICommandLabels->getByName(rsCommandName) >>= aProperties; + } + } + catch (Exception&) + { + } + + return aProperties; +} + + + + +OUString CommandInfoProvider::GetCommandLabel (const OUString& rsCommandName) +{ + const Sequence<beans::PropertyValue> aProperties (GetCommandProperties(rsCommandName)); + for (sal_Int32 nIndex=0; nIndex<aProperties.getLength(); ++nIndex) + { + if (aProperties[nIndex].Name.equalsAscii("Name")) + { + OUString sLabel; + aProperties[nIndex].Value >>= sLabel; + return sLabel; + } + } + return OUString(); +} + + +} } // end of namespace sfx2/framework Added: openoffice/trunk/main/sfx2/source/sidebar/CommandInfoProvider.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/CommandInfoProvider.hxx?rev=1469765&view=auto ============================================================================== --- openoffice/trunk/main/sfx2/source/sidebar/CommandInfoProvider.hxx (added) +++ openoffice/trunk/main/sfx2/source/sidebar/CommandInfoProvider.hxx Fri Apr 19 09:51:45 2013 @@ -0,0 +1,96 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef SIDEBAR_COMMAND_INFO_PROVIDER_HXX +#define SIDEBAR_COMMAND_INFO_PROVIDER_HXX + +#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/ui/XAcceleratorConfiguration.hpp> + + +namespace css = ::com::sun::star; +namespace cssu = ::com::sun::star::uno; + +namespace sfx2 { namespace sidebar { + +/** Provide information about UNO commands like tooltip text with + keyboard accelerator. +*/ +class CommandInfoProvider +{ +public: + /** Return the singleton instance. + + It caches some objects for the last XFrame object given to + GetLabelForCommand. These objects are release and created new + when that method is called with a different XFrame from the + last call. + + Lifetime control should work but could be more elegant. + */ + static CommandInfoProvider& Instance (void); + + /** Return a label for the given command. + @param rsCommandName + The command name is expected to start with .uno: + @param rxFrame + The frame is used to identify the module and document. + @return + The returned label contains the keyboard accelerator, if + one is defined. + */ + ::rtl::OUString GetLabelForCommand ( + const ::rtl::OUString& rsCommandName, + const cssu::Reference<css::frame::XFrame>& rxFrame); + + /** Do not call. Should be part of a local and hidden interface. + */ + void SetFrame (const cssu::Reference<css::frame::XFrame>& rxFrame); + + private: + cssu::Reference<css::lang::XMultiServiceFactory> mxServiceFactory; + cssu::Reference<css::frame::XFrame> mxCachedDataFrame; + cssu::Reference<css::ui::XAcceleratorConfiguration> mxCachedDocumentAcceleratorConfiguration; + cssu::Reference<css::ui::XAcceleratorConfiguration> mxCachedModuleAcceleratorConfiguration; + cssu::Reference<css::ui::XAcceleratorConfiguration> mxCachedGlobalAcceleratorConfiguration; + ::rtl::OUString msCachedModuleIdentifier; + cssu::Reference<css::lang::XComponent> mxFrameListener; + + CommandInfoProvider (void); + ~CommandInfoProvider (void); + + cssu::Reference<css::ui::XAcceleratorConfiguration> GetDocumentAcceleratorConfiguration (void); + cssu::Reference<css::ui::XAcceleratorConfiguration> GetModuleAcceleratorConfiguration (void); + cssu::Reference<css::ui::XAcceleratorConfiguration> GetGlobalAcceleratorConfiguration(void); + ::rtl::OUString GetModuleIdentifier (void); + ::rtl::OUString GetCommandShortcut (const ::rtl::OUString& rCommandName); + cssu::Sequence<css::beans::PropertyValue> GetCommandProperties ( + const ::rtl::OUString& rsCommandName); + ::rtl::OUString GetCommandLabel (const ::rtl::OUString& rsCommandName); + rtl::OUString RetrieveShortcutsFromConfiguration( + const cssu::Reference<css::ui::XAcceleratorConfiguration>& rxConfiguration, + const rtl::OUString& rsCommandName); +}; + +} } // end of namespace sfx2/framework + +#endif Modified: openoffice/trunk/main/sfx2/source/sidebar/ControllerItem.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/ControllerItem.cxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/source/sidebar/ControllerItem.cxx (original) +++ openoffice/trunk/main/sfx2/source/sidebar/ControllerItem.cxx Fri Apr 19 09:51:45 2013 @@ -23,14 +23,102 @@ #include "sidebar/ControllerItem.hxx" +#include <sfx2/msgpool.hxx> +#include <sfx2/viewsh.hxx> +#include "sfx2/imagemgr.hxx" +#include "sfx2/bindings.hxx" +#include <unotools/cmdoptions.hxx> +#include "CommandInfoProvider.hxx" +#include <vcl/svapp.hxx> +#include <vcl/toolbox.hxx> + +#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XFrameActionListener.hpp> + + +using namespace css; +using namespace cssu; + + +#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString))) + +namespace +{ + typedef ::cppu::WeakComponentImplHelper1 < + css::frame::XFrameActionListener + > FrameActionListenerInterfaceBase; + + class FrameActionListener + : public ::cppu::BaseMutex, + public FrameActionListenerInterfaceBase + { + public: + FrameActionListener ( + sfx2::sidebar::ControllerItem& rControllerItem, + const Reference<frame::XFrame>& rxFrame) + : FrameActionListenerInterfaceBase(m_aMutex), + mrControllerItem(rControllerItem), + mxFrame(rxFrame) + { + if (mxFrame.is()) + mxFrame->addFrameActionListener(this); + } + virtual ~FrameActionListener (void) + { + } + virtual void SAL_CALL disposing (void) + { + if (mxFrame.is()) + mxFrame->removeFrameActionListener(this); + } + virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent) + throw (cssu::RuntimeException) + { + (void)rEvent; + mrControllerItem.ResetFrame(); + mxFrame = NULL; + } + virtual void SAL_CALL frameAction (const css::frame::FrameActionEvent& rEvent) + throw (cssu::RuntimeException) + { + if (rEvent.Action == frame::FrameAction_CONTEXT_CHANGED) + mrControllerItem.NotifyFrameContextChange(); + } + + private: + sfx2::sidebar::ControllerItem& mrControllerItem; + Reference<frame::XFrame> mxFrame; + }; +} + namespace sfx2 { namespace sidebar { ControllerItem::ControllerItem ( - const sal_uInt16 nId, + const sal_uInt16 nSlotId, SfxBindings &rBindings, ItemUpdateReceiverInterface& rItemUpdateReceiver) - : SfxControllerItem(nId, rBindings), - mrItemUpdateReceiver(rItemUpdateReceiver) + : SfxControllerItem(nSlotId, rBindings), + mrItemUpdateReceiver(rItemUpdateReceiver), + mxFrame(), + mxFrameActionListener(), + msCommandName() +{ +} + + + + +ControllerItem::ControllerItem ( + const sal_uInt16 nSlotId, + SfxBindings &rBindings, + ItemUpdateReceiverInterface& rItemUpdateReceiver, + const ::rtl::OUString& rsCommandName, + const Reference<frame::XFrame>& rxFrame) + : SfxControllerItem(nSlotId, rBindings), + mrItemUpdateReceiver(rItemUpdateReceiver), + mxFrame(rxFrame), + mxFrameActionListener(new FrameActionListener(*this, mxFrame)), + msCommandName(rsCommandName) { } @@ -39,6 +127,8 @@ ControllerItem::ControllerItem ( ControllerItem::~ControllerItem (void) { + if (mxFrameActionListener.is()) + mxFrameActionListener->dispose(); } @@ -49,10 +139,95 @@ void ControllerItem::StateChanged ( SfxItemState eState, const SfxPoolItem* pState) { - mrItemUpdateReceiver.NotifyItemUpdate(nSID, eState, pState); + mrItemUpdateReceiver.NotifyItemUpdate(nSID, eState, pState, IsEnabled()); +} + + + + +bool ControllerItem::IsEnabled (void) const +{ + if ( ! SvtCommandOptions().HasEntries(SvtCommandOptions::CMDOPTION_DISABLED)) + { + // There are no disabled commands. + return true; + } + else if (msCommandName.getLength() == 0) + { + // We were not given a command name at construction and can + // not check the state now. Assume the best and return true. + return true; + } + else if (SvtCommandOptions().Lookup(SvtCommandOptions::CMDOPTION_DISABLED, msCommandName)) + { + // The command is part of a list of disabled commands. + return false; + } + else + return true; +} + + + + +void ControllerItem::RequestUpdate (void) +{ + SfxPoolItem* pState = NULL; + const SfxItemState eState (GetBindings().QueryState(GetId(), pState)); + mrItemUpdateReceiver.NotifyItemUpdate(GetId(), eState, pState, IsEnabled()); +} + + + + +void ControllerItem::NotifyFrameContextChange (void) +{ + RequestUpdate(); +} + + + + +void ControllerItem::ResetFrame (void) +{ + mxFrame = NULL; +} + + + + +::rtl::OUString ControllerItem::GetLabel (void) const +{ + return CommandInfoProvider::Instance().GetLabelForCommand( + A2S(".uno:")+msCommandName, + mxFrame); +} + + + + +Image ControllerItem::GetIcon (void) const +{ + return GetIcon(Application::GetSettings().GetStyleSettings().GetHighContrastMode()); +} + + + + +Image ControllerItem::GetIcon (const bool bIsHighContrastMode) const +{ + return GetImage(mxFrame, A2S(".uno:")+msCommandName, sal_False, bIsHighContrastMode); + } +void ControllerItem::SetupToolBoxItem (ToolBox& rToolBox, const sal_uInt16 nIndex) +{ + rToolBox.SetQuickHelpText(nIndex, GetLabel()); + rToolBox.SetItemImage(nIndex, GetIcon()); +} + + } } // end of namespace sfx2::sidebar Modified: openoffice/trunk/main/sfx2/source/sidebar/Deck.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/Deck.cxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/source/sidebar/Deck.cxx (original) +++ openoffice/trunk/main/sfx2/source/sidebar/Deck.cxx Fri Apr 19 09:51:45 2013 @@ -282,7 +282,7 @@ const char* GetWindowClassification (con void Deck::PrintWindowSubTree (Window* pRoot, int nIndentation) { - static char* sIndentation = " "; + static const char* sIndentation = " "; const Point aLocation (pRoot->GetPosPixel()); const Size aSize (pRoot->GetSizePixel()); const char* sClassification = GetWindowClassification(pRoot); Modified: openoffice/trunk/main/sfx2/source/sidebar/DeckLayouter.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/DeckLayouter.cxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/source/sidebar/DeckLayouter.cxx (original) +++ openoffice/trunk/main/sfx2/source/sidebar/DeckLayouter.cxx Fri Apr 19 09:51:45 2013 @@ -353,7 +353,6 @@ void DeckLayouter::DistributeHeights ( // (either its minimum or preferred height) and the container height. sal_Int32 nTotalWeight (0); sal_Int32 nNoMaximumCount (0); - sal_Int32 nIndex (0); IterateLayoutItems(iItem,rLayoutItems) { if (iItem->maLayoutSize.Maximum == 0) @@ -376,7 +375,6 @@ void DeckLayouter::DistributeHeights ( return; // First pass of height distribution. - nIndex = 0; IterateLayoutItems(iItem,rLayoutItems) { const sal_Int32 nBaseHeight ( @@ -410,7 +408,6 @@ void DeckLayouter::DistributeHeights ( // Handle rounding error. sal_Int32 nAdditionalHeightForFirstPanel (nRemainingHeightToDistribute - nNoMaximumCount*nAdditionalHeightPerPanel); - nIndex = 0; IterateLayoutItems(iItem,rLayoutItems) { if (iItem->maLayoutSize.Maximum < 0) Modified: openoffice/trunk/main/sfx2/source/sidebar/FocusManager.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/FocusManager.cxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/source/sidebar/FocusManager.cxx (original) +++ openoffice/trunk/main/sfx2/source/sidebar/FocusManager.cxx Fri Apr 19 09:51:45 2013 @@ -47,11 +47,12 @@ namespace if (rPanel.HasFocus()) return PC_Content; else if (rPanel.GetTitleBar() != NULL) + { if (rPanel.GetTitleBar()->HasFocus()) return PC_TitleBar; else if (rPanel.GetTitleBar()->GetToolBox().HasFocus()) return PC_ToolBox; - + } return PC_None; } } Modified: openoffice/trunk/main/sfx2/source/sidebar/SidebarChildWindow.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/SidebarChildWindow.cxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/source/sidebar/SidebarChildWindow.cxx (original) +++ openoffice/trunk/main/sfx2/source/sidebar/SidebarChildWindow.cxx Fri Apr 19 09:51:45 2013 @@ -35,23 +35,25 @@ SFX_IMPL_DOCKINGWINDOW(SidebarChildWindo SidebarChildWindow::SidebarChildWindow ( - Window* pParent, + Window* pParentWindow, sal_uInt16 nId, SfxBindings* pBindings, - SfxChildWinInfo* pInfo ) - : SfxChildWindow(pParent, nId) + SfxChildWinInfo* pInfo) + : SfxChildWindow(pParentWindow, nId) { this->pWindow = new SidebarDockingWindow( pBindings, *this, - pParent, + pParentWindow, WB_STDDOCKWIN | WB_OWNERDRAWDECORATION | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE); eChildAlignment = SFX_ALIGN_RIGHT; this->pWindow->SetHelpId(HID_SIDEBAR_WINDOW); this->pWindow->SetOutputSizePixel(Size(300, 450)); - dynamic_cast<SfxDockingWindow*>(pWindow)->Initialize(pInfo); + SfxDockingWindow* pDockingParent = dynamic_cast<SfxDockingWindow*>(pParentWindow); + if (pDockingParent != NULL) + pDockingParent->Initialize(pInfo); SetHideNotDelete(sal_True); this->pWindow->Show(); Modified: openoffice/trunk/main/svx/Library_svx.mk URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/Library_svx.mk?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/svx/Library_svx.mk (original) +++ openoffice/trunk/main/svx/Library_svx.mk Fri Apr 19 09:51:45 2013 @@ -47,6 +47,7 @@ $(eval $(call gb_Library_add_linked_libs cppu \ drawinglayer \ editeng \ + fwk \ i18nisolang1 \ icuuc \ sal \ Modified: openoffice/trunk/main/svx/source/sidebar/area/AreaPropertyPanel.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/area/AreaPropertyPanel.cxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/area/AreaPropertyPanel.cxx (original) +++ openoffice/trunk/main/svx/source/sidebar/area/AreaPropertyPanel.cxx Fri Apr 19 09:51:45 2013 @@ -747,8 +747,11 @@ void AreaPropertyPanel::ImpUpdateTranspa void AreaPropertyPanel::NotifyItemUpdate( sal_uInt16 nSID, SfxItemState eState, - const SfxPoolItem* pState) -{ + const SfxPoolItem* pState, + const bool bIsEnabled) +{ + (void)bIsEnabled; + XFillStyle eXFS; SfxObjectShell* pSh = SfxObjectShell::Current(); bool bFillTransparenceChanged(false); @@ -1054,6 +1057,7 @@ void AreaPropertyPanel::NotifyItemUpdate + SfxBindings* AreaPropertyPanel::GetBindings() { return mpBindings; Modified: openoffice/trunk/main/svx/source/sidebar/area/AreaPropertyPanel.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/area/AreaPropertyPanel.hxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/area/AreaPropertyPanel.hxx (original) +++ openoffice/trunk/main/svx/source/sidebar/area/AreaPropertyPanel.hxx Fri Apr 19 09:51:45 2013 @@ -69,7 +69,8 @@ public: virtual void NotifyItemUpdate( const sal_uInt16 nSId, const SfxItemState eState, - const SfxPoolItem* pState); + const SfxPoolItem* pState, + const bool bIsEnabled); SfxBindings* GetBindings(); Modified: openoffice/trunk/main/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx (original) +++ openoffice/trunk/main/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx Fri Apr 19 09:51:45 2013 @@ -276,8 +276,11 @@ void GraphicPropertyPanel::DataChanged( void GraphicPropertyPanel::NotifyItemUpdate( sal_uInt16 nSID, SfxItemState eState, - const SfxPoolItem* pState) + const SfxPoolItem* pState, + const bool bIsEnabled) { + (void)bIsEnabled; + switch( nSID ) { case SID_ATTR_GRAF_LUMINANCE: @@ -443,6 +446,9 @@ void GraphicPropertyPanel::NotifyItemUpd } } + + + ////////////////////////////////////////////////////////////////////////////// SfxBindings* GraphicPropertyPanel::GetBindings() Modified: openoffice/trunk/main/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx (original) +++ openoffice/trunk/main/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx Fri Apr 19 09:51:45 2013 @@ -52,7 +52,8 @@ public: virtual void NotifyItemUpdate( const sal_uInt16 nSId, const SfxItemState eState, - const SfxPoolItem* pState); + const SfxPoolItem* pState, + const bool bIsEnabled); SfxBindings* GetBindings(); Modified: openoffice/trunk/main/svx/source/sidebar/line/LinePropertyPanel.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/line/LinePropertyPanel.cxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/line/LinePropertyPanel.cxx (original) +++ openoffice/trunk/main/svx/source/sidebar/line/LinePropertyPanel.cxx Fri Apr 19 09:51:45 2013 @@ -401,8 +401,11 @@ void LinePropertyPanel::DataChanged( void LinePropertyPanel::NotifyItemUpdate( sal_uInt16 nSID, SfxItemState eState, - const SfxPoolItem* pState) + const SfxPoolItem* pState, + const bool bIsEnabled) { + (void)bIsEnabled; + switch(nSID) { case SID_ATTR_LINE_COLOR: @@ -702,6 +705,7 @@ void LinePropertyPanel::NotifyItemUpdate + SfxBindings* LinePropertyPanel::GetBindings() { return mpBindings; Modified: openoffice/trunk/main/svx/source/sidebar/line/LinePropertyPanel.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/line/LinePropertyPanel.hxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/line/LinePropertyPanel.hxx (original) +++ openoffice/trunk/main/svx/source/sidebar/line/LinePropertyPanel.hxx Fri Apr 19 09:51:45 2013 @@ -79,7 +79,8 @@ public: virtual void NotifyItemUpdate( const sal_uInt16 nSId, const SfxItemState eState, - const SfxPoolItem* pState); + const SfxPoolItem* pState, + const bool bIsEnabled); SfxBindings* GetBindings(); Modified: openoffice/trunk/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx (original) +++ openoffice/trunk/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx Fri Apr 19 09:51:45 2013 @@ -1032,8 +1032,14 @@ IMPL_LINK(ParaPropertyPanel, ClickUL_Inc } //==================================for Paragraph State change===================== -void ParaPropertyPanel::NotifyItemUpdate( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) -{ +void ParaPropertyPanel::NotifyItemUpdate( + sal_uInt16 nSID, + SfxItemState eState, + const SfxPoolItem* pState, + const bool bIsEnabled) +{ + (void)bIsEnabled; + if( nSID == SID_ATTR_METRIC ) { m_eMetricUnit = GetCurrentUnit(eState,pState); @@ -1083,6 +1089,9 @@ void ParaPropertyPanel::NotifyItemUpdate } } + + + void ParaPropertyPanel::StateChangedAlignmentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) { if( eState >= SFX_ITEM_AVAILABLE ) Modified: openoffice/trunk/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx (original) +++ openoffice/trunk/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx Fri Apr 19 09:51:45 2013 @@ -80,7 +80,8 @@ public: virtual void NotifyItemUpdate( const sal_uInt16 nSId, const SfxItemState eState, - const SfxPoolItem* pState); + const SfxPoolItem* pState, + const bool bIsEnabled); void ShowMenu (void); sal_uInt16 GetBulletTypeIndex(){ return mnBulletTypeIndex; } Modified: openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx (original) +++ openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx Fri Apr 19 09:51:45 2013 @@ -633,7 +633,8 @@ IMPL_LINK( PosSizePropertyPanel, FlipHdl void PosSizePropertyPanel::NotifyItemUpdate( sal_uInt16 nSID, SfxItemState eState, - const SfxPoolItem* pState) + const SfxPoolItem* pState, + const bool bIsEnabled) { mpFtAngle->Enable(); mpMtrAngle->Enable(); @@ -956,6 +957,7 @@ void PosSizePropertyPanel::NotifyItemUpd + SfxBindings* PosSizePropertyPanel::GetBindings() { return mpBindings; Modified: openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx (original) +++ openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx Fri Apr 19 09:51:45 2013 @@ -65,7 +65,8 @@ public: virtual void NotifyItemUpdate( const sal_uInt16 nSId, const SfxItemState eState, - const SfxPoolItem* pState); + const SfxPoolItem* pState, + const bool bIsEnabled); SfxBindings* GetBindings(); void ShowMenu (void); Modified: openoffice/trunk/main/svx/source/sidebar/text/TextCharacterSpacingControl.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/text/TextCharacterSpacingControl.cxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/text/TextCharacterSpacingControl.cxx (original) +++ openoffice/trunk/main/svx/source/sidebar/text/TextCharacterSpacingControl.cxx Fri Apr 19 09:51:45 2013 @@ -32,10 +32,14 @@ #include <sfx2/sidebar/Theme.hxx> namespace svx { namespace sidebar { -TextCharacterSpacingControl::TextCharacterSpacingControl(Window* pParent, svx::sidebar::TextPropertyPanel& rPanel) + +TextCharacterSpacingControl::TextCharacterSpacingControl ( + Window* pParent, + svx::sidebar::TextPropertyPanel& rPanel, + SfxBindings* pBindings) : PopupControl( pParent,SVX_RES(RID_POPUPPANEL_TEXTPAGE_SPACING)) , mrTextPropertyPanel(rPanel) -, mpBindings(NULL) +, mpBindings(pBindings) , maVSSpacing (ValueSetWithTextControl::IMAGE_TEXT,this, SVX_RES(VS_SPACING)) , maLastCus (this, SVX_RES(FT_LASTCUSTOM)) //, maBorder (this, SVX_RES(CT_BORDER)) @@ -64,7 +68,6 @@ TextCharacterSpacingControl::TextCharact { initial(); FreeResource(); - mpBindings = mrTextPropertyPanel.GetBindings(); Link aLink = LINK(this, TextCharacterSpacingControl, KerningSelectHdl); maLBKerning.SetSelectHdl(aLink); aLink =LINK(this, TextCharacterSpacingControl, KerningModifyHdl); Modified: openoffice/trunk/main/svx/source/sidebar/text/TextCharacterSpacingControl.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/text/TextCharacterSpacingControl.hxx?rev=1469765&r1=1469764&r2=1469765&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/text/TextCharacterSpacingControl.hxx (original) +++ openoffice/trunk/main/svx/source/sidebar/text/TextCharacterSpacingControl.hxx Fri Apr 19 09:51:45 2013 @@ -40,11 +40,15 @@ namespace svx { namespace sidebar { #define SIDEBAR_SPACE_NORMAL 0 #define SIDEBAR_SPACE_EXPAND 1 #define SIDEBAR_SPACE_CONDENSED 2 + class TextCharacterSpacingControl:public svx::sidebar::PopupControl { public: - TextCharacterSpacingControl(Window* pParent, svx::sidebar::TextPropertyPanel& rPanel); - ~TextCharacterSpacingControl(); + TextCharacterSpacingControl ( + Window* pParent, + svx::sidebar::TextPropertyPanel& rPanel, + SfxBindings* pBindings); + virtual ~TextCharacterSpacingControl(); void ToGetFocus(); void Rearrange(bool bLBAvailable,bool bAvailable, long nKerning); //virtual void Paint(const Rectangle& rect);