diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-02-25 22:29:48 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-02-27 09:45:56 +0000 |
commit | b737e913c4594d07270d9b59f6ca3792482e2356 (patch) | |
tree | 5d49a8a7f372df11813a5979111a83708d2cac66 /sfx2 | |
parent | 1190dab820a60907559fb1e7d8e6e5d4d58ecfdf (diff) |
callcatcher: update unused list
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/mnuitem.hxx | 17 | ||||
-rw-r--r-- | sfx2/source/menu/mnuitem.cxx | 97 | ||||
-rw-r--r-- | sfx2/source/menu/thessubmenu.cxx | 66 | ||||
-rw-r--r-- | sfx2/source/menu/thessubmenu.hxx | 19 |
4 files changed, 0 insertions, 199 deletions
diff --git a/sfx2/inc/sfx2/mnuitem.hxx b/sfx2/inc/sfx2/mnuitem.hxx index 88871d598084..4350aae47384 100644 --- a/sfx2/inc/sfx2/mnuitem.hxx +++ b/sfx2/inc/sfx2/mnuitem.hxx @@ -126,23 +126,6 @@ inline SfxVirtualMenu* SfxMenuControl::GetPopupMenu() const void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \ { SfxMenuControl::RegisterMenuControl( pMod, new SfxMenuCtrlFactory( \ Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); } - - -class SfxAppMenuControl_Impl : public SfxMenuControl -{ - PopupMenu* pMenu; - sal_uIntPtr m_nSymbolsStyle; - sal_Bool m_bShowMenuImages; - -protected: - DECL_LINK( Activate, Menu * ); - -public: - static SfxMenuControl* CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings ); - SfxAppMenuControl_Impl( sal_uInt16 nPos, Menu& rMenu, SfxBindings& rBindings ); - ~SfxAppMenuControl_Impl(); -}; - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx index c01f7b37a3b7..49dce66a07e8 100644 --- a/sfx2/source/menu/mnuitem.cxx +++ b/sfx2/source/menu/mnuitem.cxx @@ -301,103 +301,6 @@ PopupMenu* SfxMenuControl::GetPopup () const return 0; } -long Select_Impl( void* pHdl, void* pVoid ); - -SfxMenuControl* SfxAppMenuControl_Impl::CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings ) -{ - return new SfxAppMenuControl_Impl(nId, rMenu, rBindings); -} - -SfxAppMenuControl_Impl::SfxAppMenuControl_Impl( - sal_uInt16 nPos, Menu& rMenu, SfxBindings& rBindings ) - : SfxMenuControl( nPos, rBindings ), pMenu(0) -{ - String aText = rMenu.GetItemText( nPos ); - - // Determine the current background color setting for menus - const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - m_nSymbolsStyle = rSettings.GetSymbolsStyle(); - m_bShowMenuImages = rSettings.GetUseImagesInMenus(); - - Reference<com::sun::star::lang::XMultiServiceFactory> aXMultiServiceFactory(::comphelper::getProcessServiceFactory()); - ::framework::MenuConfiguration aConf( aXMultiServiceFactory ); - Reference<com::sun::star::frame::XFrame> aXFrame( GetBindings().GetDispatcher_Impl()->GetFrame()->GetFrame().GetFrameInterface() ); - pMenu = aConf.CreateBookmarkMenu( aXFrame, GetId() == SID_NEWDOCDIRECT ? BOOKMARK_NEWMENU : BOOKMARK_WIZARDMENU ); - if( pMenu ) - { - pMenu->SetSelectHdl( Link( &(this->GetBindings()), Select_Impl ) ); - pMenu->SetActivateHdl( LINK(this, SfxAppMenuControl_Impl, Activate) ); - rMenu.SetPopupMenu( nPos, pMenu ); - } -} - -SfxAppMenuControl_Impl::~SfxAppMenuControl_Impl() -{ - delete pMenu; -} - -IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu ) -{ - if ( pActMenu ) - { - const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - sal_uIntPtr nSymbolsStyle = rSettings.GetSymbolsStyle(); - sal_Bool bShowMenuImages = rSettings.GetUseImagesInMenus(); - - if (( nSymbolsStyle != m_nSymbolsStyle ) || - ( bShowMenuImages != m_bShowMenuImages )) - { - m_nSymbolsStyle = nSymbolsStyle; - m_bShowMenuImages = bShowMenuImages; - - sal_uInt16 nCount = pActMenu->GetItemCount(); - for ( sal_uInt16 nSVPos = 0; nSVPos < nCount; nSVPos++ ) - { - sal_uInt16 nItemId = pActMenu->GetItemId( nSVPos ); - if ( pActMenu->GetItemType( nSVPos ) != MENUITEM_SEPARATOR ) - { - if ( bShowMenuImages ) - { - sal_Bool bImageSet = sal_False; - ::rtl::OUString aImageId; - ::framework::MenuConfiguration::Attributes* pMenuAttributes = - (::framework::MenuConfiguration::Attributes*)pMenu->GetUserValue( nItemId ); - - if ( pMenuAttributes ) - aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes - - if ( !aImageId.isEmpty() ) - { - Reference< ::com::sun::star::frame::XFrame > xFrame; - Image aImage = GetImage( xFrame, aImageId, false ); - if ( !!aImage ) - { - bImageSet = sal_True; - pActMenu->SetItemImage( nItemId, aImage ); - } - } - - String aCmd( pActMenu->GetItemCommand( nItemId ) ); - if ( !bImageSet && aCmd.Len() ) - { - Image aImage = SvFileInformationManager::GetImage( - INetURLObject(aCmd), false ); - if ( !!aImage ) - pActMenu->SetItemImage( nItemId, aImage ); - } - } - else - pActMenu->SetItemImage( nItemId, Image() ); - } - } - } - - return sal_True; - } - - return sal_False; -} - SfxUnoMenuControl* SfxMenuControl::CreateControl( const String& rCmd, sal_uInt16 nId, Menu& rMenu, const String& sItemText, SfxBindings& rBindings, SfxVirtualMenu* pVirt) diff --git a/sfx2/source/menu/thessubmenu.cxx b/sfx2/source/menu/thessubmenu.cxx index 1bda672e3610..21d44dc8ced5 100644 --- a/sfx2/source/menu/thessubmenu.cxx +++ b/sfx2/source/menu/thessubmenu.cxx @@ -46,75 +46,9 @@ #include <sfx2/viewsh.hxx> #include "thessubmenu.hxx" - using namespace ::com::sun::star; using ::rtl::OUString; - -// STATIC DATA ----------------------------------------------------------- - -SfxMenuControl* SfxThesSubMenuControl::CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings ) -{ - return new SfxThesSubMenuControl(nId, rMenu, rBindings); -} - -/* - Constructor; sets the Select-Handler for the Menu and inserts it into - its Parent. - */ -SfxThesSubMenuControl::SfxThesSubMenuControl( sal_uInt16 nSlotId, Menu &rMenu, SfxBindings &rBindings ) - : SfxMenuControl( nSlotId, rBindings ), - pMenu(new PopupMenu), - rParent(rMenu) -{ - rMenu.SetPopupMenu(nSlotId, pMenu); - pMenu->SetSelectHdl(LINK(this, SfxThesSubMenuControl, MenuSelect)); - pMenu->Clear(); - rParent.EnableItem( GetId(), sal_False ); -} - - -SfxThesSubMenuControl::~SfxThesSubMenuControl() -{ - delete pMenu; -} - - -/* - Status notification: - If the functionality is disabled, the corresponding - menu entry in Parentmenu is disabled, otherwise it is enabled. - */ -void SfxThesSubMenuControl::StateChanged( - sal_uInt16 /*nSID*/, - SfxItemState eState, - const SfxPoolItem* /*pState*/ ) -{ - rParent.EnableItem(GetId(), SFX_ITEM_AVAILABLE == eState ); -} - - -/* - Select-Handler for Menus; - run the selected Verb, - */ -IMPL_LINK_INLINE_START( SfxThesSubMenuControl, MenuSelect, Menu *, pSelMenu ) -{ - const sal_uInt16 nSlotId = pSelMenu->GetCurItemId(); - if( nSlotId ) - GetBindings().Execute(nSlotId); - return 1; -} -IMPL_LINK_INLINE_END( SfxThesSubMenuControl, MenuSelect, Menu *, pSelMenu ) - - -PopupMenu* SfxThesSubMenuControl::GetPopup() const -{ - return pMenu; -} - - - OUString SfxThesSubMenuHelper::GetText( const String &rLookUpString, xub_StrLen nDelimPos ) diff --git a/sfx2/source/menu/thessubmenu.hxx b/sfx2/source/menu/thessubmenu.hxx index b177b112d58a..9e7b48e16735 100644 --- a/sfx2/source/menu/thessubmenu.hxx +++ b/sfx2/source/menu/thessubmenu.hxx @@ -42,25 +42,6 @@ class Menu; namespace css = ::com::sun::star; -class SfxThesSubMenuControl : public SfxMenuControl -{ - PopupMenu* pMenu; - Menu& rParent; - -private: - virtual void StateChanged( sal_uInt16, SfxItemState, const SfxPoolItem* pState ); - DECL_LINK( MenuSelect, Menu * ); - -public: - SfxThesSubMenuControl(sal_uInt16, Menu&, SfxBindings&); - ~SfxThesSubMenuControl(); - - virtual PopupMenu* GetPopup() const; - - static SfxMenuControl* CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings ); -}; - - class SfxThesSubMenuHelper { css::uno::Reference< css::linguistic2::XLinguServiceManager > m_xLngMgr; |