Revert "fdo#46808, Adapt frame::PopupMenuControllerFactory UNO service"
This reverts commit e93a001887
.
Conflicts:
desktop/source/app/app.cxx
framework/source/uielement/menubarmanager.cxx
framework/source/uielement/popupmenucontroller.cxx
offapi/UnoApi_offapi.mk
Change-Id: I3d4d49f98603e75357fb315a603a10851b3a7090
This commit is contained in:
@@ -41,7 +41,6 @@
|
||||
#include <com/sun/star/frame/SessionListener.hpp>
|
||||
#include <com/sun/star/frame/XSessionManagerListener.hpp>
|
||||
#include <com/sun/star/frame/XSynchronousDispatch.hpp>
|
||||
#include <com/sun/star/frame/PopupMenuControllerFactory.hpp>
|
||||
#include <com/sun/star/document/CorruptedFilterConfigurationException.hpp>
|
||||
#include <com/sun/star/configuration/CorruptedConfigurationException.hpp>
|
||||
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||
@@ -2215,17 +2214,22 @@ void Desktop::PreloadConfigurationData()
|
||||
|
||||
// preload popup menu controller factories. As all controllers are in the same
|
||||
// configuration file they also get preloaded!
|
||||
Reference< css::frame::XToolbarControllerFactory > xPopupMenuControllerFactory =
|
||||
css::frame::PopupMenuControllerFactory::create( xContext );
|
||||
Reference< ::com::sun::star::frame::XUIControllerRegistration > xPopupMenuControllerFactory(
|
||||
rFactory->createInstance(
|
||||
rtl::OUString( "com.sun.star.frame.PopupMenuControllerFactory" )),
|
||||
UNO_QUERY );
|
||||
if ( xPopupMenuControllerFactory.is() )
|
||||
{
|
||||
try
|
||||
{
|
||||
xPopupMenuControllerFactory->hasController(
|
||||
OUString( ".uno:CharFontName" ),
|
||||
rtl::OUString( ".uno:CharFontName" ),
|
||||
OUString() );
|
||||
}
|
||||
catch ( const ::com::sun::star::uno::Exception& )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// preload filter configuration
|
||||
Sequence< OUString > aSeq;
|
||||
@@ -2269,6 +2273,8 @@ void Desktop::OpenClients()
|
||||
|
||||
const CommandLineArgs& rArgs = GetCommandLineArgs();
|
||||
|
||||
Reference<XMultiServiceFactory> rFactory = ::comphelper::getProcessServiceFactory();
|
||||
|
||||
if (!rArgs.IsQuickstart())
|
||||
{
|
||||
sal_Bool bShowHelp = sal_False;
|
||||
|
@@ -38,6 +38,7 @@ namespace framework{
|
||||
#define SERVICENAME_JOB DECLARE_ASCII("com.sun.star.task.Job" )
|
||||
#define SERVICENAME_PROTOCOLHANDLER DECLARE_ASCII("com.sun.star.frame.ProtocolHandler" )
|
||||
#define SERVICENAME_LAYOUTMANAGER DECLARE_ASCII("com.sun.star.frame.LayoutManager" )
|
||||
#define SERVICENAME_POPUPMENUCONTROLLERFACTORY DECLARE_ASCII("com.sun.star.frame.PopupMenuControllerFactory" )
|
||||
#define SERVICENAME_POPUPMENUCONTROLLER DECLARE_ASCII("com.sun.star.frame.PopupMenuController" )
|
||||
#define SERVICENAME_MODULEUICONFIGURATIONMANAGER DECLARE_ASCII("com.sun.star.ui.ModuleUIConfigurationManager" )
|
||||
#define SERVICENAME_MENUBARFACTORY DECLARE_ASCII("com.sun.star.ui.UIElementFactory" )
|
||||
|
@@ -34,7 +34,6 @@
|
||||
#include <com/sun/star/frame/XDispatchProvider.hpp>
|
||||
#include <com/sun/star/frame/FeatureStateEvent.hpp>
|
||||
#include <com/sun/star/frame/XFrameActionListener.hpp>
|
||||
#include <com/sun/star/frame/XToolbarControllerFactory.hpp>
|
||||
#include <com/sun/star/beans/PropertyValue.hpp>
|
||||
#include <com/sun/star/frame/XPopupMenuController.hpp>
|
||||
#include <com/sun/star/awt/XSystemDependentMenuPeer.hpp>
|
||||
@@ -236,7 +235,7 @@ class MenuBarManager : public com::sun::star::frame::XStatusListener
|
||||
Menu* m_pVCLMenu;
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xUICommandLabels;
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::frame::XToolbarControllerFactory > m_xPopupMenuControllerRegistration;
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::frame::XUIControllerRegistration > m_xPopupMenuControllerRegistration;
|
||||
::std::vector< MenuItemHandler* > m_aMenuItemHandlerVector;
|
||||
::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xDispatchProvider;
|
||||
|
@@ -29,9 +29,10 @@
|
||||
|
||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||
#include <com/sun/star/lang/XTypeProvider.hpp>
|
||||
#include <com/sun/star/frame/XToolbarControllerFactory.hpp>
|
||||
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
|
||||
#include <com/sun/star/frame/XUIControllerRegistration.hpp>
|
||||
|
||||
#include <cppuhelper/implbase2.hxx>
|
||||
#include <cppuhelper/implbase3.hxx>
|
||||
#include <rtl/ustring.hxx>
|
||||
|
||||
namespace framework
|
||||
@@ -39,8 +40,9 @@ namespace framework
|
||||
|
||||
class ConfigurationAccess_ControllerFactory;
|
||||
class ToolbarControllerFactory : protected ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
|
||||
public ::cppu::WeakImplHelper2< com::sun::star::lang::XServiceInfo,
|
||||
com::sun::star::frame::XToolbarControllerFactory>
|
||||
public ::cppu::WeakImplHelper3< com::sun::star::lang::XServiceInfo,
|
||||
com::sun::star::lang::XMultiComponentFactory,
|
||||
com::sun::star::frame::XUIControllerRegistration>
|
||||
{
|
||||
public:
|
||||
ToolbarControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
|
||||
|
@@ -36,7 +36,6 @@
|
||||
#include <com/sun/star/lang/DisposedException.hpp>
|
||||
#include <com/sun/star/frame/XFramesSupplier.hpp>
|
||||
#include <com/sun/star/frame/Desktop.hpp>
|
||||
#include <com/sun/star/frame/PopupMenuControllerFactory.hpp>
|
||||
#include <com/sun/star/container/XEnumeration.hpp>
|
||||
#include <com/sun/star/util/XStringWidth.hpp>
|
||||
#include <com/sun/star/uno/XComponentContext.hpp>
|
||||
@@ -183,7 +182,9 @@ MenuBarManager::MenuBarManager(
|
||||
, m_nSymbolsStyle( SvtMiscOptions().GetCurrentSymbolsStyle() )
|
||||
{
|
||||
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::MenuBarManager" );
|
||||
m_xPopupMenuControllerRegistration = PopupMenuControllerFactory::create( m_xContext );
|
||||
m_xPopupMenuControllerRegistration = Reference< ::com::sun::star::frame::XUIControllerRegistration >(
|
||||
getServiceFactory()->createInstance( OUString( "com.sun.star.frame.PopupMenuControllerFactory" )),
|
||||
UNO_QUERY );
|
||||
FillMenuManager( pMenu, rFrame, rDispatchProvider, rModuleIdentifier, bDelete, bDeleteChildren );
|
||||
}
|
||||
|
||||
@@ -1186,7 +1187,10 @@ sal_Bool MenuBarManager::CreatePopupMenuController( MenuItemHandler* pMenuItemHa
|
||||
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::CreatePopupMenuController" );
|
||||
OUString aItemCommand( pMenuItemHandler->aMenuItemURL );
|
||||
|
||||
// Try instantiate a popup menu controller. It is stored in the menu item handler.
|
||||
// Try instanciate a popup menu controller. It is stored in the menu item handler.
|
||||
Reference< XMultiComponentFactory > xPopupMenuControllerFactory( m_xPopupMenuControllerRegistration, UNO_QUERY );
|
||||
if ( xPopupMenuControllerFactory.is() )
|
||||
{
|
||||
Sequence< Any > aSeq( 2 );
|
||||
PropertyValue aPropValue;
|
||||
|
||||
@@ -1197,11 +1201,14 @@ sal_Bool MenuBarManager::CreatePopupMenuController( MenuItemHandler* pMenuItemHa
|
||||
aPropValue.Value <<= m_xFrame;
|
||||
aSeq[1] <<= aPropValue;
|
||||
|
||||
Reference< XComponentContext > xComponentContext(
|
||||
comphelper::getComponentContext( getServiceFactory() ) );
|
||||
|
||||
Reference< XPopupMenuController > xPopupMenuController(
|
||||
m_xPopupMenuControllerRegistration->createInstanceWithArgumentsAndContext(
|
||||
xPopupMenuControllerFactory->createInstanceWithArgumentsAndContext(
|
||||
aItemCommand,
|
||||
aSeq,
|
||||
m_xContext ),
|
||||
xComponentContext ),
|
||||
UNO_QUERY );
|
||||
|
||||
if ( xPopupMenuController.is() )
|
||||
@@ -1211,6 +1218,7 @@ sal_Bool MenuBarManager::CreatePopupMenuController( MenuItemHandler* pMenuItemHa
|
||||
xPopupMenuController->setPopupMenu( pMenuItemHandler->xPopupMenu );
|
||||
return sal_True;
|
||||
}
|
||||
}
|
||||
|
||||
return sal_False;
|
||||
}
|
||||
@@ -2012,7 +2020,9 @@ void MenuBarManager::Init(const Reference< XFrame >& rFrame,AddonMenu* pAddonMen
|
||||
m_bIsBookmarkMenu = sal_True;
|
||||
|
||||
OUString aModuleIdentifier;
|
||||
m_xPopupMenuControllerRegistration = PopupMenuControllerFactory::create( m_xContext );
|
||||
m_xPopupMenuControllerRegistration = Reference< ::com::sun::star::frame::XUIControllerRegistration >(
|
||||
getServiceFactory()->createInstance( OUString( "com.sun.star.frame.PopupMenuControllerFactory" )),
|
||||
UNO_QUERY );
|
||||
|
||||
Reference< XStatusListener > xStatusListener;
|
||||
Reference< XDispatch > xDispatch;
|
||||
|
@@ -20,7 +20,6 @@
|
||||
|
||||
#include <com/sun/star/awt/XPopupMenu.hpp>
|
||||
#include <com/sun/star/frame/XPopupMenuController.hpp>
|
||||
#include <com/sun/star/frame/PopupMenuControllerFactory.hpp>
|
||||
|
||||
#include <toolkit/helper/vclunohelper.hxx>
|
||||
|
||||
@@ -156,7 +155,7 @@ void SAL_CALL PopupMenuController::doubleClick() throw (RuntimeException)
|
||||
|
||||
bool PopupMenuController::CreatePopupMenuController() throw (Exception)
|
||||
{
|
||||
Reference< XToolbarControllerFactory > xPopupMenuControllerRegistration = PopupMenuControllerFactory::create( m_xContext );
|
||||
Reference< XMultiComponentFactory > xPopupMenuControllerRegistration( getServiceManager()->createInstance( SERVICENAME_POPUPMENUCONTROLLERFACTORY ), UNO_QUERY_THROW );
|
||||
|
||||
Sequence< Any > aSeq( 2 );
|
||||
PropertyValue aPropValue;
|
||||
@@ -168,7 +167,10 @@ bool PopupMenuController::CreatePopupMenuController() throw (Exception)
|
||||
aPropValue.Value <<= m_xFrame;
|
||||
aSeq[1] <<= aPropValue;
|
||||
|
||||
Reference< XPopupMenuController > xPopupMenuController( xPopupMenuControllerRegistration->createInstanceWithArgumentsAndContext( getCommandURL(), aSeq, m_xContext ), UNO_QUERY );
|
||||
Reference< XComponentContext > xComponentContext(
|
||||
comphelper::getComponentContext( getServiceManager() ) );
|
||||
|
||||
Reference< XPopupMenuController > xPopupMenuController( xPopupMenuControllerRegistration->createInstanceWithArgumentsAndContext( getCommandURL(), aSeq, xComponentContext ), UNO_QUERY );
|
||||
if ( xPopupMenuController.is() )
|
||||
{
|
||||
mxPopupMenuController = xPopupMenuController;
|
||||
|
@@ -54,7 +54,7 @@ namespace framework
|
||||
//*****************************************************************************************************************
|
||||
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( PopupMenuControllerFactory ,
|
||||
::cppu::OWeakObject ,
|
||||
DECLARE_ASCII("com.sun.star.frame.PopupMenuControllerFactory"),
|
||||
SERVICENAME_POPUPMENUCONTROLLERFACTORY ,
|
||||
IMPLEMENTATIONNAME_POPUPMENUCONTROLLERFACTORY
|
||||
)
|
||||
|
||||
|
@@ -198,7 +198,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/frame,\
|
||||
GlobalEventBroadcaster \
|
||||
MediaTypeDetectionHelper \
|
||||
ModuleManager \
|
||||
PopupMenuControllerFactory \
|
||||
SessionListener \
|
||||
StartModule \
|
||||
TaskCreator \
|
||||
@@ -942,6 +941,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/frame,\
|
||||
FramesContainer \
|
||||
LayoutManager \
|
||||
PopupMenuController \
|
||||
PopupMenuControllerFactory \
|
||||
ProtocolHandler \
|
||||
SessionManager \
|
||||
Settings \
|
||||
@@ -2630,7 +2630,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/frame,\
|
||||
XTitleChangeBroadcaster \
|
||||
XTitleChangeListener \
|
||||
XToolbarController \
|
||||
XToolbarControllerFactory \
|
||||
XToolbarControllerListener \
|
||||
XTransientDocumentsDocumentContentFactory \
|
||||
XUIControllerRegistration \
|
||||
|
@@ -20,7 +20,8 @@
|
||||
#ifndef __com_sun_star_frame_PopupMenuControllerFactory_idl__
|
||||
#define __com_sun_star_frame_PopupMenuControllerFactory_idl__
|
||||
|
||||
#include <com/sun/star/frame/XToolbarControllerFactory.idl>
|
||||
#include <com/sun/star/lang/XMultiComponentFactory.idl>
|
||||
#include <com/sun/star/frame/XUIControllerRegistration.idl>
|
||||
|
||||
|
||||
module com { module sun { module star { module frame {
|
||||
@@ -37,7 +38,30 @@ module com { module sun { module star { module frame {
|
||||
@since OOo 2.0
|
||||
*/
|
||||
|
||||
service PopupMenuControllerFactory : XToolbarControllerFactory;
|
||||
service PopupMenuControllerFactory
|
||||
{
|
||||
/** this interface provides functions to create new instances of a registered pop-up menu controller.
|
||||
|
||||
<p>
|
||||
Use <member scope="com.sun.star.lang">XMultiComponentFactory::createInstanceWithArguments()</member> to create
|
||||
a new pop-up menu controller instance. Use the CommandURL as the service specifier.
|
||||
|
||||
This call supports the following arguments provided as <type scope="com::sun::star::beans">PropertyValue</type>:
|
||||
<ul>
|
||||
<li><b>Frame</b><br>specifies the <type scope="com::sun::star::frame">XFrame</type>
|
||||
instance to which the pop-up menu controller belongs to. This property must be provided to
|
||||
the pop-up menu controller, otherwise it cannot dispatch its internal commands.</li>
|
||||
<li><b>ModuleIdentifier</b><br>optional string that specifies in which module context the pop-up menu
|
||||
controller should be created.</li>
|
||||
</ul>
|
||||
</p>
|
||||
*/
|
||||
interface com::sun::star::lang::XMultiComponentFactory;
|
||||
|
||||
/** provides functions to query for, register and deregister a pop-up menu controller.
|
||||
*/
|
||||
interface com::sun::star::frame::XUIControllerRegistration;
|
||||
};
|
||||
|
||||
}; }; }; };
|
||||
|
||||
|
@@ -1,65 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* 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 .
|
||||
*/
|
||||
|
||||
#ifndef __com_sun_star_frame_XToolbarControllerFactory_idl__
|
||||
#define __com_sun_star_frame_XToolbarControllerFactory_idl__
|
||||
|
||||
#include <com/sun/star/lang/XMultiComponentFactory.idl>
|
||||
#include <com/sun/star/frame/XUIControllerRegistration.idl>
|
||||
|
||||
|
||||
module com { module sun { module star { module frame {
|
||||
|
||||
|
||||
/** Provides a unified interface for the new-style PopupMenuControllerFactory service to implement.
|
||||
|
||||
@since LibreOffice 4.1
|
||||
*/
|
||||
|
||||
interface XToolbarControllerFactory
|
||||
{
|
||||
/** this interface provides functions to create new instances of a registered pop-up menu controller.
|
||||
|
||||
<p>
|
||||
Use <member scope="com.sun.star.lang">XMultiComponentFactory::createInstanceWithArguments()</member> to create
|
||||
a new pop-up menu controller instance. Use the CommandURL as the service specifier.
|
||||
|
||||
This call supports the following arguments provided as <type scope="com::sun::star::beans">PropertyValue</type>:
|
||||
<ul>
|
||||
<li><b>Frame</b><br>specifies the <type scope="com::sun::star::frame">XFrame</type>
|
||||
instance to which the pop-up menu controller belongs to. This property must be provided to
|
||||
the pop-up menu controller, otherwise it cannot dispatch its internal commands.</li>
|
||||
<li><b>ModuleIdentifier</b><br>optional string that specifies in which module context the pop-up menu
|
||||
controller should be created.</li>
|
||||
</ul>
|
||||
</p>
|
||||
*/
|
||||
interface com::sun::star::lang::XMultiComponentFactory;
|
||||
|
||||
/** provides functions to query for, register and deregister a pop-up menu controller.
|
||||
*/
|
||||
interface com::sun::star::frame::XUIControllerRegistration;
|
||||
};
|
||||
|
||||
}; }; }; };
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
Reference in New Issue
Block a user