summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-08 14:08:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-08 17:41:36 +0200
commitf3d21c378863a2a8756ded5dff6d1c18bc3c5db2 (patch)
tree241975831051aae3c61aca7276822749dfde5741
parent2e8992aea2017e89a6f7ba5f0ef544f29059243b (diff)
svx: create instances with uno constructors
See tdf#74608 for motivation Change-Id: If6bd80525d398b45c2938e921c183633f173dfae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98372 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--svx/Library_textconversiondlgs.mk1
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx18
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx10
-rw-r--r--svx/source/unodialogs/textconversiondlgs/services.cxx49
-rw-r--r--svx/util/textconversiondlgs.component4
5 files changed, 10 insertions, 72 deletions
diff --git a/svx/Library_textconversiondlgs.mk b/svx/Library_textconversiondlgs.mk
index 085b52ec3991..3c623988081a 100644
--- a/svx/Library_textconversiondlgs.mk
+++ b/svx/Library_textconversiondlgs.mk
@@ -45,7 +45,6 @@ $(eval $(call gb_Library_use_libraries,textconversiondlgs,\
))
$(eval $(call gb_Library_add_exception_objects,textconversiondlgs,\
- svx/source/unodialogs/textconversiondlgs/services \
svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog \
svx/source/unodialogs/textconversiondlgs/chinese_translationdialog \
svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog \
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
index ec3d64ed3218..fe0e3a46a78f 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
@@ -55,11 +55,6 @@ void ChineseTranslation_UnoDialog::impl_DeleteDialog()
// lang::XServiceInfo
OUString SAL_CALL ChineseTranslation_UnoDialog::getImplementationName()
{
- return getImplementationName_Static();
-}
-
-OUString ChineseTranslation_UnoDialog::getImplementationName_Static()
-{
return "com.sun.star.comp.linguistic2.ChineseTranslationDialog";
}
@@ -70,11 +65,6 @@ sal_Bool SAL_CALL ChineseTranslation_UnoDialog::supportsService( const OUString&
uno::Sequence< OUString > SAL_CALL ChineseTranslation_UnoDialog::getSupportedServiceNames()
{
- return getSupportedServiceNames_Static();
-}
-
-uno::Sequence< OUString > ChineseTranslation_UnoDialog::getSupportedServiceNames_Static()
-{
return { "com.sun.star.linguistic2.ChineseTranslationDialog" };
}
@@ -226,4 +216,12 @@ void SAL_CALL ChineseTranslation_UnoDialog::removeVetoableChangeListener( const
} //end namespace
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+svx_ChineseTranslation_UnoDialog_get_implementation(
+ css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
+{
+ return cppu::acquire(new textconversiondlgs::ChineseTranslation_UnoDialog());
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx
index d6ab96ee9af2..e31765478cf0 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx
@@ -72,16 +72,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
- static OUString getImplementationName_Static();
- static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
- /// @throws css::uno::Exception
- static css::uno::Reference< css::uno::XInterface >
- create( css::uno::Reference< css::uno::XComponentContext > const & )
- {
- return static_cast<cppu::OWeakObject *>( new ChineseTranslation_UnoDialog );
- }
-
// lang::XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
diff --git a/svx/source/unodialogs/textconversiondlgs/services.cxx b/svx/source/unodialogs/textconversiondlgs/services.cxx
deleted file mode 100644
index b0c0e9ff99a4..000000000000
--- a/svx/source/unodialogs/textconversiondlgs/services.cxx
+++ /dev/null
@@ -1,49 +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 "chinese_translation_unodialog.hxx"
-#include <cppuhelper/implementationentry.hxx>
-
-const struct ::cppu::ImplementationEntry g_entries_unodialogs_chinesetranslation[] =
-{
- {
- ::textconversiondlgs::ChineseTranslation_UnoDialog::create
- , ::textconversiondlgs::ChineseTranslation_UnoDialog::getImplementationName_Static
- , ::textconversiondlgs::ChineseTranslation_UnoDialog::getSupportedServiceNames_Static
- , ::cppu::createSingleComponentFactory
- , nullptr
- , 0
- }
- ,{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
-
-// component exports
-extern "C"
-{
-
-SAL_DLLPUBLIC_EXPORT void * textconversiondlgs_component_getFactory(
- const char * pImplName, void * pServiceManager, void * pRegistryKey )
-{
- return ::cppu::component_getFactoryHelper(
- pImplName, pServiceManager, pRegistryKey , g_entries_unodialogs_chinesetranslation );
-}
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/util/textconversiondlgs.component b/svx/util/textconversiondlgs.component
index e5c36cf824ee..81798f2dd061 100644
--- a/svx/util/textconversiondlgs.component
+++ b/svx/util/textconversiondlgs.component
@@ -18,9 +18,9 @@
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
- prefix="textconversiondlgs"
xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.linguistic2.ChineseTranslationDialog">
+ <implementation name="com.sun.star.comp.linguistic2.ChineseTranslationDialog"
+ constructor="svx_ChineseTranslation_UnoDialog_get_implementation">
<service name="com.sun.star.linguistic2.ChineseTranslationDialog"/>
</implementation>
</component>