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>
This commit is contained in:
Noel Grandin 2020-07-08 14:08:16 +02:00
parent 2e8992aea2
commit f3d21c3788
5 changed files with 10 additions and 72 deletions

View file

@ -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 \

View file

@ -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: */

View file

@ -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;

View file

@ -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: */

View file

@ -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>