[Libreoffice-commits] core.git: 2 commits - sd/Library_sdd.mk sd/source sd/util

Stephan Bergmann sbergman at redhat.com
Wed Mar 11 14:37:19 PDT 2015


 sd/Library_sdd.mk                |    1 
 sd/source/ui/unoidl/detreg.cxx   |   71 ---------------------------------------
 sd/source/ui/unoidl/sddetect.cxx |   23 +++---------
 sd/source/ui/unoidl/sddetect.hxx |    8 +++-
 sd/util/sdd.component            |    5 +-
 5 files changed, 15 insertions(+), 93 deletions(-)

New commits:
commit 6661f6fee34d3c24bb9a054d5c24566c311e4a09
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 11 20:20:35 2015 +0100

    Clean up previous commit
    
    Change-Id: I380e9b9bce052e6575a77ccec2676e828683565a

diff --git a/sd/util/sdd.component b/sd/util/sdd.component
index 85d8120..c3e25b2 100644
--- a/sd/util/sdd.component
+++ b/sd/util/sdd.component
@@ -18,8 +18,8 @@
  -->
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="sdd" xmlns="http://openoffice.org/2010/uno-components">
-    <implementation name="com.sun.star.comp.draw.FormatDetector"
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="com.sun.star.comp.draw.FormatDetector"
         constructor="com_sun_star_comp_draw_FormatDetector_get_implementation">
     <service name="com.sun.star.frame.ExtendedTypeDetection"/>
   </implementation>
commit 53ca3f6f9e006b6cc584be17fe8971ffa67f5721
Author: Chris Sherlock <chris.sherlock at collabora.com>
Date:   Mon Mar 2 15:47:28 2015 +1100

    sd: use constructor syntax for sdd.component
    
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>,
    with small fix to com_sun_star_comp_draw_FormatDetector_get_implementation
    signature
    
    Change-Id: Idf42503710f2ac536c620c80f8b5e21c3704389d

diff --git a/sd/Library_sdd.mk b/sd/Library_sdd.mk
index 2726023..cfabf22 100644
--- a/sd/Library_sdd.mk
+++ b/sd/Library_sdd.mk
@@ -34,7 +34,6 @@ $(eval $(call gb_Library_use_libraries,sdd,\
 $(eval $(call gb_Library_set_componentfile,sdd,sd/util/sdd))
 
 $(eval $(call gb_Library_add_exception_objects,sdd,\
-    sd/source/ui/unoidl/detreg \
     sd/source/ui/unoidl/sddetect \
 ))
 
diff --git a/sd/source/ui/unoidl/detreg.cxx b/sd/source/ui/unoidl/detreg.cxx
deleted file mode 100644
index 791f399..0000000
--- a/sd/source/ui/unoidl/detreg.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 "sddetect.hxx"
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#include <com/sun/star/uno/Sequence.h>
-#include <rtl/ustring.hxx>
-#include "sal/types.h"
-
-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 sdd_component_getFactory(
-    const sal_Char* pImplementationName,
-    void* pServiceManager,
-    void*  )
-{
-    // 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( SdFilterDetect::impl_getStaticImplementationName().equalsAscii( pImplementationName ) )
-        {
-            xFactory = ::cppu::createSingleFactory( xServiceManager,
-            SdFilterDetect::impl_getStaticImplementationName(),
-            SdFilterDetect::impl_createInstance,
-            SdFilterDetect::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/sd/source/ui/unoidl/sddetect.cxx b/sd/source/ui/unoidl/sddetect.cxx
index 81b7da2..f2e2a71 100644
--- a/sd/source/ui/unoidl/sddetect.cxx
+++ b/sd/source/ui/unoidl/sddetect.cxx
@@ -41,7 +41,7 @@ using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::lang;
 using utl::MediaDescriptor;
 
-SdFilterDetect::SdFilterDetect( const Reference < XMultiServiceFactory >&  )
+SdFilterDetect::SdFilterDetect()
 {
 }
 
@@ -135,7 +135,7 @@ OUString SAL_CALL SdFilterDetect::detect( Sequence< beans::PropertyValue >& lDes
 // XServiceInfo
 OUString SAL_CALL SdFilterDetect::getImplementationName() throw( RuntimeException, std::exception )
 {
-    return impl_getStaticImplementationName();
+    return OUString( "com.sun.star.comp.draw.FormatDetector" );
 }
 
 // XServiceInfo
@@ -147,28 +147,17 @@ sal_Bool SAL_CALL SdFilterDetect::supportsService( const OUString& sServiceName
 // XServiceInfo
 Sequence< OUString > SAL_CALL SdFilterDetect::getSupportedServiceNames() throw( RuntimeException, std::exception )
 {
-    return impl_getStaticSupportedServiceNames();
-}
-
-// Helper for XServiceInfo
-Sequence< OUString > SdFilterDetect::impl_getStaticSupportedServiceNames()
-{
     Sequence< OUString > seqServiceNames( 1 );
     seqServiceNames.getArray() [0] = "com.sun.star.frame.ExtendedTypeDetection"  ;
     return seqServiceNames ;
 }
 
-// Helper for XServiceInfo
-OUString SdFilterDetect::impl_getStaticImplementationName()
-{
-    return OUString( "com.sun.star.comp.draw.FormatDetector" );
-}
 
-// Helper for registry
-Reference< XInterface > SAL_CALL SdFilterDetect::impl_createInstance( const Reference< XMultiServiceFactory >& xServiceManager ) throw( Exception )
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+com_sun_star_comp_draw_FormatDetector_get_implementation(::com::sun::star::uno::XComponentContext*,
+                                                         ::com::sun::star::uno::Sequence<css::uno::Any> const &)
 {
-    return static_cast< cppu::OWeakObject * >(
-        new SdFilterDetect( xServiceManager ) );
+    return cppu::acquire(new SdFilterDetect());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/unoidl/sddetect.hxx b/sd/source/ui/unoidl/sddetect.hxx
index 68eb990..13fb23d 100644
--- a/sd/source/ui/unoidl/sddetect.hxx
+++ b/sd/source/ui/unoidl/sddetect.hxx
@@ -53,10 +53,14 @@ namespace com
 class SdFilterDetect : public ::cppu::WeakImplHelper2< css::document::XExtendedFilterDetection, css::lang::XServiceInfo >
 {
 public:
-                            SdFilterDetect( const css::uno::Reference < css::lang::XMultiServiceFactory >& xFactory );
+                            SdFilterDetect();
     virtual                 ~SdFilterDetect();
 
-    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;
 
     // XExtendedFilterDetect
 
diff --git a/sd/util/sdd.component b/sd/util/sdd.component
index 9899c98..85d8120 100644
--- a/sd/util/sdd.component
+++ b/sd/util/sdd.component
@@ -19,7 +19,8 @@
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
     prefix="sdd" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="com.sun.star.comp.draw.FormatDetector">
+    <implementation name="com.sun.star.comp.draw.FormatDetector"
+        constructor="com_sun_star_comp_draw_FormatDetector_get_implementation">
     <service name="com.sun.star.frame.ExtendedTypeDetection"/>
   </implementation>
 </component>


More information about the Libreoffice-commits mailing list