summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock@collabora.com>2015-03-05 19:57:54 +1100
committerStephan Bergmann <sbergman@redhat.com>2015-03-11 15:38:11 +0100
commit4653708b7161f0005e951e818756d804d9e44a34 (patch)
tree0d1aacbf2ecb6f9fc1e814f3e9bee59521ffcc8d /sc
parent58a48aceb289d4d9ccef4f8652d2a41a567e23e9 (diff)
sc: use constructor syntax in scd.component
Change-Id: I997701eb56ca13ff0806f7284e1634c755f06fd5 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/Library_scd.mk1
-rw-r--r--sc/source/ui/unoobj/detreg.cxx59
-rw-r--r--sc/source/ui/unoobj/exceldetect.cxx10
-rw-r--r--sc/source/ui/unoobj/exceldetect.hxx3
-rw-r--r--sc/source/ui/unoobj/scdetect.cxx8
-rw-r--r--sc/source/ui/unoobj/scdetect.hxx5
-rw-r--r--sc/util/scd.component6
7 files changed, 15 insertions, 77 deletions
diff --git a/sc/Library_scd.mk b/sc/Library_scd.mk
index 628c5c22c8af..efd1be364b90 100644
--- a/sc/Library_scd.mk
+++ b/sc/Library_scd.mk
@@ -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 \
))
diff --git a/sc/source/ui/unoobj/detreg.cxx b/sc/source/ui/unoobj/detreg.cxx
deleted file mode 100644
index cc4941a992f7..000000000000
--- a/sc/source/ui/unoobj/detreg.cxx
+++ /dev/null
@@ -1,59 +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 "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: */
diff --git a/sc/source/ui/unoobj/exceldetect.cxx b/sc/source/ui/unoobj/exceldetect.cxx
index 40ea9be37b2f..d7584ec2b5a0 100644
--- a/sc/source/ui/unoobj/exceldetect.cxx
+++ b/sc/source/ui/unoobj/exceldetect.cxx
@@ -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: */
diff --git a/sc/source/ui/unoobj/exceldetect.hxx b/sc/source/ui/unoobj/exceldetect.hxx
index df9538132fe6..ff5c57c336d6 100644
--- a/sc/source/ui/unoobj/exceldetect.hxx
+++ b/sc/source/ui/unoobj/exceldetect.hxx
@@ -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
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index 63ff9a642d44..a173ffcaf73e 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -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: */
diff --git a/sc/source/ui/unoobj/scdetect.hxx b/sc/source/ui/unoobj/scdetect.hxx
index 097e4d2febf5..52cb9cff1bc5 100644
--- a/sc/source/ui/unoobj/scdetect.hxx
+++ b/sc/source/ui/unoobj/scdetect.hxx
@@ -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 )
diff --git a/sc/util/scd.component b/sc/util/scd.component
index bf10d4f9e7c6..124ff027851a 100644
--- a/sc/util/scd.component
+++ b/sc/util/scd.component
@@ -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>