[Libreoffice-commits] core.git: svx/Library_textconversiondlgs.mk svx/source svx/util

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 8 15:42:27 UTC 2020


 svx/Library_textconversiondlgs.mk                                          |    1 
 svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx |   18 +--
 svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx |   10 --
 svx/source/unodialogs/textconversiondlgs/services.cxx                      |   49 ----------
 svx/util/textconversiondlgs.component                                      |    4 
 5 files changed, 10 insertions(+), 72 deletions(-)

New commits:
commit f3d21c378863a2a8756ded5dff6d1c18bc3c5db2
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Jul 8 14:08:16 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jul 8 17:41:36 2020 +0200

    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 at collabora.co.uk>

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
@@ -54,11 +54,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";
 }
@@ -69,11 +64,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>


More information about the Libreoffice-commits mailing list