summaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-07-12 20:12:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-13 08:47:58 +0200
commitcea25cb5eda6bcef6c74c735a2c38dea57191a1b (patch)
tree65ad40ae6565827dd6b5d8ad937461091e211711 /filter
parenttdf#134646 Remove "nearest paper matching" feature (diff)
downloadcore-cea25cb5eda6bcef6c74c735a2c38dea57191a1b.tar.gz
core-cea25cb5eda6bcef6c74c735a2c38dea57191a1b.zip
filter/msfilter: create instances with uno constructors
See tdf#74608 for motivation. Change-Id: I7bc7e89699173966406272138301a4ca2422281d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98609 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/Library_msfilter.mk1
-rw-r--r--filter/source/msfilter/msfilter.component5
-rw-r--r--filter/source/msfilter/msvbahelper.cxx27
-rw-r--r--filter/source/msfilter/services.cxx43
4 files changed, 13 insertions, 63 deletions
diff --git a/filter/Library_msfilter.mk b/filter/Library_msfilter.mk
index b15e548f522a..22c765f20d78 100644
--- a/filter/Library_msfilter.mk
+++ b/filter/Library_msfilter.mk
@@ -63,7 +63,6 @@ $(eval $(call gb_Library_add_exception_objects,msfilter,\
filter/source/msfilter/msoleexp \
filter/source/msfilter/mstoolbar \
filter/source/msfilter/msvbahelper \
- filter/source/msfilter/services \
filter/source/msfilter/svdfppt \
filter/source/msfilter/svxmsbas2 \
filter/source/msfilter/rtfutil \
diff --git a/filter/source/msfilter/msfilter.component b/filter/source/msfilter/msfilter.component
index 11691436550e..0e1a35ee4a83 100644
--- a/filter/source/msfilter/msfilter.component
+++ b/filter/source/msfilter/msfilter.component
@@ -18,8 +18,9 @@
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
- prefix="msfilter" xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.vba.VBAMacroResolver">
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.vba.VBAMacroResolver"
+ constructor="filter_VBAMacroResolver_get_implementation">
<service name="com.sun.star.script.vba.VBAMacroResolver"/>
</implementation>
</component>
diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx
index 8c44140397b1..0a3b27204299 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -501,21 +501,6 @@ bool executeMacro( SfxObjectShell* pShell, const OUString& sMacroName, uno::Sequ
}
-uno::Sequence< OUString > VBAMacroResolver_getSupportedServiceNames()
-{
- return { "com.sun.star.script.vba.VBAMacroResolver" };
-}
-
-OUString VBAMacroResolver_getImplementationName()
-{
- return "com.sun.star.comp.vba.VBAMacroResolver";
-}
-
-uno::Reference< uno::XInterface > VBAMacroResolver_createInstance( const uno::Reference< uno::XComponentContext >& )
-{
- return static_cast< ::cppu::OWeakObject* >( new VBAMacroResolver );
-}
-
VBAMacroResolver::VBAMacroResolver() :
mpObjShell( nullptr )
@@ -530,7 +515,7 @@ VBAMacroResolver::~VBAMacroResolver()
OUString SAL_CALL VBAMacroResolver::getImplementationName()
{
- return VBAMacroResolver_getImplementationName();
+ return "com.sun.star.comp.vba.VBAMacroResolver";
}
sal_Bool SAL_CALL VBAMacroResolver::supportsService( const OUString& rService )
@@ -540,7 +525,7 @@ sal_Bool SAL_CALL VBAMacroResolver::supportsService( const OUString& rService )
uno::Sequence< OUString > SAL_CALL VBAMacroResolver::getSupportedServiceNames()
{
- return VBAMacroResolver_getSupportedServiceNames();
+ return { "com.sun.star.script.vba.VBAMacroResolver" };
}
// com.sun.star.lang.XInitialization interface --------------------------------
@@ -775,5 +760,13 @@ void applyShortCutKeyBinding ( const uno::Reference< frame::XModel >& rxModel, c
} // namespace ooo
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+filter_VBAMacroResolver_get_implementation(
+ css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
+{
+ return cppu::acquire(new ooo::vba::VBAMacroResolver());
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/msfilter/services.cxx b/filter/source/msfilter/services.cxx
deleted file mode 100644
index 086a394d2b87..000000000000
--- a/filter/source/msfilter/services.cxx
+++ /dev/null
@@ -1,43 +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 <cppuhelper/implementationentry.hxx>
-#include <filter/msfilter/msvbahelper.hxx>
-
-using namespace ::com::sun::star::uno;
-using namespace ::ooo::vba;
-
-namespace {
-
-::cppu::ImplementationEntry const spServices[] =
-{
- { VBAMacroResolver_createInstance, VBAMacroResolver_getImplementationName,
- VBAMacroResolver_getSupportedServiceNames,
- ::cppu::createSingleComponentFactory, nullptr, 0 },
- { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
-
-} // namespace
-
-extern "C" SAL_DLLPUBLIC_EXPORT void* msfilter_component_getFactory( const char* pImplName, void* pServiceManager, void* pRegistryKey )
-{
- return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */