Kaydet (Commit) 4653708b authored tarafından Chris Sherlock's avatar Chris Sherlock Kaydeden (comit) Stephan Bergmann

sc: use constructor syntax in scd.component

Change-Id: I997701eb56ca13ff0806f7284e1634c755f06fd5
Signed-off-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 58a48ace
......@@ -33,7 +33,6 @@ $(eval $(call gb_Library_use_libraries,scd,\
))
$(eval $(call gb_Library_add_exception_objects,scd,\
sc/source/ui/unoobj/detreg \
sc/source/ui/unoobj/scdetect \
sc/source/ui/unoobj/exceldetect \
))
......
/* -*- 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 "scdetect.hxx"
#include "exceldetect.hxx"
#include <cppuhelper/implementationentry.hxx>
namespace {
static const cppu::ImplementationEntry spServices[] =
{
{
ScFilterDetect::impl_createInstance,
ScFilterDetect::impl_getStaticImplementationName,
ScFilterDetect::impl_getStaticSupportedServiceNames,
cppu::createSingleComponentFactory,
0, 0
},
{
ScExcelBiffDetect::impl_createInstance,
ScExcelBiffDetect::impl_getStaticImplementationName,
ScExcelBiffDetect::impl_getStaticSupportedServiceNames,
cppu::createSingleComponentFactory,
0, 0
},
{ 0, 0, 0, 0, 0, 0 }
};
}
extern "C" {
SAL_DLLPUBLIC_EXPORT void* SAL_CALL scd_component_getFactory(
const char* pImplName, void* pServiceManager, void* pRegistryKey )
{
return ::cppu::component_getFactoryHelper(pImplName, pServiceManager, pRegistryKey, spServices);
}
} // extern "C"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -204,11 +204,13 @@ OUString ScExcelBiffDetect::impl_getStaticImplementationName()
return OUString("com.sun.star.comp.calc.ExcelBiffFormatDetector");
}
uno::Reference<uno::XInterface> ScExcelBiffDetect::impl_createInstance(
const uno::Reference<uno::XComponentContext>& xContext )
throw (com::sun::star::uno::Exception)
extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
com_sun_star_comp_calc_ExcelBiffFormatDetector_get_implementation(::com::sun::star::uno::XComponentContext* context,
::com::sun::star::uno::Sequence<css::uno::Any> const &)
{
return static_cast<cppu::OWeakObject*>(new ScExcelBiffDetect(xContext));
return cppu::acquire(new ScExcelBiffDetect(context));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -36,9 +36,6 @@ public:
static com::sun::star::uno::Sequence<OUString> impl_getStaticSupportedServiceNames();
static OUString impl_getStaticImplementationName();
static com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
impl_createInstance( const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>& xContext )
throw (com::sun::star::uno::Exception);
};
#endif
......
......@@ -340,10 +340,12 @@ OUString ScFilterDetect::impl_getStaticImplementationName()
return OUString("com.sun.star.comp.calc.FormatDetector");
}
uno::Reference<uno::XInterface> ScFilterDetect::impl_createInstance(
const uno::Reference<uno::XComponentContext>& xContext ) throw (uno::Exception)
extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
com_sun_star_comp_calc_FormatDetector_get_implementation(::com::sun::star::uno::XComponentContext* context,
::com::sun::star::uno::Sequence<css::uno::Any> const &)
{
return static_cast<cppu::OWeakObject*>(new ScFilterDetect(xContext));
return cppu::acquire(new ScFilterDetect(context));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -51,11 +51,6 @@ public:
static com::sun::star::uno::Sequence<OUString> impl_getStaticSupportedServiceNames();
static OUString impl_getStaticImplementationName();
/* Helper for registry */
static com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
impl_createInstance( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xContext )
throw (com::sun::star::uno::Exception);
// XExtendedFilterDetect
virtual OUString SAL_CALL detect( com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& lDescriptor )
......
......@@ -19,10 +19,12 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="scd" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.calc.FormatDetector">
<implementation name="com.sun.star.comp.calc.FormatDetector"
constructor="com_sun_star_comp_calc_FormatDetector_get_implementation">
<service name="com.sun.star.frame.ExtendedTypeDetection"/>
</implementation>
<implementation name="com.sun.star.comp.calc.ExcelBiffFormatDetector">
<implementation name="com.sun.star.comp.calc.ExcelBiffFormatDetector"
constructor="com_sun_star_comp_calc_ExcelBiffFormatDetector_get_implementation">
<service name="com.sun.star.frame.ExtendedTypeDetection"/>
</implementation>
</component>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment