UI Controller Factory fixes

- "ModuleName" --> "ModuleIdentifier": the IDL definition for
css::frame::PopupMenuControllerFactory and
css::frame::StatusbarControllerFactory tells to use a property named
"ModuleIdentifier", but in the code it is named "ModuleName"

- Undocumented css::frame::ToolbarControllerFactory

- Fix service name of ToolbarControllerFactory (ToolbarControllerFactory
instead of ToolBarControllerFactory)

- Convert the three service factories to new style, and use these
new-style services in the source code

- Implement multiple inheritance: added new css::frame::XUIControllerFactory

- Added a (true) base class and implemented the three factories in a
single file

(cherry picked from commit acc7fed28f54f836b0923180431a0c180f91e98c)

Conflicts:
	framework/inc/pch/precompiled_framework.hxx
	framework/inc/uielement/toolbarmanager.hxx
	framework/inc/uifactory/popupmenucontrollerfactory.hxx
	framework/inc/uifactory/statusbarcontrollerfactory.hxx
	framework/inc/uifactory/uicontrollerfactory.hxx
	framework/source/uielement/addonstoolbarmanager.cxx
	framework/source/uielement/menubarmanager.cxx
	framework/source/uielement/popupmenucontroller.cxx
	framework/source/uielement/statusbarmanager.cxx
	framework/source/uielement/toolbarmanager.cxx
	framework/source/uifactory/popupmenucontrollerfactory.cxx
	framework/source/uifactory/statusbarcontrollerfactory.cxx
	framework/source/uifactory/uicontrollerfactory.cxx
	framework/source/unotypes/fwk.xml
	offapi/com/sun/star/frame/PopupMenuControllerFactory.idl
	offapi/com/sun/star/frame/StatusbarControllerFactory.idl
	offapi/com/sun/star/frame/makefile.mk
	svtools/source/uno/toolboxcontroller.cxx

Change-Id: Ia8580539badf650a84bc6e57a6b832071e011f0a
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 0b05fab..195776f 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -69,6 +69,8 @@
#include <com/sun/star/ui/UIElementFactoryManager.hpp>
#include <com/sun/star/ui/WindowStateConfiguration.hpp>
#include <com/sun/star/frame/XUIControllerRegistration.hpp>
#include <com/sun/star/frame/ToolbarControllerFactory.hpp>
#include <com/sun/star/frame/PopupMenuControllerFactory.hpp>

#include <toolkit/unohlp.hxx>
#include <comphelper/configuration.hxx>
@@ -2214,21 +2216,17 @@ void Desktop::PreloadConfigurationData()

    // preload popup menu controller factories. As all controllers are in the same
    // configuration file they also get preloaded!
    Reference< ::com::sun::star::frame::XUIControllerRegistration > xPopupMenuControllerFactory(
        rFactory->createInstance(
            rtl::OUString( "com.sun.star.frame.PopupMenuControllerFactory" )),
            UNO_QUERY );
    if ( xPopupMenuControllerFactory.is() )

    Reference< css::frame::XUIControllerRegistration > xPopupMenuControllerFactory =
    css::frame::PopupMenuControllerFactory::create( xContext );
    try
    {
        try
        {
            xPopupMenuControllerFactory->hasController(
                        rtl::OUString( ".uno:CharFontName" ),
                        OUString() );
        }
        catch ( const ::com::sun::star::uno::Exception& )
        {
        }
        xPopupMenuControllerFactory->hasController(
                    OUString( ".uno:CharFontName" ),
                    OUString() );
    }
    catch ( const ::com::sun::star::uno::Exception& )
    {
    }

    // preload filter configuration
diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index 2a53057..bc9b711 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -160,10 +160,8 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
    framework/source/uifactory/addonstoolboxfactory \
    framework/source/uifactory/factoryconfiguration \
    framework/source/uifactory/menubarfactory \
    framework/source/uifactory/popupmenucontrollerfactory \
    framework/source/uifactory/statusbarcontrollerfactory \
    framework/source/uifactory/statusbarfactory \
    framework/source/uifactory/toolbarcontrollerfactory \
    framework/source/uifactory/uicontrollerfactory \
    framework/source/uifactory/toolboxfactory \
    framework/source/uifactory/uielementfactorymanager \
    framework/source/uifactory/windowcontentfactorymanager \
diff --git a/framework/inc/services.h b/framework/inc/services.h
index d57af35..16a9443 100644
--- a/framework/inc/services.h
+++ b/framework/inc/services.h
@@ -46,7 +46,7 @@ namespace framework{
#define SERVICENAME_MODULEACCELERATORCONFIGURATION              DECLARE_ASCII("com.sun.star.ui.ModuleAcceleratorConfiguration")
#define SERVICENAME_DOCUMENTACCELERATORCONFIGURATION            DECLARE_ASCII("com.sun.star.ui.DocumentAcceleratorConfiguration")
#define SERVICENAME_TOOLBARFACTORY                              DECLARE_ASCII("com.sun.star.ui.ToolBarFactory"               )
#define SERVICENAME_TOOLBARCONTROLLERFACTORY                    DECLARE_ASCII("com.sun.star.frame.ToolBarControllerFactory"         )
#define SERVICENAME_TOOLBARCONTROLLERFACTORY                    DECLARE_ASCII("com.sun.star.frame.ToolbarControllerFactory"         )
#define SERVICENAME_LICENSE                                     SERVICENAME_JOB
#define SERVICENAME_STATUSBARFACTORY                            DECLARE_ASCII("com.sun.star.ui.StatusBarFactory"             )
#define SERVICENAME_STATUSBARCONTROLLERFACTORY                  DECLARE_ASCII("com.sun.star.frame.StatusbarControllerFactory"       )
diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx
index 1e9e386..50e27d66 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -41,7 +41,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/frame/XUIControllerRegistration.hpp>
#include <com/sun/star/frame/XUIControllerFactory.hpp>
#include <com/sun/star/ui/XUIConfigurationListener.hpp>
#include <com/sun/star/ui/XImageManager.hpp>
#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
@@ -235,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::XUIControllerRegistration > m_xPopupMenuControllerRegistration;
        ::com::sun::star::uno::Reference< ::com::sun::star::frame::XUIControllerFactory > m_xPopupMenuControllerFactory;
        ::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;
diff --git a/framework/inc/uielement/statusbarmanager.hxx b/framework/inc/uielement/statusbarmanager.hxx
index 26cc183..c855b12 100644
--- a/framework/inc/uielement/statusbarmanager.hxx
+++ b/framework/inc/uielement/statusbarmanager.hxx
@@ -29,7 +29,7 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XStatusListener.hpp>
#include <com/sun/star/frame/XStatusbarController.hpp>
#include <com/sun/star/frame/XUIControllerRegistration.hpp>
#include <com/sun/star/frame/XUIControllerFactory.hpp>
#include <com/sun/star/ui/XUIConfiguration.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -118,7 +118,7 @@ class StatusBarManager : public ::com::sun::star::frame::XFrameActionListener   
        StatusBarControllerMap                                                                          m_aControllerMap;
        ::cppu::OMultiTypeInterfaceContainerHelper                                                      m_aListenerContainer;   /// container for ALL Listener
        ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >                  m_xServiceManager;
        ::com::sun::star::uno::Reference< ::com::sun::star::frame::XUIControllerRegistration >  m_xStatusbarControllerRegistration;
        ::com::sun::star::uno::Reference< ::com::sun::star::frame::XUIControllerFactory >  m_xStatusbarControllerFactory;
};

}
diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx
index 3e05868..1b26588 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -34,7 +34,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
#include <com/sun/star/frame/XUIControllerRegistration.hpp>
#include <com/sun/star/frame/XUIControllerFactory.hpp>
#include <com/sun/star/ui/XImageManager.hpp>
#include <com/sun/star/ui/XUIConfigurationManager.hpp>
#include <com/sun/star/frame/XSubToolbarController.hpp>
@@ -202,7 +202,7 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener     
        ToolBarControllerMap                                                                   m_aControllerMap;
        ::cppu::OMultiTypeInterfaceContainerHelper                                             m_aListenerContainer;   /// container for ALL Listener
        ::com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >             m_xContext;
        ::com::sun::star::uno::Reference< ::com::sun::star::frame::XUIControllerRegistration > m_xToolbarControllerRegistration;
        ::com::sun::star::uno::Reference< ::com::sun::star::frame::XUIControllerFactory > m_xToolbarControllerFactory;
        ::com::sun::star::uno::Reference< ::com::sun::star::ui::XImageManager >                m_xModuleImageManager;
        ::com::sun::star::uno::Reference< ::com::sun::star::ui::XImageManager >                m_xDocImageManager;
        ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >                 m_xImageOrientationListener;
diff --git a/framework/inc/uifactory/factoryconfiguration.hxx b/framework/inc/uifactory/factoryconfiguration.hxx
index 82a9943..eacb8da 100644
--- a/framework/inc/uifactory/factoryconfiguration.hxx
+++ b/framework/inc/uifactory/factoryconfiguration.hxx
@@ -31,7 +31,6 @@
#include <com/sun/star/container/XContainerListener.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/frame/XUIControllerRegistration.hpp>

#include <cppuhelper/implbase1.hxx>
#include <rtl/ustring.hxx>
diff --git a/framework/inc/uifactory/popupmenucontrollerfactory.hxx b/framework/inc/uifactory/popupmenucontrollerfactory.hxx
deleted file mode 100644
index 749bd51..0000000
--- a/framework/inc/uifactory/popupmenucontrollerfactory.hxx
+++ /dev/null
@@ -1,50 +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 __FRAMEWORK_UIFACTORY_POPUPMENUCONTROLLERFACTORY_HXX_
#define __FRAMEWORK_UIFACTORY_POPUPMENUCONTROLLERFACTORY_HXX_

/** Attention: stl headers must(!) be included at first. Otherwhise it can make trouble
               with solaris headers ...
*/
#include <vector>
#include <list>

#include <macros/xserviceinfo.hxx>
#include <stdtypes.h>
#include <uifactory/toolbarcontrollerfactory.hxx>

namespace framework
{

class ConfigurationAccess_ControllerFactory;
class PopupMenuControllerFactory :  public ToolbarControllerFactory
{
    public:
        PopupMenuControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );

        //  XInterface, XTypeProvider, XServiceInfo
        DECLARE_XSERVICEINFO
};

} // namespace framework

#endif // __FRAMEWORK_SERVICES_POPUPMENUCONTROLLERFACTORY_HXX_

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/inc/uifactory/statusbarcontrollerfactory.hxx b/framework/inc/uifactory/statusbarcontrollerfactory.hxx
deleted file mode 100644
index 979639f..0000000
--- a/framework/inc/uifactory/statusbarcontrollerfactory.hxx
+++ /dev/null
@@ -1,44 +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 __FRAMEWORK_UIFACTORY_STATUSBARCONTROLLERFACTORY_HXX_
#define __FRAMEWORK_UIFACTORY_STATUSBARCONTROLLERFACTORY_HXX_

#include <macros/xserviceinfo.hxx>
#include <uifactory/toolbarcontrollerfactory.hxx>
#include <stdtypes.h>

namespace framework
{

class ConfigurationAccess_ControllerFactory;
class StatusbarControllerFactory :  public ToolbarControllerFactory
{
    public:
        StatusbarControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );

        //  XInterface, XTypeProvider, XServiceInfo
        DECLARE_XSERVICEINFO
};

} // namespace framework

#endif // __FRAMEWORK_SERVICES_STATUSBARCONTROLLERFACTORY_HXX_

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/inc/uifactory/toolbarcontrollerfactory.hxx b/framework/inc/uifactory/toolbarcontrollerfactory.hxx
deleted file mode 100644
index 7534e6c..0000000
--- a/framework/inc/uifactory/toolbarcontrollerfactory.hxx
+++ /dev/null
@@ -1,75 +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 __FRAMEWORK_UIFACTORY_TOOLBARCONTROLLERFACTORY_HXX_
#define __FRAMEWORK_UIFACTORY_TOOLBARCONTROLLERFACTORY_HXX_

#include <threadhelp/threadhelpbase.hxx>
#include <macros/generic.hxx>
#include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx>
#include <macros/xserviceinfo.hxx>
#include <stdtypes.h>

#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/frame/XUIControllerRegistration.hpp>

#include <cppuhelper/implbase3.hxx>
#include <rtl/ustring.hxx>

namespace framework
{

class ConfigurationAccess_ControllerFactory;
class ToolbarControllerFactory :  protected ThreadHelpBase                                          ,   // Struct for right initalization of mutex member! Must be first of baseclasses.
                                  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 );
        virtual ~ToolbarControllerFactory();

        //  XInterface, XTypeProvider, XServiceInfo
        DECLARE_XSERVICEINFO

        // XMultiComponentFactory
        virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithContext( const OUString& aServiceSpecifier, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
        virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArgumentsAndContext( const OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
        virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() throw (::com::sun::star::uno::RuntimeException);

        // XUIControllerRegistration
        virtual sal_Bool SAL_CALL hasController( const OUString& aCommandURL, const OUString& aModuleName ) throw (::com::sun::star::uno::RuntimeException);
        virtual void SAL_CALL registerController( const OUString& aCommandURL, const OUString& aModuleName, const OUString& aControllerImplementationName ) throw (::com::sun::star::uno::RuntimeException);
        virtual void SAL_CALL deregisterController( const OUString& aCommandURL, const OUString& aModuleName ) throw (::com::sun::star::uno::RuntimeException);

    protected:
        ToolbarControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager,bool  );
        sal_Bool                                                                         m_bConfigRead;
        ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
        ConfigurationAccess_ControllerFactory*                                           m_pConfigAccess;
};

} // namespace framework

#endif // __FRAMEWORK_SERVICES_TOOLBARCONTROLLERFACTORY_HXX_

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 173a0fe..0c75daa 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -38,7 +38,6 @@
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/FrameAction.hpp>
#include <com/sun/star/frame/XUIControllerRegistration.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/XSystemDependentMenuPeer.hpp>
diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx
index 8d9c0581..984ad9d 100644
--- a/framework/source/register/registerservices.cxx
+++ b/framework/source/register/registerservices.cxx
@@ -43,7 +43,7 @@
#include <services/backingcomp.hxx>
#include <services/layoutmanager.hxx>
#include <uifactory/uielementfactorymanager.hxx>
#include <uifactory/popupmenucontrollerfactory.hxx>
#include <uifactory/uicontrollerfactory.hxx>
#include <uielement/objectmenucontroller.hxx>
#include <uielement/controlmenucontroller.hxx>
#include <uielement/uicommanddescription.hxx>
@@ -57,8 +57,6 @@
#include <uifactory/toolboxfactory.hxx>
#include <uifactory/addonstoolboxfactory.hxx>
#include "uiconfiguration/windowstateconfiguration.hxx"
#include "uifactory/toolbarcontrollerfactory.hxx"
#include "uifactory/statusbarcontrollerfactory.hxx"
#include <services/autorecovery.hxx>
#include <helper/statusindicatorfactory.hxx>
#include <uielement/recentfilesmenucontroller.hxx>
diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx
index b0992ee..0bde95d 100644
--- a/framework/source/uielement/addonstoolbarmanager.cxx
+++ b/framework/source/uielement/addonstoolbarmanager.cxx
@@ -221,8 +221,6 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue 
    {
    }

    Reference< XMultiComponentFactory > xToolbarControllerFactory( m_xToolbarControllerRegistration, UNO_QUERY );

    sal_uInt32  nElements( 0 );
    sal_Bool    bAppendSeparator( sal_False );
    Reference< XWindow > xToolbarWindow = VCLUnoHelper::GetInterface( m_pToolBar );
@@ -279,42 +277,39 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue 
                sal_Bool bMustBeInit( sal_True );

                // Support external toolbar controller for add-ons!
                if ( m_xToolbarControllerRegistration.is() &&
                     m_xToolbarControllerRegistration->hasController( aURL, m_aModuleIdentifier ))
                if ( m_xToolbarControllerFactory.is() &&
                     m_xToolbarControllerFactory->hasController( aURL, m_aModuleIdentifier ))
                {
                    if ( xToolbarControllerFactory.is() )
                    Sequence< Any > aArgs(5);
                    PropertyValue   aPropValue;

                    aPropValue.Name     = OUString( "ModuleIdentifier" );
                    aPropValue.Value    <<= m_aModuleIdentifier;
                    aArgs[0] <<= aPropValue;
                    aPropValue.Name     = OUString( "Frame" );
                    aPropValue.Value    <<= m_xFrame;
                    aArgs[1] <<= aPropValue;
                    aPropValue.Name     = OUString( "ServiceManager" );
                    Reference<XMultiServiceFactory> xMSF(m_xContext->getServiceManager(), UNO_QUERY_THROW);
                    aPropValue.Value    <<= xMSF;
                    aArgs[2] <<= aPropValue;
                    aPropValue.Name     = OUString( "ParentWindow" );
                    aPropValue.Value    <<= xToolbarWindow;
                    aArgs[3] <<= aPropValue;
                    aPropValue.Name     = OUString( "ItemId" );
                    aPropValue.Value    = makeAny( sal_Int32( nId ));
                    aArgs[4] <<= aPropValue;

                    try
                    {
                        Sequence< Any > aArgs(5);
                        PropertyValue   aPropValue;

                        aPropValue.Name     = OUString( "ModuleName" );
                        aPropValue.Value    <<= m_aModuleIdentifier;
                        aArgs[0] <<= aPropValue;
                        aPropValue.Name     = OUString( "Frame" );
                        aPropValue.Value    <<= m_xFrame;
                        aArgs[1] <<= aPropValue;
                        aPropValue.Name     = OUString( "ServiceManager" );
                        Reference<XMultiServiceFactory> xMSF(m_xContext->getServiceManager(), UNO_QUERY_THROW);
                        aPropValue.Value    <<= xMSF;
                        aArgs[2] <<= aPropValue;
                        aPropValue.Name     = OUString( "ParentWindow" );
                        aPropValue.Value    <<= xToolbarWindow;
                        aArgs[3] <<= aPropValue;
                        aPropValue.Name     = OUString( "ItemId" );
                        aPropValue.Value    = makeAny( sal_Int32( nId ));
                        aArgs[4] <<= aPropValue;

                        try
                        {
                            xController = Reference< XStatusListener >( xToolbarControllerFactory->createInstanceWithArgumentsAndContext(
                                                                            aURL, aArgs, m_xContext ),
                                                                        UNO_QUERY );
                        }
                        catch ( const uno::Exception& )
                        {
                        }
                        bMustBeInit = sal_False; // factory called init already!
                        xController = Reference< XStatusListener >( m_xToolbarControllerFactory->createInstanceWithArgumentsAndContext(
                                                                        aURL, aArgs, m_xContext ),
                                                                    UNO_QUERY );
                    }
                    catch ( uno::Exception& )
                    {
                    }
                    bMustBeInit = sal_False; // factory called init already!
                }
                else
                {
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 91e7df8..f8a330b 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -31,6 +31,7 @@
#include <classes/resource.hrc>
#include <services.h>

#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
@@ -42,7 +43,7 @@
#include <com/sun/star/uno/XCurrentContext.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/frame/XPopupMenuController.hpp>
#include <com/sun/star/frame/XUIControllerRegistration.hpp>
#include <com/sun/star/frame/PopupMenuControllerFactory.hpp>
#include <com/sun/star/lang/SystemDependent.hpp>
#include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp>
#include <com/sun/star/ui/ItemType.hpp>
@@ -182,9 +183,7 @@ MenuBarManager::MenuBarManager(
    , m_nSymbolsStyle( SvtMiscOptions().GetCurrentSymbolsStyle() )
{
    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "MenuBarManager::MenuBarManager" );
    m_xPopupMenuControllerRegistration = Reference< ::com::sun::star::frame::XUIControllerRegistration >(
        getServiceFactory()->createInstance( OUString( "com.sun.star.frame.PopupMenuControllerFactory" )),
        UNO_QUERY );
    m_xPopupMenuControllerFactory = frame::PopupMenuControllerFactory::create(m_xContext);
    FillMenuManager( pMenu, rFrame, rDispatchProvider, rModuleIdentifier, bDelete, bDeleteChildren );
}

@@ -387,7 +386,7 @@ void SAL_CALL MenuBarManager::dispose() throw( RuntimeException )
        m_xModuleAcceleratorManager.clear();
        m_xDocAcceleratorManager.clear();
        m_xUICommandLabels.clear();
        m_xPopupMenuControllerRegistration.clear();
        m_xPopupMenuControllerFactory.clear();
        m_xContext.clear();
    }
}
@@ -953,7 +952,7 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu )

                            sal_Bool bPopupMenu( sal_False );
                            if ( !pMenuItemHandler->xPopupMenuController.is() &&
                                 m_xPopupMenuControllerRegistration->hasController( aItemCommand, OUString() ))
                                 m_xPopupMenuControllerFactory->hasController( aItemCommand, OUString() ))
                            {
                                bPopupMenu = CreatePopupMenuController( pMenuItemHandler );
                            }
@@ -1188,36 +1187,32 @@ sal_Bool MenuBarManager::CreatePopupMenuController( MenuItemHandler* pMenuItemHa
    OUString aItemCommand( pMenuItemHandler->aMenuItemURL );

    // Try instanciate a popup menu controller. It is stored in the menu item handler.
    Reference< XMultiComponentFactory > xPopupMenuControllerFactory( m_xPopupMenuControllerRegistration, UNO_QUERY );
    if ( xPopupMenuControllerFactory.is() )
    if ( !m_xPopupMenuControllerFactory.is() )
        return sal_False;

    Sequence< Any > aSeq( 2 );
    PropertyValue aPropValue;

    aPropValue.Name         = OUString( "ModuleIdentifier" );
    aPropValue.Value      <<= m_aModuleIdentifier;
    aSeq[0] <<= aPropValue;
    aPropValue.Name         = OUString( "Frame" );
    aPropValue.Value      <<= m_xFrame;
    aSeq[1] <<= aPropValue;

    Reference< XPopupMenuController > xPopupMenuController(
                                            m_xPopupMenuControllerFactory->createInstanceWithArgumentsAndContext(
                                                aItemCommand,
                                                aSeq,
                                                m_xContext ),
                                            UNO_QUERY );

    if ( xPopupMenuController.is() )
    {
        Sequence< Any > aSeq( 2 );
        PropertyValue aPropValue;

        aPropValue.Name         = OUString( "ModuleName" );
        aPropValue.Value      <<= m_aModuleIdentifier;
        aSeq[0] <<= aPropValue;
        aPropValue.Name         = OUString( "Frame" );
        aPropValue.Value      <<= m_xFrame;
        aSeq[1] <<= aPropValue;

        Reference< XComponentContext > xComponentContext(
            comphelper::getComponentContext( getServiceFactory() ) );

        Reference< XPopupMenuController > xPopupMenuController(
                                                xPopupMenuControllerFactory->createInstanceWithArgumentsAndContext(
                                                    aItemCommand,
                                                    aSeq,
                                                    xComponentContext ),
                                                UNO_QUERY );

        if ( xPopupMenuController.is() )
        {
            // Provide our awt popup menu to the popup menu controller
            pMenuItemHandler->xPopupMenuController = xPopupMenuController;
            xPopupMenuController->setPopupMenu( pMenuItemHandler->xPopupMenu );
            return sal_True;
        }
        // Provide our awt popup menu to the popup menu controller
        pMenuItemHandler->xPopupMenuController = xPopupMenuController;
        xPopupMenuController->setPopupMenu( pMenuItemHandler->xPopupMenu );
        return sal_True;
    }

    return sal_False;
@@ -1311,9 +1306,9 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
                pMenu->SetHelpCommand( nItemId, aEmpty );
            }

            if ( m_xPopupMenuControllerRegistration.is() &&
            if ( m_xPopupMenuControllerFactory.is() &&
                 pPopup->GetItemCount() == 0 &&
                 m_xPopupMenuControllerRegistration->hasController( aItemCommand, OUString() )
                 m_xPopupMenuControllerFactory->hasController( aItemCommand, OUString() )
                  )
            {
                // Check if we have to create a popup menu for a uno based popup menu controller.
@@ -1446,8 +1441,8 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
            MenuItemHandler* pItemHandler = new MenuItemHandler( nItemId, xStatusListener, xDispatch );
            pItemHandler->aMenuItemURL = aItemCommand;

            if ( m_xPopupMenuControllerRegistration.is() &&
                 m_xPopupMenuControllerRegistration->hasController( aItemCommand, OUString() ))
            if ( m_xPopupMenuControllerFactory.is() &&
                 m_xPopupMenuControllerFactory->hasController( aItemCommand, OUString() ))
            {
                // Check if we have to create a popup menu for a uno based popup menu controller.
                // We have to set an empty popup menu into our menu structure so the controller also
@@ -2020,9 +2015,8 @@ void MenuBarManager::Init(const Reference< XFrame >& rFrame,AddonMenu* pAddonMen
    m_bIsBookmarkMenu   = sal_True;

    OUString aModuleIdentifier;
    m_xPopupMenuControllerRegistration = Reference< ::com::sun::star::frame::XUIControllerRegistration >(
        getServiceFactory()->createInstance( OUString( "com.sun.star.frame.PopupMenuControllerFactory" )),
        UNO_QUERY );
    m_xPopupMenuControllerFactory = frame::PopupMenuControllerFactory::create(
        ::comphelper::getProcessComponentContext());

    Reference< XStatusListener > xStatusListener;
    Reference< XDispatch > xDispatch;
@@ -2069,8 +2063,8 @@ void MenuBarManager::Init(const Reference< XFrame >& rFrame,AddonMenu* pAddonMen
                    // Check if we have to create a popup menu for a uno based popup menu controller.
                    // We have to set an empty popup menu into our menu structure so the controller also
                    // works with inplace OLE.
                    if ( m_xPopupMenuControllerRegistration.is() &&
                        m_xPopupMenuControllerRegistration->hasController( aItemCommand, OUString() ))
                    if ( m_xPopupMenuControllerFactory.is() &&
                        m_xPopupMenuControllerFactory->hasController( aItemCommand, OUString() ))
                    {
                        VCLXPopupMenu* pVCLXPopupMenu = new VCLXPopupMenu;
                        PopupMenu* pCtlPopupMenu = (PopupMenu *)pVCLXPopupMenu->GetMenu();
diff --git a/framework/source/uielement/popupmenucontroller.cxx b/framework/source/uielement/popupmenucontroller.cxx
index 571b5cb..76e8949 100644
--- a/framework/source/uielement/popupmenucontroller.cxx
+++ b/framework/source/uielement/popupmenucontroller.cxx
@@ -19,6 +19,7 @@


#include <com/sun/star/awt/XPopupMenu.hpp>
#include <com/sun/star/frame/PopupMenuControllerFactory.hpp>
#include <com/sun/star/frame/XPopupMenuController.hpp>

#include <toolkit/helper/vclunohelper.hxx>
@@ -155,22 +156,19 @@ void SAL_CALL PopupMenuController::doubleClick() throw (RuntimeException)

bool PopupMenuController::CreatePopupMenuController() throw (Exception)
{
    Reference< XMultiComponentFactory > xPopupMenuControllerRegistration( getServiceManager()->createInstance( SERVICENAME_POPUPMENUCONTROLLERFACTORY ), UNO_QUERY_THROW );
    Reference< XMultiComponentFactory > xPopupMenuControllerRegistration = PopupMenuControllerFactory::create( m_xContext );

    Sequence< Any > aSeq( 2 );
    PropertyValue aPropValue;

    aPropValue.Name = OUString( "ModuleName" );
    aPropValue.Name = OUString( "ModuleIdentifier" );
    aPropValue.Value <<= getModuleName();
    aSeq[0] <<= aPropValue;
    aPropValue.Name = OUString( "Frame" );
    aPropValue.Value <<= m_xFrame;
    aSeq[1] <<= aPropValue;

    Reference< XComponentContext > xComponentContext(
        comphelper::getComponentContext( getServiceManager() ) );

    Reference< XPopupMenuController > xPopupMenuController( xPopupMenuControllerRegistration->createInstanceWithArgumentsAndContext( getCommandURL(), aSeq, xComponentContext ), UNO_QUERY );
    Reference< XPopupMenuController > xPopupMenuController( xPopupMenuControllerRegistration->createInstanceWithArgumentsAndContext( getCommandURL(), aSeq, m_xContext ), UNO_QUERY );
    if ( xPopupMenuController.is() )
    {
        mxPopupMenuController = xPopupMenuController;
diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx
index 35f8930..fb8ce45 100644
--- a/framework/source/uielement/statusbarmanager.cxx
+++ b/framework/source/uielement/statusbarmanager.cxx
@@ -38,6 +38,7 @@

#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XStatusListener.hpp>
#include <com/sun/star/frame/StatusbarControllerFactory.hpp>
#include <com/sun/star/util/XUpdatable.hpp>
#include <com/sun/star/ui/ItemStyle.hpp>
#include <com/sun/star/ui/ItemType.hpp>
@@ -49,6 +50,7 @@
#include <toolkit/unohlp.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <svtools/statusbarcontroller.hxx>
#include <comphelper/processfactory.hxx>

#include <vcl/status.hxx>
#include <vcl/svapp.hxx>
@@ -172,10 +174,8 @@ StatusBarManager::StatusBarManager(
{
    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::StatusBarManager" );

    if ( m_xServiceManager.is() )
        m_xStatusbarControllerRegistration = uno::Reference< css::frame::XUIControllerRegistration >(
                                                    m_xServiceManager->createInstance( SERVICENAME_STATUSBARCONTROLLERFACTORY ),
                                                    uno::UNO_QUERY );
    m_xStatusbarControllerFactory = frame::StatusbarControllerFactory::create(
        ::comphelper::getProcessComponentContext());

    m_pStatusBar->SetClickHdl( LINK( this, StatusBarManager, Click ) );
    m_pStatusBar->SetDoubleClickHdl( LINK( this, StatusBarManager, DoubleClick ) );
@@ -353,7 +353,6 @@ OUString StatusBarManager::RetrieveLabelFromCommand( const OUString& aCmdURL )
void StatusBarManager::CreateControllers()
{
    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarManager::CreateControllers" );
    uno::Reference< lang::XMultiComponentFactory > xStatusbarControllerFactory( m_xStatusbarControllerRegistration, uno::UNO_QUERY );
    uno::Reference< uno::XComponentContext > xComponentContext(
        comphelper::getComponentContext( m_xServiceManager ) );
    uno::Reference< awt::XWindow > xStatusbarWindow = VCLUnoHelper::GetInterface( m_pStatusBar );
@@ -375,47 +374,44 @@ void StatusBarManager::CreateControllers()
        svt::StatusbarController* pController( 0 );

        // 1º) UNO Statusbar controllers, registered in Controllers.xcu
        if ( m_xStatusbarControllerRegistration.is() &&
             m_xStatusbarControllerRegistration->hasController( aCommandURL, m_aModuleIdentifier ))
        if ( m_xStatusbarControllerFactory.is() &&
             m_xStatusbarControllerFactory->hasController( aCommandURL, m_aModuleIdentifier ))
        {
            if ( xStatusbarControllerFactory.is() )
            {
                beans::PropertyValue aPropValue;
                std::vector< uno::Any > aPropVector;
            beans::PropertyValue aPropValue;
            std::vector< uno::Any > aPropVector;

                aPropValue.Name     = OUString( "ModuleName" );
                aPropValue.Value    = uno::makeAny( m_aModuleIdentifier );
                aPropVector.push_back( uno::makeAny( aPropValue ) );
            aPropValue.Name     = OUString( "ModuleIdentifier" );
            aPropValue.Value    = uno::makeAny( m_aModuleIdentifier );
            aPropVector.push_back( uno::makeAny( aPropValue ) );

                aPropValue.Name     = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
                aPropValue.Value    = uno::makeAny( m_xFrame );
                aPropVector.push_back( uno::makeAny( aPropValue ) );
            aPropValue.Name     = OUString( "Frame" );
            aPropValue.Value    = uno::makeAny( m_xFrame );
            aPropVector.push_back( uno::makeAny( aPropValue ) );

                // TODO remove this
                aPropValue.Name     = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ServiceManager" ));
                aPropValue.Value    = uno::makeAny( m_xServiceManager );
                aPropVector.push_back( uno::makeAny( aPropValue ) );
            // TODO remove this
            aPropValue.Name     = OUString( "ServiceManager" );
            aPropValue.Value    = uno::makeAny( m_xServiceManager );
            aPropVector.push_back( uno::makeAny( aPropValue ) );

                aPropValue.Name     = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParentWindow" ));
                aPropValue.Value    = uno::makeAny( xStatusbarWindow );
                aPropVector.push_back( uno::makeAny( aPropValue ) );
            aPropValue.Name     = OUString( "ParentWindow" );
            aPropValue.Value    = uno::makeAny( xStatusbarWindow );
            aPropVector.push_back( uno::makeAny( aPropValue ) );

                // TODO still needing with the css::ui::XStatusbarItem?
                aPropValue.Name     = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Identifier" ));
                aPropValue.Value    = uno::makeAny( nId );
                aPropVector.push_back( uno::makeAny( aPropValue ) );
            // TODO still needing with the css::ui::XStatusbarItem?
            aPropValue.Name     = OUString( "Identifier" );
            aPropValue.Value    = uno::makeAny( nId );
            aPropVector.push_back( uno::makeAny( aPropValue ) );

                aPropValue.Name     = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StatusbarItem" ));
                aPropValue.Value    <<= xStatusbarItem;
                aPropVector.push_back( uno::makeAny( aPropValue ) );
            aPropValue.Name     = OUString( "StatusbarItem" );
            aPropValue.Value    <<= xStatusbarItem;
            aPropVector.push_back( uno::makeAny( aPropValue ) );

                uno::Sequence< uno::Any > aArgs( comphelper::containerToSequence( aPropVector ) );
                xController = uno::Reference< frame::XStatusListener >(
                                xStatusbarControllerFactory->createInstanceWithArgumentsAndContext(
                                    aCommandURL, aArgs, xComponentContext ),
                                uno::UNO_QUERY );
                bInit = sal_False; // Initialization is done through the factory service
            }
            uno::Sequence< uno::Any > aArgs( comphelper::containerToSequence( aPropVector ) );
            xController = uno::Reference< frame::XStatusListener >(
                            m_xStatusbarControllerFactory->createInstanceWithArgumentsAndContext(
                                aCommandURL, aArgs, xComponentContext ),
                            uno::UNO_QUERY );
            bInit = sal_False; // Initialization is done through the factory service
        }

        if ( !xController.is() )
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index ca4e2cf..05f15ba 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -41,6 +41,7 @@
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/ToolbarControllerFactory.hpp>
#include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp>
#include <com/sun/star/ui/XUIElementSettings.hpp>
#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
@@ -229,7 +230,7 @@ ToolBarManager::ToolBarManager( const Reference< XComponentContext >& rxContext,
    if ( pWindow )
        ((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( m_pToolBar );

    m_xToolbarControllerRegistration = frame::ToolBarControllerFactory::create( m_xContext );
    m_xToolbarControllerFactory = frame::ToolbarControllerFactory::create( m_xContext );
    m_xURLTransformer = URLTransformer::create( m_xContext );

    m_pToolBar->SetSelectHdl( LINK( this, ToolBarManager, Select) );
@@ -873,7 +874,6 @@ void ToolBarManager::CreateControllers()
{
    RTL_LOGFILE_CONTEXT( aLog, "framework (cd100003) ::ToolBarManager::CreateControllers" );

    Reference< XMultiComponentFactory > xToolbarControllerFactory( m_xToolbarControllerRegistration, UNO_QUERY );
    Reference< XWindow > xToolbarWindow = VCLUnoHelper::GetInterface( m_pToolBar );

    css::util::URL      aURL;
@@ -908,41 +908,38 @@ void ToolBarManager::CreateControllers()
            }
        }

        if ( m_xToolbarControllerRegistration.is() &&
             m_xToolbarControllerRegistration->hasController( aCommandURL, m_aModuleIdentifier ))
        if ( m_xToolbarControllerFactory.is() &&
             m_xToolbarControllerFactory->hasController( aCommandURL, m_aModuleIdentifier ))
        {
            if ( xToolbarControllerFactory.is() )
            PropertyValue aPropValue;
            std::vector< Any > aPropertyVector;

            aPropValue.Name     = OUString( "ModuleIdentifier" );
            aPropValue.Value    <<= m_aModuleIdentifier;
            aPropertyVector.push_back( makeAny( aPropValue ));
            aPropValue.Name     = OUString( "Frame" );
            aPropValue.Value    <<= m_xFrame;
            aPropertyVector.push_back( makeAny( aPropValue ));
            aPropValue.Name     = OUString( "ServiceManager" );
            Reference<XMultiServiceFactory> xMSF(m_xContext->getServiceManager(), UNO_QUERY_THROW);
            aPropValue.Value    <<= xMSF;
            aPropertyVector.push_back( makeAny( aPropValue ));
            aPropValue.Name     = OUString( "ParentWindow" );
            aPropValue.Value    <<= xToolbarWindow;
            aPropertyVector.push_back( makeAny( aPropValue ));

            if ( nWidth > 0 )
            {
                PropertyValue aPropValue;
                std::vector< Any > aPropertyVector;

                aPropValue.Name     = OUString( "ModuleName" );
                aPropValue.Value    <<= m_aModuleIdentifier;
                aPropValue.Name     = OUString( "Width" );
                aPropValue.Value    <<= nWidth;
                aPropertyVector.push_back( makeAny( aPropValue ));
                aPropValue.Name     = OUString( "Frame" );
                aPropValue.Value    <<= m_xFrame;
                aPropertyVector.push_back( makeAny( aPropValue ));
                aPropValue.Name     = OUString( "ServiceManager" );
                Reference<XMultiServiceFactory> xMSF(m_xContext->getServiceManager(), UNO_QUERY_THROW);
                aPropValue.Value    <<= xMSF;
                aPropertyVector.push_back( makeAny( aPropValue ));
                aPropValue.Name     = OUString( "ParentWindow" );
                aPropValue.Value    <<= xToolbarWindow;
                aPropertyVector.push_back( makeAny( aPropValue ));

                if ( nWidth > 0 )
                {
                    aPropValue.Name     = OUString( "Width" );
                    aPropValue.Value    <<= nWidth;
                    aPropertyVector.push_back( makeAny( aPropValue ));
                }

                Sequence< Any > aArgs( comphelper::containerToSequence( aPropertyVector ));
                xController = Reference< XStatusListener >( xToolbarControllerFactory->createInstanceWithArgumentsAndContext(
                                                                aCommandURL, aArgs, m_xContext ),
                                                            UNO_QUERY );
                bInit = sal_False; // Initialization is done through the factory service
            }

            Sequence< Any > aArgs( comphelper::containerToSequence( aPropertyVector ));
            xController = Reference< XStatusListener >( m_xToolbarControllerFactory->createInstanceWithArgumentsAndContext(
                                                            aCommandURL, aArgs, m_xContext ),
                                                        UNO_QUERY );
            bInit = sal_False; // Initialization is done through the factory service
        }

        if (( aCommandURL == aLoadURL ) && ( !m_pToolBar->IsItemVisible(nId)))
@@ -1040,7 +1037,7 @@ void ToolBarManager::CreateControllers()
                aPropValue.Name = OUString( "ParentWindow" );
                aPropValue.Value <<= xToolbarWindow;
                aPropertyVector.push_back( makeAny( aPropValue ));
                aPropValue.Name = OUString( "ModuleName" );
                aPropValue.Name = OUString( "ModuleIdentifier" );
                aPropValue.Value <<= m_aModuleIdentifier;
                aPropertyVector.push_back( makeAny( aPropValue ));

diff --git a/framework/source/uifactory/factoryconfiguration.cxx b/framework/source/uifactory/factoryconfiguration.cxx
index 759de8d..73fa872 100644
--- a/framework/source/uifactory/factoryconfiguration.cxx
+++ b/framework/source/uifactory/factoryconfiguration.cxx
@@ -42,7 +42,6 @@ using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::container;
using namespace ::com::sun::star::frame;

//_________________________________________________________________________________________________________________
//  Namespace
diff --git a/framework/source/uifactory/popupmenucontrollerfactory.cxx b/framework/source/uifactory/popupmenucontrollerfactory.cxx
deleted file mode 100644
index 2b47fd3..0000000
--- a/framework/source/uifactory/popupmenucontrollerfactory.cxx
+++ /dev/null
@@ -1,73 +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 .
 */

#include "uifactory/popupmenucontrollerfactory.hxx"
#include <threadhelp/resetableguard.hxx>
#include "services.h"
#include "uifactory/factoryconfiguration.hxx"

#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XContainer.hpp>

#include <rtl/ustrbuf.hxx>
#include <cppuhelper/weak.hxx>
#include <rtl/logfile.hxx>

//_________________________________________________________________________________________________________________
//  Defines
//_________________________________________________________________________________________________________________

using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::container;
using namespace ::com::sun::star::frame;

//_________________________________________________________________________________________________________________
//  Namespace
//_________________________________________________________________________________________________________________

namespace framework
{

//*****************************************************************************************************************
//  XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE  (   PopupMenuControllerFactory                      ,
                                            ::cppu::OWeakObject                             ,
                                            SERVICENAME_POPUPMENUCONTROLLERFACTORY          ,
                                            IMPLEMENTATIONNAME_POPUPMENUCONTROLLERFACTORY
                                        )

DEFINE_INIT_SERVICE                     (   PopupMenuControllerFactory, {} )

PopupMenuControllerFactory::PopupMenuControllerFactory( const Reference< XMultiServiceFactory >& xServiceManager ) :
    ToolbarControllerFactory(xServiceManager,true)
{
    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PopupMenuControllerFactory::PopupMenuControllerFactory" );
    m_pConfigAccess = new ConfigurationAccess_ControllerFactory( comphelper::getComponentContext(m_xServiceManager), OUString( "/org.openoffice.Office.UI.Controller/Registered/PopupMenu" ) );
    m_pConfigAccess->acquire();
}

} // namespace framework

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/uifactory/statusbarcontrollerfactory.cxx b/framework/source/uifactory/statusbarcontrollerfactory.cxx
deleted file mode 100644
index 3496d17..0000000
--- a/framework/source/uifactory/statusbarcontrollerfactory.cxx
+++ /dev/null
@@ -1,71 +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 .
 */

#include "uifactory/statusbarcontrollerfactory.hxx"
#include "uifactory/factoryconfiguration.hxx"
#include <threadhelp/resetableguard.hxx>
#include "services.h"

#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XContainer.hpp>

#include <rtl/ustrbuf.hxx>
#include <cppuhelper/weak.hxx>

//_________________________________________________________________________________________________________________
//  Defines
//_________________________________________________________________________________________________________________

using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::container;
using namespace ::com::sun::star::frame;

//_________________________________________________________________________________________________________________
//  Namespace
//_________________________________________________________________________________________________________________

namespace framework
{
//*****************************************************************************************************************
//  XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE  (   StatusbarControllerFactory                      ,
                                            ::cppu::OWeakObject                             ,
                                            SERVICENAME_STATUSBARCONTROLLERFACTORY          ,
                                            IMPLEMENTATIONNAME_STATUSBARCONTROLLERFACTORY
                                        )

DEFINE_INIT_SERVICE                     (   StatusbarControllerFactory, {} )

StatusbarControllerFactory::StatusbarControllerFactory( const Reference< XMultiServiceFactory >& xServiceManager ) :
    ToolbarControllerFactory(xServiceManager,true)
{
    m_pConfigAccess = new ConfigurationAccess_ControllerFactory( comphelper::getComponentContext(m_xServiceManager), OUString( "/org.openoffice.Office.UI.Controller/Registered/StatusBar" ),true );
    m_pConfigAccess->acquire();
}


} // namespace framework

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/uifactory/toolbarcontrollerfactory.cxx b/framework/source/uifactory/toolbarcontrollerfactory.cxx
deleted file mode 100644
index 592b89c..0000000
--- a/framework/source/uifactory/toolbarcontrollerfactory.cxx
+++ /dev/null
@@ -1,242 +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 .
 */

#include "uifactory/toolbarcontrollerfactory.hxx"
#include "uifactory/factoryconfiguration.hxx"
#include <threadhelp/resetableguard.hxx>
#include "services.h"

#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XContainer.hpp>

#include <rtl/ustrbuf.hxx>
#include <cppuhelper/weak.hxx>

//_________________________________________________________________________________________________________________
//  Defines
//_________________________________________________________________________________________________________________

using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::container;
using namespace ::com::sun::star::frame;

//_________________________________________________________________________________________________________________
//  Namespace
//_________________________________________________________________________________________________________________

namespace framework
{

//*****************************************************************************************************************
//  XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE  (   ToolbarControllerFactory                        ,
                                            ::cppu::OWeakObject                             ,
                                            SERVICENAME_TOOLBARCONTROLLERFACTORY            ,
                                            IMPLEMENTATIONNAME_TOOLBARCONTROLLERFACTORY
                                        )

DEFINE_INIT_SERVICE                     (   ToolbarControllerFactory, {} )

ToolbarControllerFactory::ToolbarControllerFactory( const Reference< XMultiServiceFactory >& xServiceManager ) :
    ThreadHelpBase(),
    m_bConfigRead( sal_False ),
    m_xServiceManager( xServiceManager )
{
    m_pConfigAccess = new ConfigurationAccess_ControllerFactory( comphelper::getComponentContext(m_xServiceManager), OUString( "/org.openoffice.Office.UI.Controller/Registered/ToolBar" ) );
    m_pConfigAccess->acquire();
}

ToolbarControllerFactory::ToolbarControllerFactory( const Reference< XMultiServiceFactory >& xServiceManager,bool ) :
    ThreadHelpBase(),
    m_bConfigRead( sal_False ),
    m_xServiceManager( xServiceManager )
{
    m_pConfigAccess = NULL;
}

ToolbarControllerFactory::~ToolbarControllerFactory()
{
    ResetableGuard aLock( m_aLock );

    // reduce reference count
    m_pConfigAccess->release();
}

// XMultiComponentFactory
Reference< XInterface > SAL_CALL ToolbarControllerFactory::createInstanceWithContext(
    const OUString& aServiceSpecifier,
    const Reference< XComponentContext >& )
throw (Exception, RuntimeException)
{
    // SAFE
    ResetableGuard aLock( m_aLock );

    if ( !m_bConfigRead )
    {
        m_bConfigRead = sal_True;
        m_pConfigAccess->readConfigurationData();
    }

    OUString aServiceName = m_pConfigAccess->getServiceFromCommandModule( aServiceSpecifier, OUString() );
    if ( !aServiceName.isEmpty() )
        return m_xServiceManager->createInstance( aServiceName );
    else
        return Reference< XInterface >();
    // SAFE
}

Reference< XInterface > SAL_CALL ToolbarControllerFactory::createInstanceWithArgumentsAndContext(
    const OUString&                  ServiceSpecifier,
    const Sequence< Any >&                  Arguments,
    const Reference< XComponentContext >& )
throw (Exception, RuntimeException)
{
    const OUString aPropModuleName( "ModuleName" );
    const OUString aPropValueName( "Value" );

    OUString   aPropName;
    PropertyValue   aPropValue;

    // Retrieve the optional module name form the Arguments sequence. It is used as a part of
    // the hash map key to support different controller implementation for the same URL but different
    // module!!
    for ( int i = 0; i < Arguments.getLength(); i++ )
    {
        if (( Arguments[i] >>= aPropValue ) && ( aPropValue.Name.equals( aPropModuleName )))
        {
            aPropValue.Value >>= aPropName;
            break;
        }
    }

    Sequence< Any > aNewArgs( Arguments );

    sal_Int32 nAppendIndex = aNewArgs.getLength();
    bool bHasValue = m_pConfigAccess->hasValue();
    aNewArgs.realloc( aNewArgs.getLength() + (bHasValue ? 2 : 1) );

    // Append the command URL to the Arguments sequence so that one controller can be
    // used for more than one command URL.
    aPropValue.Name     = OUString( "CommandURL" );
    aPropValue.Value  <<= ServiceSpecifier;
    aNewArgs[nAppendIndex] <<= aPropValue;

    if ( bHasValue )
    {
        // Append the optional value argument. It's an empty string if no additional info
        // is provided to the controller.
        OUString aValue = m_pConfigAccess->getValueFromCommandModule( ServiceSpecifier, aPropName );
        aPropValue.Name = aPropValueName;
        aPropValue.Value <<= aValue;
        aNewArgs[nAppendIndex+1] <<= aPropValue;
    }

    {
        // SAFE
        ResetableGuard aLock( m_aLock );

        if ( !m_bConfigRead )
        {
            m_bConfigRead = sal_True;
            m_pConfigAccess->readConfigurationData();
        }

        OUString aServiceName = m_pConfigAccess->getServiceFromCommandModule( ServiceSpecifier, aPropName );
        Reference< XMultiServiceFactory > xServiceManager( m_xServiceManager );

        aLock.unlock();
        // SAFE


        if ( !aServiceName.isEmpty() )
            return xServiceManager->createInstanceWithArguments( aServiceName, aNewArgs );
        else
            return Reference< XInterface >();
    }
}

Sequence< OUString > SAL_CALL ToolbarControllerFactory::getAvailableServiceNames()
throw (RuntimeException)
{
    return Sequence< OUString >();
}

// XUIControllerRegistration
sal_Bool SAL_CALL ToolbarControllerFactory::hasController(
    const OUString& aCommandURL,
    const OUString& aModuleName )
throw (::com::sun::star::uno::RuntimeException)
{
    ResetableGuard aLock( m_aLock );

    if ( !m_bConfigRead )
    {
        m_bConfigRead = sal_True;
        m_pConfigAccess->readConfigurationData();
    }

    return ( !m_pConfigAccess->getServiceFromCommandModule( aCommandURL, aModuleName ).isEmpty() );
}

void SAL_CALL ToolbarControllerFactory::registerController(
    const OUString& aCommandURL,
    const OUString& aModuleName,
    const OUString& aControllerImplementationName )
throw (RuntimeException)
{
    // SAFE
    ResetableGuard aLock( m_aLock );

    if ( !m_bConfigRead )
    {
        m_bConfigRead = sal_True;
        m_pConfigAccess->readConfigurationData();
    }

    m_pConfigAccess->addServiceToCommandModule( aCommandURL, aModuleName, aControllerImplementationName );
    // SAFE
}

void SAL_CALL ToolbarControllerFactory::deregisterController(
    const OUString& aCommandURL,
    const OUString& aModuleName )
throw (RuntimeException)
{
    // SAFE
    ResetableGuard aLock( m_aLock );

    if ( !m_bConfigRead )
    {
        m_bConfigRead = sal_True;
        m_pConfigAccess->readConfigurationData();
    }

    m_pConfigAccess->removeServiceFromCommandModule( aCommandURL, aModuleName );
    // SAFE
}

} // namespace framework

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 9d604c5..2e0c265 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -105,7 +105,7 @@
    <service name="com.sun.star.frame.TaskCreator"/>
  </implementation>
  <implementation name="com.sun.star.comp.framework.ToolBarControllerFactory">
    <service name="com.sun.star.frame.ToolBarControllerFactory"/>
    <service name="com.sun.star.frame.ToolbarControllerFactory"/>
  </implementation>
  <implementation name="com.sun.star.comp.framework.ToolBarFactory">
    <service name="com.sun.star.ui.ToolBarFactory"/>
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 395d541..f1e935e 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -951,6 +951,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/frame,\
	Task \
	TemplateAccess \
	ToolbarController \
	ToolbarControllerFactory \
	TransientDocumentsDocumentContentFactory \
))
$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/gallery,\
@@ -2632,7 +2633,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/frame,\
	XToolbarController \
	XToolbarControllerListener \
	XTransientDocumentsDocumentContentFactory \
	XUIControllerRegistration \
    XUIControllerFactory \
	XUntitledNumbers \
	XUrlList \
	XWindowArranger \
diff --git a/offapi/com/sun/star/frame/PopupMenuControllerFactory.idl b/offapi/com/sun/star/frame/PopupMenuControllerFactory.idl
index 03e0fd8..d873e3d 100644
--- a/offapi/com/sun/star/frame/PopupMenuControllerFactory.idl
+++ b/offapi/com/sun/star/frame/PopupMenuControllerFactory.idl
@@ -20,14 +20,11 @@
#ifndef __com_sun_star_frame_PopupMenuControllerFactory_idl__
#define __com_sun_star_frame_PopupMenuControllerFactory_idl__

#include <com/sun/star/lang/XMultiComponentFactory.idl>
#include <com/sun/star/frame/XUIControllerRegistration.idl>

#include <com/sun/star/frame/XUIControllerFactory.idl>

module com { module sun { module star { module frame {


/** specifies a factory that creates instances of registered pop-up menu controller.
/** specifies a factory that creates instances of registered popup menu controller.

    <p>
    A pop-up menu controller can be registered for a command URL and a model service name.
@@ -37,35 +34,15 @@ module com { module sun { module star { module frame {

    @since OOo 2.0
*/

service PopupMenuControllerFactory
service PopupMenuControllerFactory : XUIControllerFactory
{
    /** 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>
    /** service constructor
     */
    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;
    create();
};

}; }; }; };


#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/frame/StatusbarControllerFactory.idl b/offapi/com/sun/star/frame/StatusbarControllerFactory.idl
index 173ef5d..7572c6c 100644
--- a/offapi/com/sun/star/frame/StatusbarControllerFactory.idl
+++ b/offapi/com/sun/star/frame/StatusbarControllerFactory.idl
@@ -20,13 +20,10 @@
#ifndef __com_sun_star_frame_StatusbarControllerFactory_idl__
#define __com_sun_star_frame_StatusbarControllerFactory_idl__

#include <com/sun/star/lang/XMultiComponentFactory.idl>
#include <com/sun/star/frame/XUIControllerRegistration.idl>

#include <com/sun/star/frame/XUIControllerFactory.idl>

module com { module sun { module star { module frame {


/** specifies a factory that creates instances of registered status bar
    controller.

@@ -38,40 +35,15 @@ module com { module sun { module star { module frame {

    @since OOo 2.0
*/

service StatusbarControllerFactory
service StatusbarControllerFactory : XUIControllerFactory
{
    /** this interface provides functions to create new instances of a registered
        status bar controller.

        <p>
        Use <member scope="com.sun.star.lang">XMultiComponentFactory::createInstanceWithArguments()</member>
        to create a new status bar 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 status bar controller belongs to. This
                   property must be provided to the status bar controller, otherwise it
                   cannot dispatch its internal commands.</li>
            <li><b>ModuleIdentifier</b><br>optional string that specifies in which module
                   context the status bar controller should be created.</li>
        </ul>
        </p>
    /** service constructor
     */
    interface com::sun::star::lang::XMultiComponentFactory;

    /** provides functions to query for, register and deregister a status bar
        controller.
     */
    interface com::sun::star::frame::XUIControllerRegistration;
    create();
};

}; }; }; };


#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/frame/ToolbarControllerFactory.idl b/offapi/com/sun/star/frame/ToolbarControllerFactory.idl
new file mode 100644
index 0000000..220046e
--- /dev/null
+++ b/offapi/com/sun/star/frame/ToolbarControllerFactory.idl
@@ -0,0 +1,43 @@
/*
 * 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_ToolbarControllerFactory_idl__
#define __com_sun_star_frame_ToolbarControllerFactory_idl__

#include <com/sun/star/frame/XUIControllerFactory.idl>

module com { module sun { module star { module frame {

/** specifies a factory that creates instances of registered toolbar controller.

    <p>
    A toolbar controller can be registered for a command URL and a model service name.
    </p>

    @since OOo 2.0
*/

service ToolbarControllerFactory : XUIControllerFactory
{
    /** service constructor
     */
    create();
};

}; }; }; };

#endif
diff --git a/offapi/com/sun/star/frame/XUIControllerFactory.idl b/offapi/com/sun/star/frame/XUIControllerFactory.idl
new file mode 100644
index 0000000..ff352f5
--- /dev/null
+++ b/offapi/com/sun/star/frame/XUIControllerFactory.idl
@@ -0,0 +1,72 @@
/*
 * 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_XUIControllerFactory_idl__
#define __com_sun_star_frame_XUIControllerFactory_idl__

#include <com/sun/star/lang/XMultiComponentFactory.idl>
#include <com/sun/star/frame/XUIControllerRegistration.idl>

module com { module sun { module star { module frame {

/** a factory to create User Interface controllers.

    <p>
    A user interface controller can be registered for a command URL. A certain user
    interface controller will be created when a user interface element contains a
    registered command URL.

    @see PopupMenuControllerFactory
    @see StatusbarControllerFactory
    @see ToolbarControllerFactory
    </p>

    @since LibreOffice 4.1
 */
interface XUIControllerFactory
{
    /** this interface provides functions to create new instances of a registered UI controller.

        <p>
        Use <member scope="com::sun::star::lang">XMultiComponentFactory::createInstanceWithArgumentsAndContext()</member> to create
        a new UI 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 UI controller belongs to. This property must be provided to
                the UI controller, otherwise it cannot dispatch its internal commands.
             </li>
            <li>
                <b>ModuleIdentifier</b><br>optional string that specifies in which module context the UI
                controller should be created.</br>The module identifier can be retrieved using the
                <type>ModuleManager</type>.
            </li>
        </ul>
        </p>
     */
    interface com::sun::star::lang::XMultiComponentFactory;

    /** provides functions to query for, register and deregister a popup menu controller.
     */
    interface XUIControllerRegistration;
};

}; }; }; };

#endif
diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx
index 25e519b..d077b24 100644
--- a/svtools/source/uno/toolboxcontroller.cxx
+++ b/svtools/source/uno/toolboxcontroller.cxx
@@ -231,7 +231,7 @@ throw ( Exception, RuntimeException )
                }
                else if ( aPropValue.Name == "ParentWindow" )
                    m_pImpl->m_xParentWindow.set(aPropValue.Value,UNO_QUERY);
                else if ( aPropValue.Name == "ModuleName" )
                else if ( aPropValue.Name == "ModuleIdentifier" )
                    aPropValue.Value >>= m_pImpl->m_sModuleName;
            }
        }