summaryrefslogtreecommitdiff
path: root/xmlhelp
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2014-03-20 20:17:54 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-03-20 20:17:54 -0500
commit03a6135292f3612c291ab156896f18dd49cf70d5 (patch)
treefc04b6d56861d5c2d91b9c65cd21fb6aa4889b3f /xmlhelp
parent514a6de4822523164ef66916198e36944a826db3 (diff)
de-macroize xmlhelp ContentProvider
Change-Id: I806cd7a263dbe37581c8845b4089a76a7d591628
Diffstat (limited to 'xmlhelp')
-rw-r--r--xmlhelp/source/cxxhelp/provider/provider.cxx58
-rw-r--r--xmlhelp/source/cxxhelp/provider/provider.hxx31
2 files changed, 66 insertions, 23 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/provider.cxx b/xmlhelp/source/cxxhelp/provider/provider.cxx
index 40142c494955..bec99ce88d74 100644
--- a/xmlhelp/source/cxxhelp/provider/provider.cxx
+++ b/xmlhelp/source/cxxhelp/provider/provider.cxx
@@ -46,12 +46,11 @@ using namespace chelp;
// ContentProvider Implementation.
-ContentProvider::ContentProvider(
- const uno::Reference< uno::XComponentContext >& rxContext )
- : ::ucbhelper::ContentProviderImplHelper( rxContext ),
- isInitialized( false ),
- m_aScheme(MYUCP_URL_SCHEME),
- m_pDatabases( 0 )
+ContentProvider::ContentProvider( const uno::Reference< uno::XComponentContext >& rxContext )
+ : ::ucbhelper::ContentProviderImplHelper( rxContext )
+ , isInitialized( false )
+ , m_aScheme(MYUCP_URL_SCHEME)
+ , m_pDatabases( 0 )
{
}
@@ -90,12 +89,34 @@ css::uno::Any SAL_CALL ContentProvider::queryInterface( const css::uno::Type & r
// XTypeProvider methods.
-XTYPEPROVIDER_IMPL_5( ContentProvider,
- lang::XTypeProvider,
- lang::XServiceInfo,
- ucb::XContentProvider,
- lang::XComponent,
- container::XContainerListener);
+css::uno::Sequence< sal_Int8 > SAL_CALL ContentProvider::getImplementationId()
+ throw( css::uno::RuntimeException, std::exception )
+{
+ return css::uno::Sequence<sal_Int8>();
+}
+
+css::uno::Sequence< css::uno::Type > SAL_CALL ContentProvider::getTypes()
+ throw( css::uno::RuntimeException, std::exception )
+{
+ static cppu::OTypeCollection* pCollection = NULL;
+ if ( !pCollection )
+ {
+ osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
+ if ( !pCollection )
+ {
+ static cppu::OTypeCollection collection(
+ getCppuType( static_cast< css::uno::Reference< lang::XTypeProvider > *>(0)),
+ getCppuType( static_cast< css::uno::Reference< lang::XServiceInfo > *>(0)),
+ getCppuType( static_cast< css::uno::Reference< ucb::XContentProvider > *>(0)),
+ getCppuType( static_cast< css::uno::Reference< lang::XComponent > *>(0)),
+ getCppuType( static_cast< css::uno::Reference< container::XContainerListener > *>(0))
+ );
+ pCollection = &collection;
+ }
+ }
+ return (*pCollection).getTypes();
+}
+
// XServiceInfo methods.
@@ -150,7 +171,18 @@ ContentProvider::getSupportedServiceNames_Static()
// Service factory implementation.
-ONE_INSTANCE_SERVICE_FACTORY_IMPL( ContentProvider );
+css::uno::Reference< css::lang::XSingleServiceFactory >
+ContentProvider::createServiceFactory( const css::uno::Reference<
+ css::lang::XMultiServiceFactory >& rxServiceMgr )
+{
+ return css::uno::Reference<
+ css::lang::XSingleServiceFactory >(
+ cppu::createOneInstanceFactory(
+ rxServiceMgr,
+ ContentProvider::getImplementationName_Static(),
+ ContentProvider_CreateInstance,
+ ContentProvider::getSupportedServiceNames_Static() ) );
+}
// XContentProvider methods.
diff --git a/xmlhelp/source/cxxhelp/provider/provider.hxx b/xmlhelp/source/cxxhelp/provider/provider.hxx
index 4d7b85d764c0..a3db5a4e703f 100644
--- a/xmlhelp/source/cxxhelp/provider/provider.hxx
+++ b/xmlhelp/source/cxxhelp/provider/provider.hxx
@@ -74,16 +74,27 @@ namespace chelp {
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
throw( css::uno::RuntimeException, std::exception );
- // XServiceInfo
- XSERVICEINFO_DECL()
-
- // XContentProvider
- virtual ::com::sun::star::uno::Reference<
- ::com::sun::star::ucb::XContent > SAL_CALL
- queryContent( const ::com::sun::star::uno::Reference<
- ::com::sun::star::ucb::XContentIdentifier >& Identifier )
- throw( ::com::sun::star::ucb::IllegalIdentifierException,
- ::com::sun::star::uno::RuntimeException, std::exception );
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName()
+ throw( css::uno::RuntimeException, std::exception );
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
+ throw( css::uno::RuntimeException, std::exception );
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
+ throw( css::uno::RuntimeException,
+ std::exception );
+
+ static OUString getImplementationName_Static();
+
+ static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
+
+ static css::uno::Reference< css::lang::XSingleServiceFactory > createServiceFactory(
+ const css::uno::Reference< css::lang::XMultiServiceFactory >& rxServiceMgr );
+
+ // XContentProvider
+ virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent(
+ const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier )
+ throw( css::ucb::IllegalIdentifierException,
+ css::uno::RuntimeException, std::exception );
// Additional interfaces