summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/Library_swd.mk1
-rw-r--r--sw/source/ui/uno/detreg.cxx66
-rw-r--r--sw/source/ui/uno/swdetect.cxx9
-rw-r--r--sw/source/ui/uno/swdetect.hxx11
-rw-r--r--sw/util/swd.component3
5 files changed, 16 insertions, 74 deletions
diff --git a/sw/Library_swd.mk b/sw/Library_swd.mk
index 8657cf17704f..6396a286c509 100644
--- a/sw/Library_swd.mk
+++ b/sw/Library_swd.mk
@@ -42,7 +42,6 @@ $(eval $(call gb_Library_use_libraries,swd,\
))
$(eval $(call gb_Library_add_exception_objects,swd,\
- sw/source/ui/uno/detreg \
sw/source/ui/uno/swdetect \
))
diff --git a/sw/source/ui/uno/detreg.cxx b/sw/source/ui/uno/detreg.cxx
deleted file mode 100644
index d6d6208d8c9e..000000000000
--- a/sw/source/ui/uno/detreg.cxx
+++ /dev/null
@@ -1,66 +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 "swdetect.hxx"
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-
-extern "C" {
-
-SAL_DLLPUBLIC_EXPORT void* SAL_CALL swd_component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/ )
-{
- // Set default return value for this operation - if it failed.
- void* pReturn = NULL ;
-
- if (
- ( pImplementationName != NULL ) &&
- ( pServiceManager != NULL )
- )
- {
- // Define variables which are used in following macros.
- Reference< XSingleServiceFactory > xFactory ;
- Reference< XMultiServiceFactory > xServiceManager( reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ;
-
- if( SwFilterDetect::impl_getStaticImplementationName().equalsAscii( pImplementationName ) )
- {
- xFactory = ::cppu::createSingleFactory( xServiceManager,
- SwFilterDetect::impl_getStaticImplementationName(),
- SwFilterDetect::impl_createInstance,
- SwFilterDetect::impl_getStaticSupportedServiceNames() );
- }
-
- // Factory is valid - service was found.
- if ( xFactory.is() )
- {
- xFactory->acquire();
- pReturn = xFactory.get();
- }
- }
-
- // Return with result of this operation.
- return pReturn ;
-}
-} // extern "C"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx
index eff1d64ea0b9..ed91a6d0e9a6 100644
--- a/sw/source/ui/uno/swdetect.cxx
+++ b/sw/source/ui/uno/swdetect.cxx
@@ -34,7 +34,7 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
using utl::MediaDescriptor;
-SwFilterDetect::SwFilterDetect( const Reference < XMultiServiceFactory >& /*xFactory*/ )
+SwFilterDetect::SwFilterDetect()
{
}
@@ -144,10 +144,11 @@ OUString SwFilterDetect::impl_getStaticImplementationName()
return OUString("com.sun.star.comp.writer.FormatDetector" );
}
-/* Helper for registry */
-Reference< XInterface > SAL_CALL SwFilterDetect::impl_createInstance( const Reference< XMultiServiceFactory >& xServiceManager ) throw( Exception )
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+com_sun_star_comp_writer_FormatDetector_get_implementation(::com::sun::star::uno::XComponentContext* component,
+ ::com::sun::star::uno::Sequence<css::uno::Any> const &)
{
- return Reference< XInterface >( *new SwFilterDetect( xServiceManager ) );
+ return cppu::acquire(new SwFilterDetect());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/swdetect.hxx b/sw/source/ui/uno/swdetect.hxx
index ea28ccfffd1d..eba07537684b 100644
--- a/sw/source/ui/uno/swdetect.hxx
+++ b/sw/source/ui/uno/swdetect.hxx
@@ -58,10 +58,17 @@ class SfxFilter;
class SwFilterDetect : public ::cppu::WeakImplHelper2< css::document::XExtendedFilterDetection, css::lang::XServiceInfo >
{
public:
- SwFilterDetect( const css::uno::Reference < css::lang::XMultiServiceFactory >& xFactory );
+ SwFilterDetect();
virtual ~SwFilterDetect();
- SFX_DECL_XSERVICEINFO_NOFACTORY
+ /* XServiceInfo */
+ virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+
+ /* Helper for XServiceInfo */
+ static css::uno::Sequence< OUString > impl_getStaticSupportedServiceNames();
+ static OUString impl_getStaticImplementationName();
// XExtendedFilterDetect
virtual OUString SAL_CALL detect( css::uno::Sequence< css::beans::PropertyValue >& lDescriptor ) throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
diff --git a/sw/util/swd.component b/sw/util/swd.component
index a342f059fc25..e09b38524654 100644
--- a/sw/util/swd.component
+++ b/sw/util/swd.component
@@ -19,7 +19,8 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="swd" xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.writer.FormatDetector">
+ <implementation name="com.sun.star.comp.writer.FormatDetector"
+ constructor="com_sun_star_comp_writer_FormatDetector_get_implementation">
<service name="com.sun.star.frame.ExtendedTypeDetection"/>
<service name="com.sun.star.text.FormatDetector"/>
<service name="com.sun.star.text.W4WFormatDetector"/>