[Libreoffice-commits] core.git: formula/Library_for.mk formula/source formula/util include/formula
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jul 7 20:02:16 UTC 2020
formula/Library_for.mk | 1
formula/source/core/api/FormulaOpCodeMapperObj.cxx | 24 +++------
formula/source/core/api/services.cxx | 53 ---------------------
formula/util/for.component | 5 +
include/formula/FormulaOpCodeMapperObj.hxx | 6 --
5 files changed, 12 insertions(+), 77 deletions(-)
New commits:
commit 9ff8a1173a72b9ebea54ef3b00b1d632bf953e37
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Tue Jul 7 17:57:41 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jul 7 22:01:33 2020 +0200
formula: create instances with uno constructors
See tdf#74608 for motivation
Change-Id: I5983c837977e40b91df02605c1012640ffd5c650
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98291
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/formula/Library_for.mk b/formula/Library_for.mk
index d3d86a4494b5..a646b4a9598a 100644
--- a/formula/Library_for.mk
+++ b/formula/Library_for.mk
@@ -41,7 +41,6 @@ $(eval $(call gb_Library_add_exception_objects,for,\
formula/source/core/api/FormulaCompiler \
formula/source/core/api/FormulaOpCodeMapperObj \
formula/source/core/api/grammar \
- formula/source/core/api/services \
formula/source/core/api/token \
formula/source/core/api/vectortoken \
formula/source/core/resource/core_resource \
diff --git a/formula/source/core/api/FormulaOpCodeMapperObj.cxx b/formula/source/core/api/FormulaOpCodeMapperObj.cxx
index a22a1ff3d43d..a3ffe56cc8c9 100644
--- a/formula/source/core/api/FormulaOpCodeMapperObj.cxx
+++ b/formula/source/core/api/FormulaOpCodeMapperObj.cxx
@@ -81,32 +81,24 @@ SAL_CALL FormulaOpCodeMapperObj::getAvailableMappings(
}
OUString SAL_CALL FormulaOpCodeMapperObj::getImplementationName( )
-{
- return getImplementationName_Static();
-}
-
-OUString FormulaOpCodeMapperObj::getImplementationName_Static()
{
return "simple.formula.FormulaOpCodeMapperObj";
}
uno::Sequence< OUString > SAL_CALL FormulaOpCodeMapperObj::getSupportedServiceNames( )
{
- return getSupportedServiceNames_Static();
-}
-uno::Sequence< OUString > FormulaOpCodeMapperObj::getSupportedServiceNames_Static()
-{
- uno::Sequence<OUString> aSeq { "com.sun.star.sheet.FormulaOpCodeMapper" };
- return aSeq;
+ return { "com.sun.star.sheet.FormulaOpCodeMapper" };
}
-uno::Reference< uno::XInterface > FormulaOpCodeMapperObj::create(
- uno::Reference< uno::XComponentContext > const & /*_xContext*/)
+} // formula
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+simple_formula_FormulaOpCodeMapperObj(
+ css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const& )
{
- return static_cast<sheet::XFormulaOpCodeMapper*>(new FormulaOpCodeMapperObj(std::make_unique<FormulaCompiler>()));
+ return cppu::acquire(
+ new formula::FormulaOpCodeMapperObj(std::make_unique<formula::FormulaCompiler>()));
}
-} // formula
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/formula/source/core/api/services.cxx b/formula/source/core/api/services.cxx
deleted file mode 100644
index 2e885fea41cd..000000000000
--- a/formula/source/core/api/services.cxx
+++ /dev/null
@@ -1,53 +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 <sal/types.h>
-#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implementationentry.hxx>
-#include <formula/FormulaOpCodeMapperObj.hxx>
-
-/********************************************************************************************/
-
-using namespace ::formula;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::registry;
-
-
-// registry functions
-namespace
-{
-
-cppu::ImplementationEntry const entries[] = {
- { &FormulaOpCodeMapperObj::create, &FormulaOpCodeMapperObj::getImplementationName_Static, &FormulaOpCodeMapperObj::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
-}
-
-extern "C"
-{
-SAL_DLLPUBLIC_EXPORT void * for_component_getFactory(
- char const * implName, void * serviceManager, void * registryKey)
-{
- return cppu::component_getFactoryHelper(
- implName, serviceManager, registryKey, entries);
-}
-} // extern "C"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/formula/util/for.component b/formula/util/for.component
index 5b6ecef20538..f906d5174eb6 100644
--- a/formula/util/for.component
+++ b/formula/util/for.component
@@ -18,8 +18,9 @@
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
- prefix="for" xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="simple.formula.FormulaOpCodeMapperObj">
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="simple.formula.FormulaOpCodeMapperObj"
+ constructor="simple_formula_FormulaOpCodeMapperObj">
<service name="com.sun.star.sheet.FormulaOpCodeMapper"/>
</implementation>
</component>
diff --git a/include/formula/FormulaOpCodeMapperObj.hxx b/include/formula/FormulaOpCodeMapperObj.hxx
index bd0595d438d9..c7b7a400f5c9 100644
--- a/include/formula/FormulaOpCodeMapperObj.hxx
+++ b/include/formula/FormulaOpCodeMapperObj.hxx
@@ -48,12 +48,8 @@ class FORMULA_DLLPUBLIC FormulaOpCodeMapperObj : public cppu::WeakImplHelper<
css::lang::XServiceInfo >
{
::std::unique_ptr<FormulaCompiler> m_pCompiler;
-public:
- static OUString getImplementationName_Static();
- static css::uno::Sequence< OUString> getSupportedServiceNames_Static();
- static css::uno::Reference< css::uno::XInterface > create(const css::uno::Reference< css::uno::XComponentContext >& _xContext);
-protected:
+public:
FormulaOpCodeMapperObj(::std::unique_ptr<FormulaCompiler> && _pCompiler);
virtual ~FormulaOpCodeMapperObj() override;
More information about the Libreoffice-commits
mailing list