diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-30 15:02:11 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-06-03 10:00:00 +0200 |
commit | d7fa9ca787ee0ec5d0b9f2989f547ff37791afc6 (patch) | |
tree | c00ba702812f907283af9e0ee23bcebe0db1abac /filter/source/config | |
parent | 0f627e06c93e85de02a69a225b66be430bcbea36 (diff) |
fdo#46808, Convert FrameLoaderFactory and ContentHandlerFactory to new style
by creating a common service interface for them to implement
Change-Id: Icec85c55ed0ac13a6c785fdad6b0cd9c11878ba5
Diffstat (limited to 'filter/source/config')
4 files changed, 48 insertions, 8 deletions
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 <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/frame/XLoaderFactory.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <cppuhelper/implbase1.hxx> @@ -35,7 +35,7 @@ namespace filter{ /** @short implements the service <type scope="com.sun.star.document">ContentHandlerFactory</type>. */ 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 <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/frame/XLoaderFactory.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <cppuhelper/implbase1.hxx> @@ -35,7 +35,7 @@ namespace filter{ /** @short implements the service <type scope="com.sun.star.document">FrameLoaderFactory</type>. */ 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 |