diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2009-11-06 13:06:51 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2009-11-06 13:06:51 +0100 |
commit | 66d894d69932280f11d77eeaf3e366e9d9b43d7e (patch) | |
tree | e6eaace4b329a944ce4e60156a68a03b2cdbd4c4 /forms/source/solar/control/navtoolbar.cxx | |
parent | dbec2d8a2455110a3d8ec8c8294aad54b095bf6d (diff) |
#i106671# use proper UNO API to not only retrieve images for our slots, but also the command descriptions, which are to be used as quick help text
Diffstat (limited to 'forms/source/solar/control/navtoolbar.cxx')
-rw-r--r-- | forms/source/solar/control/navtoolbar.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx index d220f473f..e79e0272a 100644 --- a/forms/source/solar/control/navtoolbar.cxx +++ b/forms/source/solar/control/navtoolbar.cxx @@ -36,6 +36,7 @@ #include "featuredispatcher.hxx" #include "frm_resource.hrc" #include "commandimageprovider.hxx" +#include "commanddescriptionprovider.hxx" #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/form/runtime/FormFeature.hpp> @@ -157,10 +158,12 @@ namespace frm //===================================================================== DBG_NAME( NavigationToolBar ) //--------------------------------------------------------------------- - NavigationToolBar::NavigationToolBar( Window* _pParent, WinBits _nStyle, const ::boost::shared_ptr< const ICommandImageProvider >& _pImageProvider ) + NavigationToolBar::NavigationToolBar( Window* _pParent, WinBits _nStyle, const PCommandImageProvider& _pImageProvider, + const PCommandDescriptionProvider& _pDescriptionProvider ) :Window( _pParent, _nStyle ) ,m_pDispatcher( NULL ) ,m_pImageProvider( _pImageProvider ) + ,m_pDescriptionProvider( _pDescriptionProvider ) ,m_eImageSize( eSmall ) ,m_pToolbar( NULL ) { @@ -310,8 +313,14 @@ namespace frm // insert the entry m_pToolbar->InsertItem( pSupportedFeatures->nId, String(), pSupportedFeatures->bRepeat ? TIB_REPEAT : 0 ); m_pToolbar->SetQuickHelpText( pSupportedFeatures->nId, String() ); // TODO + if ( !isArtificialItem( pSupportedFeatures->nId ) ) - m_pToolbar->SetItemCommand( pSupportedFeatures->nId, lcl_getCommandURL( pSupportedFeatures->nId ) ); + { + ::rtl::OUString sCommandURL( lcl_getCommandURL( pSupportedFeatures->nId ) ); + m_pToolbar->SetItemCommand( pSupportedFeatures->nId, sCommandURL ); + if ( m_pDescriptionProvider ) + m_pToolbar->SetQuickHelpText( pSupportedFeatures->nId, m_pDescriptionProvider->getCommandDescription( sCommandURL ) ); + } if ( pSupportedFeatures->bItemWindow ) { |