diff --git a/framework/inc/classes/menuconfiguration.hxx b/framework/inc/classes/menuconfiguration.hxx index 54b9093af267..1fcbd74375b0 100644 --- a/framework/inc/classes/menuconfiguration.hxx +++ b/framework/inc/classes/menuconfiguration.hxx @@ -2,9 +2,9 @@ * * $RCSfile: menuconfiguration.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: mba $ $Date: 2001-05-10 07:43:34 $ + * last change: $Author: pb $ $Date: 2001-05-11 10:09:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,6 +82,10 @@ #include #endif +#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_ +#include +#endif + //_________________________________________________________________________________________________________________ // includes of other projects //_________________________________________________________________________________________________________________ @@ -89,6 +93,9 @@ #include #include +#define BOOKMARK_NEWMENU ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:menu_bookmark_new" )) +#define BOOKMARK_WIZARDMENU ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:menu_bookmark_wizard" )) + const USHORT START_ITEMID_PICKLIST = 4500; const USHORT END_ITEMID_PICKLIST = 4599; const USHORT START_ITEMID_WINDOWLIST = 4600; @@ -109,6 +116,11 @@ class MenuConfiguration ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rInputStream ) throw ( ::com::sun::star::lang::WrappedTargetException ); + Menu* CreateBookmarkMenu( + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, + const ::rtl::OUString& aURL ) + throw ( ::com::sun::star::lang::WrappedTargetException ); + ToolBox* CreateToolBoxFromConfiguration( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rInputStream ) throw ( ::com::sun::star::lang::WrappedTargetException ); @@ -128,3 +140,4 @@ class MenuConfiguration } #endif // __FRAMEWORK_CLASSES_MENUCONFIGURATION_HXX_ + diff --git a/framework/inc/classes/menumanager.hxx b/framework/inc/classes/menumanager.hxx index cd9bc3894743..6a09422b8fb6 100644 --- a/framework/inc/classes/menumanager.hxx +++ b/framework/inc/classes/menumanager.hxx @@ -2,9 +2,9 @@ * * $RCSfile: menumanager.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: cd $ $Date: 2001-05-03 08:03:31 $ + * last change: $Author: pb $ $Date: 2001-05-11 10:09:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -171,10 +171,6 @@ class MenuManager : public XSTATUSLISTENER , void UpdateSpecialWindowMenu( Menu* pMenu ); - BmkMenu* CreateBookmarkMenu( - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, - const ::rtl::OUString& aURL ); - struct MenuItemHandler { MenuItemHandler( USHORT aItemId, MenuManager* pManager, REFERENCE< XDISPATCH >& rDispatch ) : diff --git a/framework/source/classes/menumanager.cxx b/framework/source/classes/menumanager.cxx index 7cbb4f1ad432..eeda87696a01 100644 --- a/framework/source/classes/menumanager.cxx +++ b/framework/source/classes/menumanager.cxx @@ -2,9 +2,9 @@ * * $RCSfile: menumanager.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: mba $ $Date: 2001-05-10 07:50:01 $ + * last change: $Author: pb $ $Date: 2001-05-11 10:10:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -172,8 +172,6 @@ namespace framework #define SID_MDIWINDOWLIST (SID_SFX_START + 610) #define SFX_REFERER_USER "private:user" -#define BOOKMARK_NEWMENU ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:menu_bookmark_new" )) -#define BOOKMARK_WIZARDMENU ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:menu_bookmark_wizard" )) #define DESKTOP_SERVICE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" )) const ::rtl::OUString aSlotString( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); @@ -233,7 +231,8 @@ MenuManager::MenuManager( REFERENCE< XFRAME >& rFrame, Menu* pMenu, sal_Bool bDe if ( nItemId == SID_NEWDOCDIRECT || aItemCommand == aSlotNewDocDirect ) { - BmkMenu* pSubMenu = CreateBookmarkMenu( rFrame, BOOKMARK_NEWMENU ); + MenuConfiguration aMenuCfg( ::comphelper::getProcessServiceFactory() ); + BmkMenu* pSubMenu = (BmkMenu*)aMenuCfg.CreateBookmarkMenu( rFrame, BOOKMARK_NEWMENU ); pMenu->SetPopupMenu( nItemId, pSubMenu ); MenuManager* pSubMenuManager = new MenuManager( rFrame, pSubMenu, sal_True, sal_False ); MenuItemHandler* pMenuItemHandler = new MenuItemHandler( @@ -246,7 +245,8 @@ MenuManager::MenuManager( REFERENCE< XFRAME >& rFrame, Menu* pMenu, sal_Bool bDe else if ( nItemId == SID_AUTOPILOTMENU || aItemCommand == aSlotAutoPilot ) { - BmkMenu* pSubMenu = CreateBookmarkMenu( rFrame, BOOKMARK_WIZARDMENU ); + MenuConfiguration aMenuCfg( ::comphelper::getProcessServiceFactory() ); + BmkMenu* pSubMenu = (BmkMenu*)aMenuCfg.CreateBookmarkMenu( rFrame, BOOKMARK_WIZARDMENU ); pMenu->SetPopupMenu( nItemId, pSubMenu ); MenuManager* pSubMenuManager = new MenuManager( rFrame, pSubMenu, sal_True, sal_False ); MenuItemHandler* pMenuItemHandler = new MenuItemHandler( @@ -271,7 +271,7 @@ MenuManager::MenuManager( REFERENCE< XFRAME >& rFrame, Menu* pMenu, sal_Bool bDe // retrieve label information for all menu items without item text -#if SUPD > 631 +#if 0 if ( aQueryLabelItemIdVector.size() > 0 ) { Sequence< ::rtl::OUString > aURLSequence( aQueryLabelItemIdVector.size() ); @@ -353,10 +353,6 @@ MenuManager::MenuManager( REFERENCE< XFRAME >& rFrame, BmkMenu* pBmkMenu, sal_Bo pBmkMenu->SetUserValue( nItemId, 0 ); } - Image aImage = GetImageFromURL( rFrame, aItemCommand, FALSE ); - if ( !!aImage ) - pBmkMenu->SetItemImage( nItemId, aImage ); - m_aMenuItemHandlerVector.push_back( pMenuItemHandler ); } } @@ -551,19 +547,6 @@ void SAL_CALL MenuManager::disposing( const EVENTOBJECT& Source ) throw ( RUNTIM } -BmkMenu* MenuManager::CreateBookmarkMenu( - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, - const ::rtl::OUString& aURL ) -{ - if ( aURL == BOOKMARK_NEWMENU ) - return new BmkMenu( rFrame, BmkMenu::BMK_NEWMENU ); - else if ( aURL == BOOKMARK_WIZARDMENU ) - return new BmkMenu( rFrame, BmkMenu::BMK_WIZARDMENU ); - else - return NULL; -} - - void MenuManager::UpdateSpecialFileMenu( Menu* pMenu ) { // update picklist @@ -912,6 +895,7 @@ IMPL_LINK( MenuManager, Select, Menu *, pMenu ) Reference< XTasksSupplier > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance( DESKTOP_SERVICE ), UNO_QUERY ); USHORT nWindowItemId = START_ITEMID_WINDOWLIST; + if ( xDesktop.is() ) { USHORT nTaskId = START_ITEMID_WINDOWLIST; @@ -941,6 +925,7 @@ IMPL_LINK( MenuManager, Select, Menu *, pMenu ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY ); aTargetURL.Complete = pMenuItemHandler->aMenuItemURL; xTrans->parseStrict( aTargetURL ); + if ( nCurItemId >= START_ITEMID_PICKLIST && nCurItemId < START_ITEMID_WINDOWLIST ) { @@ -965,6 +950,7 @@ IMPL_LINK( MenuManager, Select, Menu *, pMenu ) if ( xDispatch.is() ) xDispatch->dispatch( aTargetURL, aArgs ); + return 1; }