diff --git a/filter/source/config/cache/contenthandlerfactory.cxx b/filter/source/config/cache/contenthandlerfactory.cxx
index a2b251bed7d8..0a61c3e742ef 100644
--- a/filter/source/config/cache/contenthandlerfactory.cxx
+++ b/filter/source/config/cache/contenthandlerfactory.cxx
@@ -89,7 +89,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL ContentHandlerFactory::crea
lQuery[0].Name = PROPNAME_TYPES;
lQuery[0].Value <<= lTypes;
- css::uno::Reference< css::container::XEnumeration > xSet = createSubSetEnumerationByProperties(lQuery);
+ css::uno::Reference< css::container::XEnumeration > xSet = BaseContainer::createSubSetEnumerationByProperties(lQuery);
while(xSet->hasMoreElements())
{
::comphelper::SequenceAsHashMap lHandlerProps(xSet->nextElement());
@@ -143,7 +143,7 @@ css::uno::Sequence< OUString > SAL_CALL ContentHandlerFactory::getAvailableServi
throw(css::uno::RuntimeException)
{
// must be the same list as ((XNameAccess*)this)->getElementNames() return!
- return getElementNames();
+ return BaseContainer::getElementNames();
}
diff --git a/filter/source/config/cache/contenthandlerfactory.hxx b/filter/source/config/cache/contenthandlerfactory.hxx
index d2c0f9a2a7f4..22ed773898ef 100644
--- a/filter/source/config/cache/contenthandlerfactory.hxx
+++ b/filter/source/config/cache/contenthandlerfactory.hxx
@@ -21,7 +21,7 @@
#define __FILTER_CONFIG_CONTENTHANDLERFACTORY_HXX_
#include "basecontainer.hxx"
-#include
+#include
#include
#include
@@ -35,7 +35,7 @@ namespace filter{
/** @short implements the service ContentHandlerFactory.
*/
class ContentHandlerFactory : public ::cppu::ImplInheritanceHelper1< BaseContainer ,
- css::lang::XMultiServiceFactory >
+ css::frame::XLoaderFactory >
{
//-------------------------------------------
// native interface
@@ -125,6 +125,27 @@ class ContentHandlerFactory : public ::cppu::ImplInheritanceHelper1< BaseContain
@return The new instance of this service as an uno reference.
*/
static css::uno::Reference< css::uno::XInterface > impl_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
+
+
+ // Overrides to resolve ambiguity
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+ { return BaseContainer::getByName(aName); }
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() throw (::com::sun::star::uno::RuntimeException)
+ { return BaseContainer::getElementNames(); }
+ virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException)
+ { return BaseContainer::hasByName(aName); }
+
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw (::com::sun::star::uno::RuntimeException)
+ { return BaseContainer::getElementType(); }
+ virtual ::sal_Bool SAL_CALL hasElements() throw (::com::sun::star::uno::RuntimeException)
+ { return BaseContainer::hasElements(); }
+
+ virtual ::com::sun::star::uno::Reference< css::container::XEnumeration > SAL_CALL createSubSetEnumerationByQuery( const ::rtl::OUString& Query ) throw (::com::sun::star::uno::RuntimeException)
+ { return BaseContainer::createSubSetEnumerationByQuery(Query); }
+ virtual ::com::sun::star::uno::Reference< css::container::XEnumeration > SAL_CALL createSubSetEnumerationByProperties( const ::com::sun::star::uno::Sequence< css::beans::NamedValue >& Properties ) throw (::com::sun::star::uno::RuntimeException)
+ { return BaseContainer::createSubSetEnumerationByProperties(Properties); }
+
+
};
} // namespace config
diff --git a/filter/source/config/cache/frameloaderfactory.cxx b/filter/source/config/cache/frameloaderfactory.cxx
index 7ded4936dc3b..63f3a92a02dc 100644
--- a/filter/source/config/cache/frameloaderfactory.cxx
+++ b/filter/source/config/cache/frameloaderfactory.cxx
@@ -86,7 +86,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL FrameLoaderFactory::createI
lQuery[0].Name = PROPNAME_TYPES;
lQuery[0].Value <<= lTypes;
- css::uno::Reference< css::container::XEnumeration > xSet = createSubSetEnumerationByProperties(lQuery);
+ css::uno::Reference< css::container::XEnumeration > xSet = BaseContainer::createSubSetEnumerationByProperties(lQuery);
while(xSet->hasMoreElements())
{
::comphelper::SequenceAsHashMap lLoaderProps(xSet->nextElement());
@@ -140,7 +140,7 @@ css::uno::Sequence< OUString > SAL_CALL FrameLoaderFactory::getAvailableServiceN
throw(css::uno::RuntimeException)
{
// must be the same list as ((XNameAccess*)this)->getElementNames() return!
- return getElementNames();
+ return BaseContainer::getElementNames();
}
diff --git a/filter/source/config/cache/frameloaderfactory.hxx b/filter/source/config/cache/frameloaderfactory.hxx
index fb2e32f21214..96623511aa6f 100644
--- a/filter/source/config/cache/frameloaderfactory.hxx
+++ b/filter/source/config/cache/frameloaderfactory.hxx
@@ -21,7 +21,7 @@
#define __FILTER_CONFIG_FRAMELOADERFACTORY_HXX_
#include "basecontainer.hxx"
-#include
+#include
#include
#include
@@ -35,7 +35,7 @@ namespace filter{
/** @short implements the service FrameLoaderFactory.
*/
class FrameLoaderFactory : public ::cppu::ImplInheritanceHelper1< BaseContainer ,
- css::lang::XMultiServiceFactory >
+ css::frame::XLoaderFactory >
{
//-------------------------------------------
// native interface
@@ -125,6 +125,25 @@ class FrameLoaderFactory : public ::cppu::ImplInheritanceHelper1< BaseContainer
@return The new instance of this service as an uno reference.
*/
static css::uno::Reference< css::uno::XInterface > impl_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
+
+ // Overrides to resolve ambiguity
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+ { return BaseContainer::getByName(aName); }
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() throw (::com::sun::star::uno::RuntimeException)
+ { return BaseContainer::getElementNames(); }
+ virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException)
+ { return BaseContainer::hasByName(aName); }
+
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw (::com::sun::star::uno::RuntimeException)
+ { return BaseContainer::getElementType(); }
+ virtual ::sal_Bool SAL_CALL hasElements() throw (::com::sun::star::uno::RuntimeException)
+ { return BaseContainer::hasElements(); }
+
+ virtual ::com::sun::star::uno::Reference< css::container::XEnumeration > SAL_CALL createSubSetEnumerationByQuery( const ::rtl::OUString& Query ) throw (::com::sun::star::uno::RuntimeException)
+ { return BaseContainer::createSubSetEnumerationByQuery(Query); }
+ virtual ::com::sun::star::uno::Reference< css::container::XEnumeration > SAL_CALL createSubSetEnumerationByProperties( const ::com::sun::star::uno::Sequence< css::beans::NamedValue >& Properties ) throw (::com::sun::star::uno::RuntimeException)
+ { return BaseContainer::createSubSetEnumerationByProperties(Properties); }
+
};
} // namespace config
diff --git a/framework/inc/services.h b/framework/inc/services.h
index 6b35bf2da568..f59f952c0692 100644
--- a/framework/inc/services.h
+++ b/framework/inc/services.h
@@ -28,13 +28,11 @@ namespace framework{
// used servicenames by framework
//_________________________________________________________________________________________________________________
-#define SERVICENAME_FRAMELOADERFACTORY DECLARE_ASCII("com.sun.star.frame.FrameLoaderFactory" )
#define SERVICENAME_FILTERFACTORY DECLARE_ASCII("com.sun.star.document.FilterFactory" )
#define SERVICENAME_TYPEDETECTION DECLARE_ASCII("com.sun.star.document.TypeDetection" )
#define SERVICENAME_CFGUPDATEACCESS DECLARE_ASCII("com.sun.star.configuration.ConfigurationUpdateAccess") // provides read/write access to the configuration
#define SERVICENAME_CFGREADACCESS DECLARE_ASCII("com.sun.star.configuration.ConfigurationAccess" ) // provides readonly access to the configuration
#define SERVICENAME_CONTENTHANDLER DECLARE_ASCII("com.sun.star.frame.ContentHandler" )
-#define SERVICENAME_CONTENTHANDLERFACTORY DECLARE_ASCII("com.sun.star.frame.ContentHandlerFactory" )
#define SERVICENAME_JOB DECLARE_ASCII("com.sun.star.task.Job" )
#define SERVICENAME_PROTOCOLHANDLER DECLARE_ASCII("com.sun.star.frame.ProtocolHandler" )
#define SERVICENAME_POPUPMENUCONTROLLERFACTORY DECLARE_ASCII("com.sun.star.frame.PopupMenuControllerFactory" )
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 577973677b33..ef4272219417 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -36,40 +36,42 @@
#include
#include "officecfg/Office/Common.hxx"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
#include
#include
#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
#include
#include
#include
#include
#include
#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
#include
-#include
-#include
+#include
+#include
+#include
#include
#include
-#include
-#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
#include
#include
@@ -644,7 +646,7 @@ LoadEnv::EContentType LoadEnv::classifyContent(const OUString&
OUString sType = xDetect->queryTypeByURL(sURL);
css::uno::Sequence< css::beans::NamedValue > lQuery(1) ;
- css::uno::Reference< css::container::XContainerQuery > xContainer ;
+ css::uno::Reference< css::frame::XLoaderFactory > xLoaderFactory;
css::uno::Reference< css::container::XEnumeration > xSet ;
css::uno::Sequence< OUString > lTypesReg(1);
@@ -669,10 +671,8 @@ LoadEnv::EContentType LoadEnv::classifyContent(const OUString&
lQuery[0].Name = sPROP_TYPES;
lQuery[0].Value <<= lTypesReg;
- xContainer = css::uno::Reference< css::container::XContainerQuery >(
- xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_FRAMELOADERFACTORY, xContext),
- css::uno::UNO_QUERY);
- xSet = xContainer->createSubSetEnumerationByProperties(lQuery);
+ xLoaderFactory = css::frame::FrameLoaderFactory::create(xContext);
+ xSet = xLoaderFactory->createSubSetEnumerationByProperties(lQuery);
// at least one registered frame loader is enough!
if (xSet->hasMoreElements())
return E_CAN_BE_LOADED;
@@ -686,10 +686,8 @@ LoadEnv::EContentType LoadEnv::classifyContent(const OUString&
lQuery[0].Name = sPROP_TYPES;
lQuery[0].Value <<= lTypesReg;
- xContainer = css::uno::Reference< css::container::XContainerQuery >(
- xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_CONTENTHANDLERFACTORY, xContext),
- css::uno::UNO_QUERY);
- xSet = xContainer->createSubSetEnumerationByProperties(lQuery);
+ xLoaderFactory = css::frame::ContentHandlerFactory::create(xContext);
+ xSet = xLoaderFactory->createSubSetEnumerationByProperties(lQuery);
// at least one registered content handler is enough!
if (xSet->hasMoreElements())
return E_CAN_BE_HANDLED;
@@ -911,9 +909,7 @@ sal_Bool LoadEnv::impl_handleContent()
css::util::URL aURL = m_aURL;
// get necessary container to query for a handler object
- css::uno::Reference< css::lang::XMultiServiceFactory > xFactory(m_xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_CONTENTHANDLERFACTORY, m_xContext), css::uno::UNO_QUERY);
-
- css::uno::Reference< css::container::XContainerQuery > xQuery (xFactory , css::uno::UNO_QUERY);
+ css::uno::Reference< css::frame::XLoaderFactory > xLoaderFactory = css::frame::ContentHandlerFactory::create(m_xContext);
aReadLock.unlock();
// <- SAFE -----------------------------------
@@ -928,7 +924,7 @@ sal_Bool LoadEnv::impl_handleContent()
OUString sPROP_NAME(PROP_NAME);
- css::uno::Reference< css::container::XEnumeration > xSet = xQuery->createSubSetEnumerationByProperties(lQuery);
+ css::uno::Reference< css::container::XEnumeration > xSet = xLoaderFactory->createSubSetEnumerationByProperties(lQuery);
while(xSet->hasMoreElements())
{
::comphelper::SequenceAsHashMap lProps (xSet->nextElement());
@@ -937,7 +933,7 @@ sal_Bool LoadEnv::impl_handleContent()
css::uno::Reference< css::frame::XNotifyingDispatch > xHandler;
try
{
- xHandler = css::uno::Reference< css::frame::XNotifyingDispatch >(xFactory->createInstance(sHandler), css::uno::UNO_QUERY);
+ xHandler = css::uno::Reference< css::frame::XNotifyingDispatch >(xLoaderFactory->createInstance(sHandler), css::uno::UNO_QUERY);
if (!xHandler.is())
continue;
}
@@ -1212,8 +1208,7 @@ css::uno::Reference< css::uno::XInterface > LoadEnv::impl_searchLoader()
throw LoadEnvException(LoadEnvException::ID_INVALID_MEDIADESCRIPTOR);
// try to locate any interested frame loader
- css::uno::Reference< css::lang::XMultiServiceFactory > xLoaderFactory(m_xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_FRAMELOADERFACTORY, m_xContext), css::uno::UNO_QUERY);
- css::uno::Reference< css::container::XContainerQuery > xQuery (xLoaderFactory , css::uno::UNO_QUERY);
+ css::uno::Reference< css::frame::XLoaderFactory > xLoaderFactory = css::frame::FrameLoaderFactory::create(m_xContext);
aReadLock.unlock();
// <- SAFE -----------------------------------
@@ -1227,7 +1222,7 @@ css::uno::Reference< css::uno::XInterface > LoadEnv::impl_searchLoader()
OUString sPROP_NAME(PROP_NAME);
- css::uno::Reference< css::container::XEnumeration > xSet = xQuery->createSubSetEnumerationByProperties(lQuery);
+ css::uno::Reference< css::container::XEnumeration > xSet = xLoaderFactory->createSubSetEnumerationByProperties(lQuery);
while(xSet->hasMoreElements())
{
// try everyone ...
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index fc572896fe0f..4c1e9974d0b9 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -189,12 +189,14 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/frame,\
AutoRecovery \
AppDispatchProvider \
Bibliography \
+ ContentHandlerFactory \
Desktop \
DispatchHelper \
DispatchRecorder \
DispatchRecorderSupplier \
DocumentTemplates \
Frame \
+ FrameLoaderFactory \
GlobalEventBroadcaster \
LayoutManager \
MediaTypeDetectionHelper \
@@ -935,14 +937,12 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/formula
$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/frame,\
Components \
ContentHandler \
- ContentHandlerFactory \
Controller \
DesktopTask \
DesktopTasks \
DispatchProvider \
FrameControl \
FrameLoader \
- FrameLoaderFactory \
FramesContainer \
PopupMenuController \
PopupMenuControllerFactory \
@@ -2607,6 +2607,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/frame,\
XLayoutManagerListener \
XLoadEventListener \
XLoadable \
+ XLoaderFactory \
XMenuBarAcceptor \
XMenuBarMergingAcceptor \
XModel \
diff --git a/offapi/com/sun/star/frame/ContentHandlerFactory.idl b/offapi/com/sun/star/frame/ContentHandlerFactory.idl
index 4702ed3a022b..e3411714b862 100644
--- a/offapi/com/sun/star/frame/ContentHandlerFactory.idl
+++ b/offapi/com/sun/star/frame/ContentHandlerFactory.idl
@@ -19,9 +19,7 @@
#ifndef __com_sun_star_frame_ContentHandlerFactory_idl__
#define __com_sun_star_frame_ContentHandlerFactory_idl__
-#include
-#include
-#include
+#include
module com { module sun { module star { module frame {
@@ -37,51 +35,7 @@ module com { module sun { module star { module frame {
*/
-published service ContentHandlerFactory
-{
- /** interface to create handler objects by using his internal name
-
-
- Returned objects must support the service specification of a ContentHandler.
- They can be created by using of his internal name, which must be unambiguous everytime, only.
- To get this name use further specified interfaces of this factory for access on
- the flat configuration.
-
- */
- interface com::sun::star::lang::XMultiServiceFactory;
-
- /** provides access to the whole content handler configuration
-
-
- This interface supports an access to the internal configuration
- of all accessible handler objects. The return value of
- XNameAccess::getByName() is a property sequence
- packed in an any.
-
-
-
- Types |
- [string] |
- file types for which handler is registered |
-
-
- UIName |
- [string] |
- UI representable and localized name |
-
-
- */
- interface com::sun::star::container::XNameAccess;
-
- /** supports query mode for configuration access
-
-
- This interface can be used to get sub sets of current configuration entries
- which represent given search parameters.
-
- */
- interface com::sun::star::container::XContainerQuery;
-};
+published service ContentHandlerFactory : XLoaderFactory;
}; }; }; };
diff --git a/offapi/com/sun/star/frame/FrameLoaderFactory.idl b/offapi/com/sun/star/frame/FrameLoaderFactory.idl
index 3a095b6f6950..6efe90694baf 100644
--- a/offapi/com/sun/star/frame/FrameLoaderFactory.idl
+++ b/offapi/com/sun/star/frame/FrameLoaderFactory.idl
@@ -19,9 +19,7 @@
#ifndef __com_sun_star_frame_FrameLoaderFactory_idl__
#define __com_sun_star_frame_FrameLoaderFactory_idl__
-#include
-#include
-#include
+#include
module com { module sun { module star { module frame {
@@ -37,50 +35,7 @@ module com { module sun { module star { module frame {
*/
-published service FrameLoaderFactory
-{
- /** interface to create loader objects by using his internal name
-
-
- Returned objects must support the service specification of a FrameLoader
- or SynchronousFrameLoader. (Note: last one will be preferred if both ones
- are available)
- They can be created by using of his internal name, which must be unambiguous everytime, only.
- To get this name use further specified interfaces of this factory for access on
- the flat configuration.
-
- */
- interface com::sun::star::lang::XMultiServiceFactory;
-
- /** provides access to the whole frame loader configuration
-
- This interface supports an access to the internal configuration of all accessible loader objects.
- The return value of XNameAccess::getByName()
- is a property sequence packed in an any.
-
-
- Types |
- [string] |
- file types which loader is registered for |
-
-
- UIName |
- [string] |
- UI representable and localized name |
-
-
- */
- interface com::sun::star::container::XNameAccess;
-
- /** supports query mode for configuration access
-
-
- This interface can be used to get sub sets of current configuration entries
- which represent given search parameters.
-
- */
- interface com::sun::star::container::XContainerQuery;
-};
+published service FrameLoaderFactory : XLoaderFactory;
}; }; }; };
diff --git a/offapi/com/sun/star/frame/XLoaderFactory.idl b/offapi/com/sun/star/frame/XLoaderFactory.idl
new file mode 100644
index 000000000000..31248418e029
--- /dev/null
+++ b/offapi/com/sun/star/frame/XLoaderFactory.idl
@@ -0,0 +1,86 @@
+/* -*- 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_XLoaderFactory_idl__
+#define __com_sun_star_frame_XLoaderFactory_idl__
+
+#include
+#include
+#include
+
+
+
+ module com { module sun { module star { module frame {
+
+/**
+ Unified service interface for FrameLoaderFactory and ContentHandlerFactory.
+
+ @since LibreOffice 4.2
+ */
+published interface XLoaderFactory
+{
+ /** interface to create loader objects by using his internal name
+
+
+ Returned objects must support the service specification of a FrameLoader
+ or SynchronousFrameLoader. (Note: last one will be preferred if both ones
+ are available)
+ They can be created by using of his internal name, which must be unambiguous everytime, only.
+ To get this name use further specified interfaces of this factory for access on
+ the flat configuration.
+
+ */
+ interface com::sun::star::lang::XMultiServiceFactory;
+
+ /** provides access to the whole frame loader configuration
+
+ This interface supports an access to the internal configuration of all accessible loader objects.
+ The return value of XNameAccess::getByName()
+ is a property sequence packed in an any.
+
+
+ Types |
+ [string] |
+ file types which loader is registered for |
+
+
+ UIName |
+ [string] |
+ UI representable and localized name |
+
+
+ */
+ interface com::sun::star::container::XNameAccess;
+
+ /** supports query mode for configuration access
+
+
+ This interface can be used to get sub sets of current configuration entries
+ which represent given search parameters.
+
+ */
+ interface com::sun::star::container::XContainerQuery;
+
+};
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/type_reference/offapi.rdb b/offapi/type_reference/offapi.rdb
index 88226211f543..33c46854a483 100644
Binary files a/offapi/type_reference/offapi.rdb and b/offapi/type_reference/offapi.rdb differ