2001-04-02 13:11:42 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* $RCSfile: menumanager.cxx,v $
|
|
|
|
*
|
2002-04-11 10:49:39 +00:00
|
|
|
* $Revision: 1.25 $
|
2001-04-02 13:11:42 +00:00
|
|
|
*
|
2002-04-11 10:49:39 +00:00
|
|
|
* last change: $Author: cd $ $Date: 2002-04-11 11:45:40 $
|
2001-04-02 13:11:42 +00:00
|
|
|
*
|
|
|
|
* The Contents of this file are made available subject to the terms of
|
|
|
|
* either of the following licenses
|
|
|
|
*
|
|
|
|
* - GNU Lesser General Public License Version 2.1
|
|
|
|
* - Sun Industry Standards Source License Version 1.1
|
|
|
|
*
|
|
|
|
* Sun Microsystems Inc., October, 2000
|
|
|
|
*
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2000 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Sun Industry Standards Source License Version 1.1
|
|
|
|
* =================================================
|
|
|
|
* The contents of this file are subject to the Sun Industry Standards
|
|
|
|
* Source License Version 1.1 (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.openoffice.org/license.html.
|
|
|
|
*
|
|
|
|
* Software provided under this License is provided on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
|
|
|
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
|
|
|
|
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
|
|
|
|
* See the License for the specific provisions governing your rights and
|
|
|
|
* obligations concerning the Software.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* Copyright: 2000 by Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s): _______________________________________
|
|
|
|
*
|
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
// my own includes
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
|
2001-05-03 07:06:26 +00:00
|
|
|
#ifndef __FRAMEWORK_CLASSES_MENUMANAGER_HXX_
|
2001-04-02 13:11:42 +00:00
|
|
|
#include <classes/menumanager.hxx>
|
2001-05-03 07:06:26 +00:00
|
|
|
#endif
|
|
|
|
|
2001-05-10 06:51:25 +00:00
|
|
|
#ifndef __FRAMEWORK_CLASSES_MENUCONFIGURATION_HXX_
|
|
|
|
#include <classes/menuconfiguration.hxx>
|
|
|
|
#endif
|
|
|
|
|
2001-05-03 07:06:26 +00:00
|
|
|
#ifndef __FRAMEWORK_CLASSES_BMKMENU_HXX
|
2001-04-09 07:10:56 +00:00
|
|
|
#include <classes/bmkmenu.hxx>
|
2001-05-03 07:06:26 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __FRAMEWORK_HELPER_IMAGEPRODUCER_HXX_
|
|
|
|
#include <helper/imageproducer.hxx>
|
|
|
|
#endif
|
2001-04-02 13:11:42 +00:00
|
|
|
|
2001-06-11 09:29:50 +00:00
|
|
|
#ifndef __FRAMEWORK_THREADHELP_RESETABLEGUARD_HXX_
|
|
|
|
#include <threadhelp/resetableguard.hxx>
|
|
|
|
#endif
|
|
|
|
|
2001-04-02 13:11:42 +00:00
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
// interface includes
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_
|
|
|
|
#include <com/sun/star/frame/XDispatchProvider.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_
|
|
|
|
#include <com/sun/star/frame/XDispatch.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_UTIL_XURLTRANSFORMER_HPP_
|
|
|
|
#include <com/sun/star/util/XURLTransformer.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
|
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
|
|
|
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
|
|
|
#endif
|
2001-05-02 04:44:28 +00:00
|
|
|
#ifndef _COM_SUN_STAR_FRAME_XTASKSSUPPLIER_HPP_
|
|
|
|
#include <com/sun/star/frame/XTasksSupplier.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_FRAME_XDESKTOP_HPP_
|
|
|
|
#include <com/sun/star/frame/XDesktop.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_CONTAINER_XENUMERATION_HPP_
|
|
|
|
#include <com/sun/star/container/XEnumeration.hpp>
|
|
|
|
#endif
|
2001-11-02 06:56:17 +00:00
|
|
|
#ifndef _DRAFTS_COM_SUN_STAR_FRAME_XDISPATCHINFORMATIONPROVIDER_HPP_
|
|
|
|
#include <drafts/com/sun/star/frame/XDispatchInformationProvider.hpp>
|
2001-05-04 16:48:14 +00:00
|
|
|
#endif
|
2001-12-10 10:26:55 +00:00
|
|
|
#ifndef _COM_SUN_STAR_UTIL_XSTRINGWIDTH_HPP_
|
|
|
|
#include <com/sun/star/util/XStringWidth.hpp>
|
|
|
|
#endif
|
2001-04-02 13:11:42 +00:00
|
|
|
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
// includes of other projects
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
|
|
|
|
#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
|
|
|
|
#include <comphelper/processfactory.hxx>
|
|
|
|
#endif
|
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
#include <comphelper/extract.hxx>
|
|
|
|
|
2001-04-02 13:11:42 +00:00
|
|
|
#ifndef INCLUDED_SVTOOLS_MENUOPTIONS_HXX
|
|
|
|
#include <svtools/menuoptions.hxx>
|
|
|
|
#endif
|
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
#ifndef INCLUDED_SVTOOLS_HISTORYOPTIONS_HXX
|
|
|
|
#include <svtools/historyoptions.hxx>
|
|
|
|
#endif
|
|
|
|
|
2001-04-09 07:10:56 +00:00
|
|
|
#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX
|
|
|
|
#include <svtools/pathoptions.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _UNOTOOLS_LOCALFILEHELPER_HXX
|
|
|
|
#include <unotools/localfilehelper.hxx>
|
|
|
|
#endif
|
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
|
|
|
|
#include <toolkit/unohlp.hxx>
|
|
|
|
#endif
|
2001-04-02 13:11:42 +00:00
|
|
|
|
2001-12-10 10:26:55 +00:00
|
|
|
#ifndef _URLOBJ_HXX
|
|
|
|
#include <tools/urlobj.hxx>
|
|
|
|
#endif
|
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
#include <vcl/window.hxx>
|
2001-04-02 13:11:42 +00:00
|
|
|
#include <vos/mutex.hxx>
|
|
|
|
|
2001-06-11 09:29:50 +00:00
|
|
|
#ifndef _SV_SVAPP_HXX
|
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
#endif
|
|
|
|
|
2001-12-10 10:26:55 +00:00
|
|
|
#ifndef _OSL_FILE_HXX_
|
|
|
|
#include <osl/file.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _CPPUHELPER_IMPLBASE1_HXX_
|
|
|
|
#include <cppuhelper/implbase1.hxx>
|
|
|
|
#endif
|
|
|
|
|
2001-04-02 13:11:42 +00:00
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
// namespace
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
|
|
|
|
using namespace ::cppu;
|
|
|
|
using namespace ::vos;
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::util;
|
|
|
|
using namespace ::com::sun::star::beans;
|
2001-05-02 04:44:28 +00:00
|
|
|
using namespace ::com::sun::star::frame;
|
2001-11-02 06:56:17 +00:00
|
|
|
using namespace ::drafts::com::sun::star::frame;
|
2001-05-02 04:44:28 +00:00
|
|
|
using namespace ::com::sun::star::container;
|
2001-04-02 13:11:42 +00:00
|
|
|
|
2001-04-09 07:10:56 +00:00
|
|
|
|
2001-12-10 10:26:55 +00:00
|
|
|
class StringLength : public ::cppu::WeakImplHelper1< ::com::sun::star::util::XStringWidth >
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
StringLength() {}
|
|
|
|
virtual ~StringLength() {}
|
|
|
|
|
|
|
|
// XStringWidth
|
|
|
|
sal_Int32 SAL_CALL queryStringWidth( const ::rtl::OUString& aString )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
return aString.getLength();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2001-04-02 13:11:42 +00:00
|
|
|
namespace framework
|
|
|
|
{
|
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
// special menu ids/command ids for dynamic popup menus
|
2001-04-09 07:10:56 +00:00
|
|
|
#define SID_SFX_START 5000
|
|
|
|
#define SID_NEWDOCDIRECT (SID_SFX_START + 537)
|
|
|
|
#define SID_AUTOPILOTMENU (SID_SFX_START + 1381)
|
2001-05-07 05:15:35 +00:00
|
|
|
#define SID_PICKLIST (SID_SFX_START + 510)
|
|
|
|
#define SID_MDIWINDOWLIST (SID_SFX_START + 610)
|
2001-04-09 07:10:56 +00:00
|
|
|
|
2001-05-03 07:06:26 +00:00
|
|
|
#define SFX_REFERER_USER "private:user"
|
2001-05-02 04:44:28 +00:00
|
|
|
#define DESKTOP_SERVICE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))
|
|
|
|
|
|
|
|
const ::rtl::OUString aSlotString( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
|
|
|
|
const ::rtl::OUString aSlotNewDocDirect( RTL_CONSTASCII_USTRINGPARAM( "slot:5537" ));
|
|
|
|
const ::rtl::OUString aSlotAutoPilot( RTL_CONSTASCII_USTRINGPARAM( "slot:6381" ));
|
|
|
|
|
|
|
|
const ::rtl::OUString aSpecialFileMenu( RTL_CONSTASCII_USTRINGPARAM( "file" ));
|
|
|
|
const ::rtl::OUString aSpecialWindowMenu( RTL_CONSTASCII_USTRINGPARAM( "window" ));
|
2001-05-07 05:15:35 +00:00
|
|
|
const ::rtl::OUString aSlotSpecialFileMenu( RTL_CONSTASCII_USTRINGPARAM( "slot:5510" ));
|
|
|
|
const ::rtl::OUString aSlotSpecialWindowMenu( RTL_CONSTASCII_USTRINGPARAM( "slot:5610" ));
|
2001-04-09 07:10:56 +00:00
|
|
|
|
2001-05-03 07:06:26 +00:00
|
|
|
MenuManager::MenuManager( REFERENCE< XFRAME >& rFrame, Menu* pMenu, sal_Bool bDelete, sal_Bool bDeleteChildren ) :
|
2001-06-11 09:29:50 +00:00
|
|
|
ThreadHelpBase( &Application::GetSolarMutex() ), OWeakObject()
|
2001-04-02 13:11:42 +00:00
|
|
|
{
|
|
|
|
m_bActive = sal_False;
|
|
|
|
m_bDeleteMenu = bDelete;
|
|
|
|
m_bDeleteChildren = bDeleteChildren;
|
|
|
|
m_pVCLMenu = pMenu;
|
|
|
|
m_xFrame = rFrame;
|
|
|
|
m_bInitialized = sal_False;
|
2001-05-03 07:06:26 +00:00
|
|
|
m_bIsBookmarkMenu = sal_False;
|
2001-04-02 13:11:42 +00:00
|
|
|
SAL_STATIC_CAST( ::com::sun::star::uno::XInterface*, (OWeakObject*)this )->acquire();
|
|
|
|
|
2002-04-11 10:49:39 +00:00
|
|
|
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
|
|
|
|
m_bWasHiContrast = rSettings.GetMenuColor().IsDark();
|
|
|
|
m_bShowMenuImages = SvtMenuOptions().IsMenuIconsEnabled();
|
|
|
|
|
2001-05-04 16:48:14 +00:00
|
|
|
::std::vector< USHORT > aQueryLabelItemIdVector;
|
|
|
|
|
2001-04-02 13:11:42 +00:00
|
|
|
int nItemCount = pMenu->GetItemCount();
|
|
|
|
for ( int i = 0; i < nItemCount; i++ )
|
|
|
|
{
|
|
|
|
USHORT nItemId = pMenu->GetItemId( i );
|
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
::rtl::OUString aItemCommand = pMenu->GetItemCommand( nItemId );
|
|
|
|
if ( !aItemCommand.getLength() )
|
|
|
|
{
|
|
|
|
aItemCommand = aSlotString;
|
|
|
|
aItemCommand += ::rtl::OUString::valueOf( (sal_Int32)nItemId );
|
|
|
|
pMenu->SetItemCommand( nItemId, aItemCommand );
|
|
|
|
}
|
|
|
|
|
2001-04-02 13:11:42 +00:00
|
|
|
PopupMenu* pPopupMenu = pMenu->GetPopupMenu( nItemId );
|
|
|
|
if ( pPopupMenu )
|
|
|
|
{
|
2001-05-02 04:44:28 +00:00
|
|
|
MenuManager* pSubMenuManager = new MenuManager( rFrame, pPopupMenu, bDeleteChildren, bDeleteChildren );
|
|
|
|
|
2001-05-04 16:48:14 +00:00
|
|
|
// store menu item command as we later have to know which menu is active (see Activate handler)
|
2001-05-02 04:44:28 +00:00
|
|
|
pSubMenuManager->m_aMenuItemCommand = aItemCommand;
|
|
|
|
|
2001-10-10 12:08:39 +00:00
|
|
|
REFERENCE< XDISPATCH > aXDispatchRef;
|
2001-04-02 13:11:42 +00:00
|
|
|
MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
|
|
|
|
nItemId,
|
|
|
|
pSubMenuManager,
|
2001-10-10 12:08:39 +00:00
|
|
|
aXDispatchRef );
|
2001-04-02 13:11:42 +00:00
|
|
|
m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
|
2001-05-04 16:48:14 +00:00
|
|
|
if ( pMenu->GetItemText( nItemId ).Len() == 0 )
|
|
|
|
aQueryLabelItemIdVector.push_back( nItemId );
|
2001-04-02 13:11:42 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-05-02 04:44:28 +00:00
|
|
|
if ( nItemId == SID_NEWDOCDIRECT ||
|
|
|
|
aItemCommand == aSlotNewDocDirect )
|
2001-04-09 07:10:56 +00:00
|
|
|
{
|
2001-10-10 12:08:39 +00:00
|
|
|
Reference< ::com::sun::star::lang::XMultiServiceFactory > aMultiServiceFactory(::comphelper::getProcessServiceFactory());
|
|
|
|
MenuConfiguration aMenuCfg( aMultiServiceFactory );
|
2001-05-11 09:10:08 +00:00
|
|
|
BmkMenu* pSubMenu = (BmkMenu*)aMenuCfg.CreateBookmarkMenu( rFrame, BOOKMARK_NEWMENU );
|
2001-04-09 07:10:56 +00:00
|
|
|
pMenu->SetPopupMenu( nItemId, pSubMenu );
|
2001-05-03 07:06:26 +00:00
|
|
|
MenuManager* pSubMenuManager = new MenuManager( rFrame, pSubMenu, sal_True, sal_False );
|
2001-10-10 12:08:39 +00:00
|
|
|
REFERENCE< XDISPATCH > aXDispatchRef;
|
2001-04-09 07:10:56 +00:00
|
|
|
MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
|
|
|
|
nItemId,
|
|
|
|
pSubMenuManager,
|
2001-10-10 12:08:39 +00:00
|
|
|
aXDispatchRef );
|
2001-05-04 16:48:14 +00:00
|
|
|
if ( pMenu->GetItemText( nItemId ).Len() == 0 )
|
|
|
|
aQueryLabelItemIdVector.push_back( nItemId );
|
2001-06-22 05:10:19 +00:00
|
|
|
m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
|
2001-04-09 07:10:56 +00:00
|
|
|
}
|
2001-05-02 04:44:28 +00:00
|
|
|
else if ( nItemId == SID_AUTOPILOTMENU ||
|
|
|
|
aItemCommand == aSlotAutoPilot )
|
2001-04-09 07:10:56 +00:00
|
|
|
{
|
2001-10-10 12:08:39 +00:00
|
|
|
Reference< ::com::sun::star::lang::XMultiServiceFactory > aMultiServiceFactory(::comphelper::getProcessServiceFactory());
|
|
|
|
MenuConfiguration aMenuCfg( aMultiServiceFactory );
|
2001-05-11 09:10:08 +00:00
|
|
|
BmkMenu* pSubMenu = (BmkMenu*)aMenuCfg.CreateBookmarkMenu( rFrame, BOOKMARK_WIZARDMENU );
|
2001-04-09 07:10:56 +00:00
|
|
|
pMenu->SetPopupMenu( nItemId, pSubMenu );
|
2001-05-03 07:06:26 +00:00
|
|
|
MenuManager* pSubMenuManager = new MenuManager( rFrame, pSubMenu, sal_True, sal_False );
|
2001-10-10 12:08:39 +00:00
|
|
|
REFERENCE< XDISPATCH > aXDispatchRef;
|
2001-04-09 07:10:56 +00:00
|
|
|
MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
|
|
|
|
nItemId,
|
|
|
|
pSubMenuManager,
|
2001-10-10 12:08:39 +00:00
|
|
|
aXDispatchRef );
|
2001-05-04 16:48:14 +00:00
|
|
|
if ( pMenu->GetItemText( nItemId ).Len() == 0 )
|
|
|
|
aQueryLabelItemIdVector.push_back( nItemId );
|
2001-06-22 05:10:19 +00:00
|
|
|
m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
|
2001-04-09 07:10:56 +00:00
|
|
|
}
|
|
|
|
else if ( pMenu->GetItemType( i ) != MENUITEM_SEPARATOR )
|
2001-05-03 07:06:26 +00:00
|
|
|
{
|
2002-04-11 10:49:39 +00:00
|
|
|
if ( m_bShowMenuImages )
|
2001-05-14 09:48:08 +00:00
|
|
|
{
|
2002-04-11 10:49:39 +00:00
|
|
|
Image aImage = GetImageFromURL( rFrame, aItemCommand, FALSE, m_bWasHiContrast );
|
2001-05-14 09:48:08 +00:00
|
|
|
if ( !!aImage )
|
|
|
|
pMenu->SetItemImage( nItemId, aImage );
|
|
|
|
}
|
2001-05-03 07:06:26 +00:00
|
|
|
|
2001-10-10 12:08:39 +00:00
|
|
|
REFERENCE< XDISPATCH > aXDispatchRef;
|
|
|
|
m_aMenuItemHandlerVector.push_back( new MenuItemHandler( nItemId, NULL, aXDispatchRef ));
|
2001-05-04 16:48:14 +00:00
|
|
|
if ( pMenu->GetItemText( nItemId ).Len() == 0 )
|
|
|
|
aQueryLabelItemIdVector.push_back( nItemId );
|
2001-05-03 07:06:26 +00:00
|
|
|
}
|
2001-04-02 13:11:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-05-04 16:48:14 +00:00
|
|
|
|
|
|
|
// retrieve label information for all menu items without item text
|
2001-05-11 09:10:08 +00:00
|
|
|
#if 0
|
2001-05-04 16:48:14 +00:00
|
|
|
if ( aQueryLabelItemIdVector.size() > 0 )
|
|
|
|
{
|
|
|
|
Sequence< ::rtl::OUString > aURLSequence( aQueryLabelItemIdVector.size() );
|
|
|
|
Sequence< ::rtl::OUString > aLabelSequence( aQueryLabelItemIdVector.size() );
|
|
|
|
|
|
|
|
sal_uInt32 nPos = 0;
|
|
|
|
::std::vector< USHORT >::iterator p;
|
|
|
|
for ( p = aQueryLabelItemIdVector.begin(); p != aQueryLabelItemIdVector.end(); p++ )
|
|
|
|
aURLSequence[nPos++] = pMenu->GetItemCommand( *p );
|
|
|
|
|
|
|
|
Reference< XDispatchInformationProvider > xDIP( xFrame, UNO_QUERY );
|
|
|
|
if ( xDIP.is() )
|
|
|
|
{
|
|
|
|
nPos = 0;
|
|
|
|
xDIP->queryDispatchInformations( aURLSequence, aLabelSequence );
|
|
|
|
for ( p = aQueryLabelItemIdVector.begin(); p != aQueryLabelItemIdVector.end(); p++ )
|
|
|
|
pMenu->SetItemText( *p, aLabelSequence( nPos++ ));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
2001-04-02 13:11:42 +00:00
|
|
|
m_pVCLMenu->SetHighlightHdl( LINK( this, MenuManager, Highlight ));
|
|
|
|
m_pVCLMenu->SetActivateHdl( LINK( this, MenuManager, Activate ));
|
|
|
|
m_pVCLMenu->SetDeactivateHdl( LINK( this, MenuManager, Deactivate ));
|
|
|
|
m_pVCLMenu->SetSelectHdl( LINK( this, MenuManager, Select ));
|
|
|
|
}
|
|
|
|
|
2001-05-03 07:06:26 +00:00
|
|
|
|
|
|
|
MenuManager::MenuManager( REFERENCE< XFRAME >& rFrame, BmkMenu* pBmkMenu, sal_Bool bDelete, sal_Bool bDeleteChildren ) :
|
2001-06-11 09:29:50 +00:00
|
|
|
ThreadHelpBase( &Application::GetSolarMutex() ), OWeakObject()
|
2001-05-03 07:06:26 +00:00
|
|
|
{
|
|
|
|
m_bActive = sal_False;
|
|
|
|
m_bDeleteMenu = bDelete;
|
|
|
|
m_bDeleteChildren = bDeleteChildren;
|
|
|
|
m_pVCLMenu = pBmkMenu;
|
|
|
|
m_xFrame = rFrame;
|
|
|
|
m_bInitialized = sal_False;
|
|
|
|
m_bIsBookmarkMenu = sal_True;
|
2002-04-11 10:49:39 +00:00
|
|
|
|
|
|
|
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
|
|
|
|
m_bWasHiContrast = rSettings.GetMenuColor().IsDark();
|
|
|
|
|
2001-05-03 07:06:26 +00:00
|
|
|
SAL_STATIC_CAST( ::com::sun::star::uno::XInterface*, (OWeakObject*)this )->acquire();
|
|
|
|
|
|
|
|
int nItemCount = pBmkMenu->GetItemCount();
|
|
|
|
for ( int i = 0; i < nItemCount; i++ )
|
|
|
|
{
|
|
|
|
USHORT nItemId = pBmkMenu->GetItemId( i );
|
|
|
|
|
|
|
|
::rtl::OUString aItemCommand = pBmkMenu->GetItemCommand( nItemId );
|
|
|
|
if ( !aItemCommand.getLength() )
|
|
|
|
{
|
|
|
|
aItemCommand = aSlotString;
|
|
|
|
aItemCommand += ::rtl::OUString::valueOf( (sal_Int32)nItemId );
|
|
|
|
pBmkMenu->SetItemCommand( nItemId, aItemCommand );
|
|
|
|
}
|
|
|
|
|
|
|
|
PopupMenu* pPopupMenu = pBmkMenu->GetPopupMenu( nItemId );
|
|
|
|
if ( pPopupMenu )
|
|
|
|
{
|
|
|
|
MenuManager* pSubMenuManager = new MenuManager( rFrame, pPopupMenu, bDeleteChildren, bDeleteChildren );
|
|
|
|
|
|
|
|
// store menu item command as we later have to know which menu is active (see Acivate handler)
|
|
|
|
pSubMenuManager->m_aMenuItemCommand = aItemCommand;
|
|
|
|
|
2001-10-10 12:08:39 +00:00
|
|
|
REFERENCE< XDISPATCH > aXDispatchRef;
|
2001-05-03 07:06:26 +00:00
|
|
|
MenuItemHandler* pMenuItemHandler = new MenuItemHandler(
|
|
|
|
nItemId,
|
|
|
|
pSubMenuManager,
|
2001-10-10 12:08:39 +00:00
|
|
|
aXDispatchRef );
|
2001-05-03 07:06:26 +00:00
|
|
|
m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( pBmkMenu->GetItemType( i ) != MENUITEM_SEPARATOR )
|
|
|
|
{
|
2001-08-16 06:57:01 +00:00
|
|
|
MenuConfiguration::Attributes* pBmkAttributes = (MenuConfiguration::Attributes *)(pBmkMenu->GetUserValue( nItemId ));
|
2001-10-10 12:08:39 +00:00
|
|
|
REFERENCE< XDISPATCH > aXDispatchRef;
|
|
|
|
MenuItemHandler* pMenuItemHandler = new MenuItemHandler( nItemId, NULL, aXDispatchRef );
|
2001-05-03 07:06:26 +00:00
|
|
|
|
|
|
|
if ( pBmkAttributes )
|
|
|
|
{
|
2002-04-11 10:49:39 +00:00
|
|
|
// read additional attributes from attributes struct and BmkMenu implementation will delete all attributes itself!!
|
2001-05-03 07:06:26 +00:00
|
|
|
pMenuItemHandler->aTargetFrame = pBmkAttributes->aTargetFrame;
|
|
|
|
}
|
2001-05-04 05:39:52 +00:00
|
|
|
|
2001-05-03 07:06:26 +00:00
|
|
|
m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
m_pVCLMenu->SetHighlightHdl( LINK( this, MenuManager, Highlight ));
|
|
|
|
m_pVCLMenu->SetActivateHdl( LINK( this, MenuManager, Activate ));
|
|
|
|
m_pVCLMenu->SetDeactivateHdl( LINK( this, MenuManager, Deactivate ));
|
|
|
|
m_pVCLMenu->SetSelectHdl( LINK( this, MenuManager, Select ));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-04-04 04:59:20 +00:00
|
|
|
Any SAL_CALL MenuManager::queryInterface( const ::com::sun::star::uno::Type & rType ) throw ( RuntimeException )
|
2001-04-02 13:11:42 +00:00
|
|
|
{
|
|
|
|
Any a = ::cppu::queryInterface(
|
|
|
|
rType ,
|
|
|
|
SAL_STATIC_CAST( XSTATUSLISTENER*, this ),
|
|
|
|
SAL_STATIC_CAST( XEVENTLISTENER*, this ));
|
|
|
|
if ( a.hasValue() )
|
|
|
|
return a;
|
|
|
|
|
|
|
|
return OWeakObject::queryInterface( rType );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MenuManager::~MenuManager()
|
|
|
|
{
|
|
|
|
std::vector< MenuItemHandler* >::iterator p;
|
|
|
|
for ( p = m_aMenuItemHandlerVector.begin(); p != m_aMenuItemHandlerVector.end(); p++ )
|
|
|
|
{
|
|
|
|
MenuItemHandler* pItemHandler = *p;
|
|
|
|
pItemHandler->xMenuItemDispatch = REFERENCE< XDISPATCH >();
|
|
|
|
if ( pItemHandler->pSubMenuManager )
|
|
|
|
SAL_STATIC_CAST( ::com::sun::star::uno::XInterface*, (OWeakObject*)pItemHandler->pSubMenuManager )->release();
|
|
|
|
delete pItemHandler;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( m_bDeleteMenu )
|
|
|
|
delete m_pVCLMenu;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MenuManager::MenuItemHandler* MenuManager::GetMenuItemHandler( USHORT nItemId )
|
|
|
|
{
|
2001-06-11 09:29:50 +00:00
|
|
|
ResetableGuard aGuard( m_aLock );
|
2001-04-02 13:11:42 +00:00
|
|
|
|
|
|
|
std::vector< MenuItemHandler* >::iterator p;
|
|
|
|
for ( p = m_aMenuItemHandlerVector.begin(); p != m_aMenuItemHandlerVector.end(); p++ )
|
|
|
|
{
|
|
|
|
MenuItemHandler* pItemHandler = *p;
|
|
|
|
if ( pItemHandler->nItemId == nItemId )
|
|
|
|
return pItemHandler;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SAL_CALL MenuManager::statusChanged( const FEATURSTATEEVENT& Event )
|
|
|
|
throw ( RuntimeException )
|
|
|
|
{
|
|
|
|
::rtl::OUString aFeatureURL = Event.FeatureURL.Complete;
|
|
|
|
MenuItemHandler* pStatusChangedMenu = NULL;
|
|
|
|
|
|
|
|
{
|
2001-06-11 09:29:50 +00:00
|
|
|
ResetableGuard aGuard( m_aLock );
|
2001-04-02 13:11:42 +00:00
|
|
|
|
|
|
|
std::vector< MenuItemHandler* >::iterator p;
|
|
|
|
for ( p = m_aMenuItemHandlerVector.begin(); p != m_aMenuItemHandlerVector.end(); p++ )
|
|
|
|
{
|
|
|
|
MenuItemHandler* pMenuItemHandler = *p;
|
|
|
|
if ( pMenuItemHandler->aMenuItemURL == aFeatureURL )
|
|
|
|
{
|
|
|
|
pStatusChangedMenu = pMenuItemHandler;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( pStatusChangedMenu )
|
|
|
|
{
|
2001-04-09 07:10:56 +00:00
|
|
|
OGuard aGuard( Application::GetSolarMutex() );
|
2001-04-02 13:11:42 +00:00
|
|
|
{
|
2001-06-11 09:29:50 +00:00
|
|
|
ResetableGuard aGuard( m_aLock );
|
2001-05-02 04:44:28 +00:00
|
|
|
|
2001-04-09 07:10:56 +00:00
|
|
|
sal_Bool bCheckmark = sal_False;
|
|
|
|
sal_Bool bMenuItemEnabled = m_pVCLMenu->IsItemEnabled( pStatusChangedMenu->nItemId );
|
2001-04-02 13:11:42 +00:00
|
|
|
|
2001-04-09 07:10:56 +00:00
|
|
|
if ( Event.IsEnabled != bMenuItemEnabled )
|
|
|
|
m_pVCLMenu->EnableItem( pStatusChangedMenu->nItemId, Event.IsEnabled );
|
2001-04-02 13:11:42 +00:00
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
bCheckmark = ::cppu::any2bool(Event.State);
|
|
|
|
}
|
|
|
|
catch(const ::com::sun::star::lang::IllegalArgumentException&)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-08-22 07:11:48 +00:00
|
|
|
m_pVCLMenu->CheckItem( pStatusChangedMenu->nItemId, bCheckmark );
|
2001-04-02 13:11:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( Event.Requery )
|
|
|
|
{
|
|
|
|
URL aTargetURL;
|
|
|
|
aTargetURL.Complete = pStatusChangedMenu->aMenuItemURL;
|
|
|
|
|
|
|
|
REFERENCE< XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
|
|
|
|
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
|
|
|
|
xTrans->parseStrict( aTargetURL );
|
|
|
|
|
|
|
|
REFERENCE< XDISPATCHPROVIDER > xDispatchProvider( m_xFrame, UNO_QUERY );
|
|
|
|
REFERENCE< XDISPATCH > xMenuItemDispatch = xDispatchProvider->queryDispatch(
|
|
|
|
aTargetURL, ::rtl::OUString(), 0 );
|
|
|
|
|
|
|
|
if ( xMenuItemDispatch.is() )
|
|
|
|
{
|
|
|
|
pStatusChangedMenu->xMenuItemDispatch = xMenuItemDispatch;
|
|
|
|
pStatusChangedMenu->aMenuItemURL = aTargetURL.Complete;
|
|
|
|
xMenuItemDispatch->addStatusListener( SAL_STATIC_CAST( XSTATUSLISTENER*, this ), aTargetURL );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SAL_CALL MenuManager::disposing( const EVENTOBJECT& Source ) throw ( RUNTIMEEXCEPTION )
|
|
|
|
{
|
2001-05-04 05:39:52 +00:00
|
|
|
if ( Source.Source == m_xFrame )
|
2001-04-02 13:11:42 +00:00
|
|
|
{
|
2001-06-11 09:29:50 +00:00
|
|
|
ResetableGuard aGuard( m_aLock );
|
2001-04-02 13:11:42 +00:00
|
|
|
|
2001-05-04 05:39:52 +00:00
|
|
|
// disposing called from parent dispatcher
|
|
|
|
// remove all listener to prepare shutdown
|
|
|
|
REFERENCE< XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
|
|
|
|
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
|
|
|
|
|
2001-04-02 13:11:42 +00:00
|
|
|
std::vector< MenuItemHandler* >::iterator p;
|
|
|
|
for ( p = m_aMenuItemHandlerVector.begin(); p != m_aMenuItemHandlerVector.end(); p++ )
|
|
|
|
{
|
2001-05-04 05:39:52 +00:00
|
|
|
MenuItemHandler* pItemHandler = *p;
|
|
|
|
if ( pItemHandler->xMenuItemDispatch.is() )
|
2001-04-02 13:11:42 +00:00
|
|
|
{
|
2001-05-04 05:39:52 +00:00
|
|
|
URL aTargetURL;
|
|
|
|
aTargetURL.Complete = pItemHandler->aMenuItemURL;
|
|
|
|
xTrans->parseStrict( aTargetURL );
|
|
|
|
|
|
|
|
pItemHandler->xMenuItemDispatch->removeStatusListener(
|
|
|
|
SAL_STATIC_CAST( XSTATUSLISTENER*, this ), aTargetURL );
|
2001-04-02 13:11:42 +00:00
|
|
|
}
|
2001-05-04 05:39:52 +00:00
|
|
|
|
|
|
|
pItemHandler->xMenuItemDispatch = REFERENCE< XDISPATCH >();
|
|
|
|
if ( pItemHandler->pSubMenuManager )
|
|
|
|
pItemHandler->pSubMenuManager->disposing( Source );
|
2001-04-02 13:11:42 +00:00
|
|
|
}
|
|
|
|
}
|
2001-05-04 05:39:52 +00:00
|
|
|
else
|
2001-04-02 13:11:42 +00:00
|
|
|
{
|
2001-05-04 05:39:52 +00:00
|
|
|
// disposing called from menu item dispatcher, remove listener
|
|
|
|
MenuItemHandler* pMenuItemDisposing = NULL;
|
2001-04-02 13:11:42 +00:00
|
|
|
|
2001-05-04 05:39:52 +00:00
|
|
|
{
|
2001-06-11 09:29:50 +00:00
|
|
|
ResetableGuard aGuard( m_aLock );
|
2001-05-04 05:39:52 +00:00
|
|
|
|
|
|
|
std::vector< MenuItemHandler* >::iterator p;
|
|
|
|
for ( p = m_aMenuItemHandlerVector.begin(); p != m_aMenuItemHandlerVector.end(); p++ )
|
|
|
|
{
|
|
|
|
MenuItemHandler* pMenuItemHandler = *p;
|
|
|
|
if ( pMenuItemHandler->xMenuItemDispatch == Source.Source )
|
|
|
|
{
|
|
|
|
pMenuItemDisposing = pMenuItemHandler;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2001-04-02 13:11:42 +00:00
|
|
|
|
2001-05-04 05:39:52 +00:00
|
|
|
if ( pMenuItemDisposing )
|
|
|
|
{
|
|
|
|
URL aTargetURL;
|
|
|
|
aTargetURL.Complete = pMenuItemDisposing->aMenuItemURL;
|
|
|
|
|
|
|
|
REFERENCE< XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
|
|
|
|
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
|
|
|
|
xTrans->parseStrict( aTargetURL );
|
|
|
|
|
|
|
|
pMenuItemDisposing->xMenuItemDispatch->removeStatusListener(
|
|
|
|
SAL_STATIC_CAST( XSTATUSLISTENER*, this ), aTargetURL );
|
|
|
|
pMenuItemDisposing->xMenuItemDispatch = REFERENCE< XDISPATCH >();
|
|
|
|
}
|
|
|
|
}
|
2001-04-02 13:11:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
void MenuManager::UpdateSpecialFileMenu( Menu* pMenu )
|
|
|
|
{
|
|
|
|
// update picklist
|
|
|
|
Sequence< Sequence< PropertyValue > > aHistoryList = SvtHistoryOptions().GetList( ePICKLIST );
|
|
|
|
::std::vector< MenuItemHandler* > aNewPickVector;
|
2001-12-10 10:26:55 +00:00
|
|
|
Reference< XStringWidth > xStringLength( new StringLength );
|
2001-05-02 04:44:28 +00:00
|
|
|
|
|
|
|
USHORT nPickItemId = START_ITEMID_PICKLIST;
|
2001-12-10 10:26:55 +00:00
|
|
|
int nPickListMenuItems = ( aHistoryList.getLength() > 99 ) ? 99 : aHistoryList.getLength();
|
2001-05-02 04:44:28 +00:00
|
|
|
|
|
|
|
for ( int i = 0; i < nPickListMenuItems; i++ )
|
|
|
|
{
|
|
|
|
Sequence< PropertyValue > aPickListEntry = aHistoryList[i];
|
|
|
|
|
2001-10-10 12:08:39 +00:00
|
|
|
REFERENCE< XDISPATCH > aXDispatchRef;
|
2001-05-02 04:44:28 +00:00
|
|
|
MenuItemHandler* pNewMenuItemHandler = new MenuItemHandler(
|
|
|
|
nPickItemId++,
|
|
|
|
NULL,
|
2001-10-10 12:08:39 +00:00
|
|
|
aXDispatchRef );
|
2001-05-02 04:44:28 +00:00
|
|
|
|
|
|
|
for ( int j = 0; j < aPickListEntry.getLength(); j++ )
|
|
|
|
{
|
|
|
|
Any a = aPickListEntry[j].Value;
|
|
|
|
|
|
|
|
if ( aPickListEntry[j].Name == HISTORY_PROPERTYNAME_URL )
|
|
|
|
a >>= pNewMenuItemHandler->aMenuItemURL;
|
|
|
|
else if ( aPickListEntry[j].Name == HISTORY_PROPERTYNAME_FILTER )
|
|
|
|
a >>= pNewMenuItemHandler->aFilter;
|
|
|
|
else if ( aPickListEntry[j].Name == HISTORY_PROPERTYNAME_TITLE )
|
2001-12-10 10:26:55 +00:00
|
|
|
a >>= pNewMenuItemHandler->aTitle;
|
2001-05-02 04:44:28 +00:00
|
|
|
else if ( aPickListEntry[j].Name == HISTORY_PROPERTYNAME_PASSWORD )
|
|
|
|
a >>= pNewMenuItemHandler->aPassword;
|
|
|
|
}
|
|
|
|
|
|
|
|
aNewPickVector.push_back( pNewMenuItemHandler );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( aNewPickVector.size() > 0 )
|
|
|
|
{
|
|
|
|
URL aTargetURL;
|
|
|
|
REFERENCE< XDISPATCHPROVIDER > xDispatchProvider( m_xFrame, UNO_QUERY );
|
|
|
|
REFERENCE< XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
|
|
|
|
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
|
|
|
|
REFERENCE< XDISPATCH > xMenuItemDispatch;
|
|
|
|
|
|
|
|
// query for dispatcher
|
|
|
|
std::vector< MenuItemHandler* >::iterator p;
|
|
|
|
for ( p = aNewPickVector.begin(); p != aNewPickVector.end(); p++ )
|
|
|
|
{
|
|
|
|
MenuItemHandler* pMenuItemHandler = *p;
|
|
|
|
|
|
|
|
aTargetURL.Complete = pMenuItemHandler->aMenuItemURL;
|
|
|
|
xTrans->parseStrict( aTargetURL );
|
|
|
|
|
|
|
|
if ( !xMenuItemDispatch.is() )
|
|
|
|
{
|
|
|
|
// attention: this code assume that "_blank" can only be consumed by desktop service
|
2001-11-28 10:08:13 +00:00
|
|
|
xMenuItemDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString::createFromAscii("_default"), 0 );
|
2001-05-02 04:44:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( xMenuItemDispatch.is() )
|
|
|
|
{
|
|
|
|
pMenuItemHandler->xMenuItemDispatch = xMenuItemDispatch;
|
|
|
|
pMenuItemHandler->aMenuItemURL = aTargetURL.Complete;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2001-06-11 09:29:50 +00:00
|
|
|
ResetableGuard aGuard( m_aLock );
|
2001-05-02 04:44:28 +00:00
|
|
|
|
|
|
|
int nRemoveItemCount = 0;
|
|
|
|
int nItemCount = pMenu->GetItemCount();
|
|
|
|
|
|
|
|
if ( nItemCount > 0 )
|
|
|
|
{
|
|
|
|
// remove all old picklist entries from menu
|
|
|
|
sal_uInt16 nPos = pMenu->GetItemPos( START_ITEMID_PICKLIST );
|
|
|
|
for ( sal_uInt16 n = nPos; n < pMenu->GetItemCount(); )
|
|
|
|
{
|
|
|
|
pMenu->RemoveItem( n );
|
|
|
|
++nRemoveItemCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( pMenu->GetItemType( pMenu->GetItemCount()-1 ) == MENUITEM_SEPARATOR )
|
|
|
|
pMenu->RemoveItem( pMenu->GetItemCount()-1 );
|
|
|
|
|
|
|
|
// remove all old picklist entries from menu handler
|
|
|
|
if ( nRemoveItemCount > 0 )
|
|
|
|
{
|
|
|
|
for( sal_uInt32 nIndex = m_aMenuItemHandlerVector.size() - nRemoveItemCount;
|
|
|
|
nIndex < m_aMenuItemHandlerVector.size(); )
|
|
|
|
{
|
|
|
|
delete m_aMenuItemHandlerVector.at( nIndex );
|
|
|
|
m_aMenuItemHandlerVector.erase( m_aMenuItemHandlerVector.begin() + nIndex );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// append new picklist menu entries
|
|
|
|
pMenu->InsertSeparator();
|
|
|
|
for ( sal_uInt32 i = 0; i < aNewPickVector.size(); i++ )
|
|
|
|
{
|
2001-12-10 10:26:55 +00:00
|
|
|
char menuShortCut[5] = "~n: ";
|
|
|
|
|
|
|
|
::rtl::OUString aMenuShortCut;
|
|
|
|
if ( i <= 9 )
|
|
|
|
{
|
|
|
|
if ( i == 9 )
|
|
|
|
aMenuShortCut = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "1~0: " ));
|
|
|
|
else
|
|
|
|
{
|
|
|
|
menuShortCut[1] = (char)( '1' + i );
|
|
|
|
aMenuShortCut = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( menuShortCut ));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aMenuShortCut = rtl::OUString::valueOf((sal_Int32)( i + 1 ));
|
|
|
|
aMenuShortCut += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ": " ));
|
|
|
|
}
|
|
|
|
|
|
|
|
// Abbreviate URL
|
|
|
|
rtl::OUString aURLString( aNewPickVector.at( i )->aMenuItemURL );
|
|
|
|
rtl::OUString aTipHelpText;
|
|
|
|
rtl::OUString aMenuTitle;
|
|
|
|
INetURLObject aURL( aURLString );
|
|
|
|
|
|
|
|
if ( aURL.GetProtocol() == INET_PROT_FILE )
|
|
|
|
{
|
|
|
|
// Do handle file URL differently => convert it to a system
|
|
|
|
// path and abbreviate it with a special function:
|
2002-04-09 11:58:04 +00:00
|
|
|
String aFileSystemPath( aURL.getFSysPath( INetURLObject::FSYS_DETECT ) );
|
2001-12-10 10:26:55 +00:00
|
|
|
|
2002-04-09 11:58:04 +00:00
|
|
|
::rtl::OUString aSystemPath( aFileSystemPath );
|
2001-12-10 10:26:55 +00:00
|
|
|
::rtl::OUString aCompactedSystemPath;
|
|
|
|
|
|
|
|
aTipHelpText = aSystemPath;
|
|
|
|
oslFileError nError = osl_abbreviateSystemPath( aSystemPath.pData, &aCompactedSystemPath.pData, 46, NULL );
|
|
|
|
if ( !nError )
|
|
|
|
aMenuTitle = String( aCompactedSystemPath );
|
|
|
|
else
|
2002-04-09 11:58:04 +00:00
|
|
|
aMenuTitle = aSystemPath;
|
2001-12-10 10:26:55 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Use INetURLObject to abbreviate all other URLs
|
|
|
|
String aShortURL;
|
|
|
|
aShortURL = aURL.getAbbreviated( xStringLength, 46, INetURLObject::DECODE_UNAMBIGUOUS );
|
|
|
|
aMenuTitle += aShortURL;
|
|
|
|
aTipHelpText = aURLString;
|
|
|
|
}
|
|
|
|
|
|
|
|
::rtl::OUString aTitle( aMenuShortCut + aMenuTitle );
|
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
MenuItemHandler* pMenuItemHandler = aNewPickVector.at( i );
|
2001-12-10 10:26:55 +00:00
|
|
|
pMenu->InsertItem( pMenuItemHandler->nItemId, aTitle );
|
|
|
|
pMenu->SetTipHelpText( pMenuItemHandler->nItemId, aTipHelpText );
|
2001-05-02 04:44:28 +00:00
|
|
|
m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MenuManager::UpdateSpecialWindowMenu( Menu* pMenu )
|
|
|
|
{
|
|
|
|
// update window list
|
|
|
|
::std::vector< ::rtl::OUString > aNewWindowListVector;
|
|
|
|
Reference< XDesktop > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance(
|
|
|
|
DESKTOP_SERVICE ), UNO_QUERY );
|
|
|
|
|
|
|
|
USHORT nActiveItemId = 0;
|
|
|
|
USHORT nItemId = START_ITEMID_WINDOWLIST;
|
|
|
|
|
|
|
|
if ( xDesktop.is() )
|
|
|
|
{
|
|
|
|
Reference< XTasksSupplier > xTasksSupplier( xDesktop, UNO_QUERY );
|
|
|
|
Reference< XFrame > xCurrentFrame = xDesktop->getCurrentFrame();
|
|
|
|
Reference< XEnumeration > xList = xTasksSupplier->getTasks()->createEnumeration();
|
|
|
|
while (( xList->hasMoreElements() == sal_True ))
|
|
|
|
{
|
|
|
|
Reference< XTask > xTask;
|
|
|
|
xList->nextElement() >>= xTask;
|
|
|
|
if ( xTask.is() )
|
|
|
|
{
|
|
|
|
Reference< XFrame > xFrame( xTask, UNO_QUERY );
|
|
|
|
if ( xFrame == xCurrentFrame )
|
|
|
|
nActiveItemId = nItemId;
|
|
|
|
|
|
|
|
Window* pWin = VCLUnoHelper::GetWindow( xTask->getContainerWindow() );
|
2001-09-19 07:07:46 +00:00
|
|
|
if ( pWin && pWin->IsVisible() )
|
|
|
|
{
|
|
|
|
aNewWindowListVector.push_back( pWin->GetText() );
|
|
|
|
++nItemId;
|
|
|
|
}
|
2001-05-02 04:44:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2001-06-11 09:29:50 +00:00
|
|
|
ResetableGuard aGuard( m_aLock );
|
2001-05-02 04:44:28 +00:00
|
|
|
|
|
|
|
int nRemoveItemCount = 0;
|
|
|
|
int nItemCount = pMenu->GetItemCount();
|
|
|
|
|
|
|
|
if ( nItemCount > 0 )
|
|
|
|
{
|
|
|
|
// remove all old window list entries from menu
|
|
|
|
sal_uInt16 nPos = pMenu->GetItemPos( START_ITEMID_WINDOWLIST );
|
|
|
|
for ( sal_uInt16 n = nPos; n < pMenu->GetItemCount(); )
|
|
|
|
pMenu->RemoveItem( n );
|
|
|
|
|
|
|
|
if ( pMenu->GetItemType( pMenu->GetItemCount()-1 ) == MENUITEM_SEPARATOR )
|
|
|
|
pMenu->RemoveItem( pMenu->GetItemCount()-1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( aNewWindowListVector.size() > 0 )
|
|
|
|
{
|
|
|
|
// append new window list entries to menu
|
|
|
|
pMenu->InsertSeparator();
|
|
|
|
nItemId = START_ITEMID_WINDOWLIST;
|
|
|
|
for ( sal_uInt32 i = 0; i < aNewWindowListVector.size(); i++ )
|
|
|
|
{
|
|
|
|
pMenu->InsertItem( nItemId, aNewWindowListVector.at( i ), MIB_RADIOCHECK );
|
|
|
|
if ( nItemId == nActiveItemId )
|
|
|
|
pMenu->CheckItem( nItemId );
|
|
|
|
++nItemId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-05-03 07:06:26 +00:00
|
|
|
|
|
|
|
void MenuManager::CreatePicklistArguments( Sequence< PropertyValue >& aArgsList, const MenuItemHandler* pMenuItemHandler )
|
|
|
|
{
|
|
|
|
const int NUM_OF_PICKLIST_ARGS = 4;
|
|
|
|
|
|
|
|
Any a;
|
|
|
|
aArgsList.realloc( NUM_OF_PICKLIST_ARGS );
|
|
|
|
|
|
|
|
aArgsList[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FileName" ));
|
|
|
|
a <<= pMenuItemHandler->aMenuItemURL;
|
|
|
|
aArgsList[0].Value = a;
|
|
|
|
|
|
|
|
aArgsList[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Referer" ));
|
|
|
|
a <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SFX_REFERER_USER ));
|
|
|
|
aArgsList[1].Value = a;
|
|
|
|
|
|
|
|
::rtl::OUString aFilter( pMenuItemHandler->aFilter );
|
|
|
|
::rtl::OUString aFilterOptions;
|
|
|
|
|
|
|
|
sal_Int32 nPos = aFilter.indexOf( '|' );
|
|
|
|
if( nPos >= 0 )
|
|
|
|
{
|
|
|
|
if ( nPos < ( aFilter.getLength() - 1 ))
|
|
|
|
aFilterOptions = aFilter.copy( nPos+1 );
|
|
|
|
aFilter = aFilter.copy( 0, nPos-1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
aArgsList[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterOptions" ));
|
|
|
|
a <<= aFilterOptions;
|
|
|
|
aArgsList[2].Value = a;
|
|
|
|
|
|
|
|
aArgsList[3].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ));
|
|
|
|
a <<= aFilter;
|
|
|
|
aArgsList[3].Value = a;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
// vcl handler
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
|
2001-04-02 13:11:42 +00:00
|
|
|
IMPL_LINK( MenuManager, Activate, Menu *, pMenu )
|
|
|
|
{
|
|
|
|
if ( pMenu == m_pVCLMenu )
|
|
|
|
{
|
|
|
|
// set/unset hiding disabled menu entries
|
2002-04-11 10:49:39 +00:00
|
|
|
sal_Bool bDontHide = SvtMenuOptions().IsEntryHidingEnabled();
|
|
|
|
sal_Bool bShowMenuImages = SvtMenuOptions().IsMenuIconsEnabled();
|
2001-04-02 13:11:42 +00:00
|
|
|
|
|
|
|
sal_uInt16 nFlag = pMenu->GetMenuFlags();
|
|
|
|
if ( bDontHide )
|
|
|
|
nFlag &= ~MENU_FLAG_HIDEDISABLEDENTRIES;
|
|
|
|
else
|
|
|
|
nFlag |= MENU_FLAG_HIDEDISABLEDENTRIES;
|
|
|
|
pMenu->SetMenuFlags( nFlag );
|
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
if ( m_bActive )
|
2001-04-02 13:11:42 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
m_bActive = TRUE;
|
|
|
|
|
2001-05-07 05:15:35 +00:00
|
|
|
if ( m_aMenuItemCommand == aSpecialFileMenu ||
|
|
|
|
m_aMenuItemCommand == aSlotSpecialFileMenu )
|
2001-05-02 04:44:28 +00:00
|
|
|
UpdateSpecialFileMenu( pMenu );
|
2001-05-07 05:15:35 +00:00
|
|
|
else if ( m_aMenuItemCommand == aSpecialWindowMenu ||
|
|
|
|
m_aMenuItemCommand == aSlotSpecialWindowMenu )
|
2001-05-02 04:44:28 +00:00
|
|
|
UpdateSpecialWindowMenu( pMenu );
|
2001-04-02 13:11:42 +00:00
|
|
|
|
2002-04-11 10:49:39 +00:00
|
|
|
// Check if some modes have changed so we have to update our menu images
|
|
|
|
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
|
|
|
|
sal_Bool bIsHiContrast = rSettings.GetMenuColor().IsDark();
|
|
|
|
|
|
|
|
if ( m_bWasHiContrast != bIsHiContrast || bShowMenuImages != m_bShowMenuImages )
|
|
|
|
{
|
|
|
|
// The mode changed so we have to replace all images
|
|
|
|
m_bWasHiContrast = bIsHiContrast;
|
|
|
|
m_bShowMenuImages = bShowMenuImages;
|
|
|
|
|
|
|
|
for ( USHORT nPos = 0; nPos < pMenu->GetItemCount(); nPos++ )
|
|
|
|
{
|
|
|
|
USHORT nId = pMenu->GetItemId( nPos );
|
|
|
|
if ( pMenu->GetItemType( nPos ) != MENUITEM_SEPARATOR )
|
|
|
|
{
|
|
|
|
if ( bShowMenuImages )
|
|
|
|
{
|
|
|
|
sal_Bool bImageSet = sal_False;
|
|
|
|
::rtl::OUString aImageId;
|
|
|
|
|
|
|
|
::framework::MenuConfiguration::Attributes* pMenuAttributes =
|
|
|
|
(::framework::MenuConfiguration::Attributes*)pMenu->GetUserValue( nId );
|
|
|
|
|
|
|
|
if ( pMenuAttributes )
|
|
|
|
aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes
|
|
|
|
|
|
|
|
if ( aImageId.getLength() > 0 )
|
|
|
|
{
|
|
|
|
Image aImage = GetImageFromURL( m_xFrame, aImageId, FALSE, bIsHiContrast );
|
|
|
|
if ( !!aImage )
|
|
|
|
{
|
|
|
|
bImageSet = sal_True;
|
|
|
|
pMenu->SetItemImage( nId, aImage );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !bImageSet )
|
|
|
|
pMenu->SetItemImage( nId, GetImageFromURL( m_xFrame, pMenu->GetItemCommand( nId ), FALSE, bIsHiContrast ) );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pMenu->SetItemImage( nId, Image() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
if ( m_bInitialized )
|
|
|
|
return 0;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
URL aTargetURL;
|
|
|
|
REFERENCE< XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
|
|
|
|
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
|
2001-04-02 13:11:42 +00:00
|
|
|
|
2001-06-11 09:29:50 +00:00
|
|
|
ResetableGuard aGuard( m_aLock );
|
2001-04-02 13:11:42 +00:00
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
REFERENCE< XDISPATCHPROVIDER > xDispatchProvider( m_xFrame, UNO_QUERY );
|
|
|
|
if ( xDispatchProvider.is() )
|
|
|
|
{
|
|
|
|
std::vector< MenuItemHandler* >::iterator p;
|
|
|
|
for ( p = m_aMenuItemHandlerVector.begin(); p != m_aMenuItemHandlerVector.end(); p++ )
|
|
|
|
{
|
|
|
|
MenuItemHandler* pMenuItemHandler = *p;
|
|
|
|
if ( pMenuItemHandler &&
|
|
|
|
pMenuItemHandler->pSubMenuManager == 0 &&
|
|
|
|
!pMenuItemHandler->xMenuItemDispatch.is() )
|
2001-04-02 13:11:42 +00:00
|
|
|
{
|
2001-05-02 04:44:28 +00:00
|
|
|
// There is no dispatch mechanism for the special window list menu items,
|
|
|
|
// because they are handled directly through XFrame->activate!!!
|
|
|
|
if ( pMenuItemHandler->nItemId < START_ITEMID_WINDOWLIST ||
|
|
|
|
pMenuItemHandler->nItemId > END_ITEMID_WINDOWLIST )
|
|
|
|
{
|
|
|
|
::rtl::OUString aItemCommand = pMenu->GetItemCommand( pMenuItemHandler->nItemId );
|
|
|
|
if ( !aItemCommand.getLength() )
|
|
|
|
{
|
|
|
|
aItemCommand = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
|
|
|
|
aItemCommand += ::rtl::OUString::valueOf( (sal_Int32)pMenuItemHandler->nItemId );
|
|
|
|
pMenu->SetItemCommand( pMenuItemHandler->nItemId, aItemCommand );
|
|
|
|
}
|
|
|
|
|
|
|
|
aTargetURL.Complete = aItemCommand;
|
|
|
|
|
|
|
|
xTrans->parseStrict( aTargetURL );
|
|
|
|
|
|
|
|
REFERENCE< XDISPATCH > xMenuItemDispatch;
|
|
|
|
if ( m_bIsBookmarkMenu )
|
2001-05-03 07:06:26 +00:00
|
|
|
xMenuItemDispatch = xDispatchProvider->queryDispatch( aTargetURL, pMenuItemHandler->aTargetFrame, 0 );
|
2001-05-02 04:44:28 +00:00
|
|
|
else
|
|
|
|
xMenuItemDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
|
|
|
|
|
|
|
|
if ( xMenuItemDispatch.is() )
|
|
|
|
{
|
|
|
|
pMenuItemHandler->xMenuItemDispatch = xMenuItemDispatch;
|
|
|
|
pMenuItemHandler->aMenuItemURL = aTargetURL.Complete;
|
|
|
|
xMenuItemDispatch->addStatusListener( SAL_STATIC_CAST( XSTATUSLISTENER*, this ), aTargetURL );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pMenu->EnableItem( pMenuItemHandler->nItemId, sal_False );
|
|
|
|
}
|
2001-04-02 13:11:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
return 1;
|
2001-04-02 13:11:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( MenuManager, Deactivate, Menu *, pMenu )
|
|
|
|
{
|
|
|
|
if ( pMenu == m_pVCLMenu )
|
|
|
|
m_bActive = sal_False;
|
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
return 1;
|
2001-04-02 13:11:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( MenuManager, Select, Menu *, pMenu )
|
|
|
|
{
|
2001-05-07 04:50:34 +00:00
|
|
|
URL aTargetURL;
|
|
|
|
Sequence<PropertyValue> aArgs;
|
|
|
|
REFERENCE< XDISPATCH > xDispatch;
|
|
|
|
|
2001-04-02 13:11:42 +00:00
|
|
|
{
|
2001-06-11 09:29:50 +00:00
|
|
|
ResetableGuard aGuard( m_aLock );
|
2001-05-07 04:50:34 +00:00
|
|
|
|
2001-04-02 13:11:42 +00:00
|
|
|
USHORT nCurItemId = pMenu->GetCurItemId();
|
2001-05-07 04:50:34 +00:00
|
|
|
if ( pMenu == m_pVCLMenu &&
|
|
|
|
pMenu->GetItemType( nCurItemId ) != MENUITEM_SEPARATOR )
|
2001-04-02 13:11:42 +00:00
|
|
|
{
|
2001-05-03 12:21:25 +00:00
|
|
|
if ( nCurItemId >= START_ITEMID_WINDOWLIST &&
|
|
|
|
nCurItemId <= END_ITEMID_WINDOWLIST )
|
2001-04-02 13:11:42 +00:00
|
|
|
{
|
2001-05-03 12:21:25 +00:00
|
|
|
// window list menu item selected
|
2001-05-02 04:44:28 +00:00
|
|
|
Reference< XTasksSupplier > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance(
|
|
|
|
DESKTOP_SERVICE ), UNO_QUERY );
|
|
|
|
USHORT nWindowItemId = START_ITEMID_WINDOWLIST;
|
2001-05-11 09:10:08 +00:00
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
if ( xDesktop.is() )
|
|
|
|
{
|
|
|
|
USHORT nTaskId = START_ITEMID_WINDOWLIST;
|
|
|
|
Reference< XEnumeration > xList = xDesktop->getTasks()->createEnumeration();
|
|
|
|
while (( xList->hasMoreElements() == sal_True ))
|
|
|
|
{
|
|
|
|
Reference< XTask > xTask;
|
|
|
|
xList->nextElement() >>= xTask;
|
|
|
|
|
|
|
|
if ( xTask.is() && nTaskId == nCurItemId )
|
|
|
|
{
|
|
|
|
Window* pWin = VCLUnoHelper::GetWindow( xTask->getContainerWindow() );
|
|
|
|
pWin->GrabFocus();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
nTaskId++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
MenuItemHandler* pMenuItemHandler = GetMenuItemHandler( nCurItemId );
|
|
|
|
if ( pMenuItemHandler && pMenuItemHandler->xMenuItemDispatch.is() )
|
|
|
|
{
|
|
|
|
REFERENCE< XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
|
2001-05-07 04:50:34 +00:00
|
|
|
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), UNO_QUERY );
|
2001-05-02 04:44:28 +00:00
|
|
|
aTargetURL.Complete = pMenuItemHandler->aMenuItemURL;
|
|
|
|
xTrans->parseStrict( aTargetURL );
|
2001-05-11 09:10:08 +00:00
|
|
|
|
2001-05-03 12:21:25 +00:00
|
|
|
if ( nCurItemId >= START_ITEMID_PICKLIST &&
|
|
|
|
nCurItemId < START_ITEMID_WINDOWLIST )
|
2001-05-02 04:44:28 +00:00
|
|
|
{
|
2001-05-03 12:21:25 +00:00
|
|
|
// picklist menu item selected
|
2001-05-03 07:06:26 +00:00
|
|
|
CreatePicklistArguments( aArgs, pMenuItemHandler );
|
2001-05-02 04:44:28 +00:00
|
|
|
}
|
2001-05-07 04:50:34 +00:00
|
|
|
else if ( m_bIsBookmarkMenu )
|
2001-05-02 04:44:28 +00:00
|
|
|
{
|
2001-05-07 04:50:34 +00:00
|
|
|
// bookmark menu item selected
|
|
|
|
Any a;
|
|
|
|
aArgs.realloc( 1 );
|
|
|
|
aArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Referer" ));
|
|
|
|
a <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SFX_REFERER_USER ));
|
|
|
|
aArgs[0].Value = a;
|
2001-05-02 04:44:28 +00:00
|
|
|
}
|
2001-05-07 04:50:34 +00:00
|
|
|
|
|
|
|
xDispatch = pMenuItemHandler->xMenuItemDispatch;
|
2001-05-02 04:44:28 +00:00
|
|
|
}
|
2001-04-02 13:11:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-05-07 04:50:34 +00:00
|
|
|
if ( xDispatch.is() )
|
|
|
|
xDispatch->dispatch( aTargetURL, aArgs );
|
2001-05-11 09:10:08 +00:00
|
|
|
|
2001-05-02 04:44:28 +00:00
|
|
|
return 1;
|
2001-04-02 13:11:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( MenuManager, Highlight, Menu *, pMenu )
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-04-09 07:10:56 +00:00
|
|
|
}
|