Kaydet (Commit) 0214898a authored tarafından Chris Sherlock's avatar Chris Sherlock Kaydeden (comit) Stephan Bergmann

svl: use constructor syntax in svl.component

Change-Id: I2cb78695ede4017dfc4594175268e3d3c7eb4eca
Signed-off-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 6661f6fe
......@@ -139,7 +139,6 @@ $(eval $(call gb_Library_add_exception_objects,svl,\
svl/source/svsql/converter \
svl/source/undo/undo \
svl/source/uno/pathservice \
svl/source/uno/registerservices \
))
ifeq ($(OS),WNT)
......
/* -*- 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 .
*/
#ifndef INCLUDED_SVL_SOURCE_INC_REGISTERSERVICES_HXX
#define INCLUDED_SVL_SOURCE_INC_REGISTERSERVICES_HXX
#include <sal/config.h>
#include <com/sun/star/uno/Reference.hxx>
#include <sal/types.h>
namespace com { namespace sun { namespace star {
namespace lang { class XMultiServiceFactory; }
namespace uno { class XInterface; }
} } }
css::uno::Reference<css::uno::XInterface> SAL_CALL PathService_CreateInstance(
css::uno::Reference<css::lang::XMultiServiceFactory> const &);
css::uno::Reference<css::uno::XInterface> SAL_CALL
SvNumberFormatsSupplierServiceObject_CreateInstance(
css::uno::Reference<css::lang::XMultiServiceFactory> const &);
css::uno::Reference<css::uno::XInterface> SAL_CALL
SvNumberFormatterServiceObj_CreateInstance(
css::uno::Reference<css::lang::XMultiServiceFactory> const &);
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -33,8 +33,6 @@
#include <svl/zformat.hxx>
#include <svl/itemprop.hxx>
#include <registerservices.hxx>
using namespace com::sun::star;
#define PROPERTYNAME_FMTSTR "FormatString"
......@@ -115,11 +113,6 @@ SvNumberFormatterServiceObj::~SvNumberFormatterServiceObj()
{
}
com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvNumberFormatterServiceObj_CreateInstance( SAL_UNUSED_PARAMETER const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& )
{
return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new SvNumberFormatterServiceObj );
}
// XNumberFormatter
void SAL_CALL SvNumberFormatterServiceObj::attachNumberFormatsSupplier( const uno::Reference<util::XNumberFormatsSupplier>& _xSupplier )
......@@ -1099,4 +1092,14 @@ uno::Sequence<OUString> SAL_CALL SvNumberFormatSettingsObj::getSupportedServiceN
return aRet;
}
extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
com_sun_star_uno_util_numbers_SvNumberFormatterServiceObject_get_implementation(::com::sun::star::uno::XComponentContext*,
::com::sun::star::uno::Sequence<css::uno::Any> const &)
{
return cppu::acquire(new SvNumberFormatterServiceObj());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -22,6 +22,7 @@
#include <comphelper/sharedmutex.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/weak.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <tools/debug.hxx>
#include <osl/mutex.hxx>
......@@ -29,7 +30,6 @@
#include <tools/stream.hxx>
#include <svl/instrm.hxx>
#include <registerservices.hxx>
#include <strmadpt.hxx>
using namespace ::com::sun::star::uno;
......@@ -39,10 +39,6 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::util;
using namespace ::utl;
Reference< XInterface > SAL_CALL SvNumberFormatsSupplierServiceObject_CreateInstance(const Reference< XMultiServiceFactory >& _rxFactory)
{
return static_cast< ::cppu::OWeakObject* >(new SvNumberFormatsSupplierServiceObject( comphelper::getComponentContext(_rxFactory) ));
}
SvNumberFormatsSupplierServiceObject::SvNumberFormatsSupplierServiceObject(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB)
:m_pOwnFormatter(NULL)
......@@ -169,4 +165,14 @@ void SvNumberFormatsSupplierServiceObject::implEnsureFormatter()
}
}
extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
com_sun_star_uno_util_numbers_SvNumberFormatsSupplierServiceObject_get_implementation(::com::sun::star::uno::XComponentContext* context,
::com::sun::star::uno::Sequence<css::uno::Any> const &)
{
return cppu::acquire(new SvNumberFormatsSupplierServiceObject(context));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -25,7 +25,10 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <registerservices.hxx>
extern "C" ::com::sun::star::uno::XInterface *
SAL_CALL com_sun_star_uno_util_numbers_SvNumberFormatsSupplierServiceObject_get_implementation(
::com::sun::star::uno::XComponentContext* context,
::com::sun::star::uno::Sequence<css::uno::Any> const &);
/**
* SvNumberFormatsSupplierServiceObject - a number formats supplier which
......@@ -40,9 +43,10 @@ class SvNumberFormatsSupplierServiceObject
,public ::com::sun::star::lang::XServiceInfo
{ // don't want the Set-/GetNumberFormatter to be accessible from outside
friend ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
SAL_CALL SvNumberFormatsSupplierServiceObject_CreateInstance(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
friend ::com::sun::star::uno::XInterface *
SAL_CALL com_sun_star_uno_util_numbers_SvNumberFormatsSupplierServiceObject_get_implementation(
::com::sun::star::uno::XComponentContext* context,
::com::sun::star::uno::Sequence<css::uno::Any> const &);
protected:
SvNumberFormatter* m_pOwnFormatter;
......
......@@ -26,8 +26,7 @@
#include <com/sun/star/frame/XConfigManager.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <registerservices.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
class PathService : public ::cppu::WeakImplHelper2< css::frame::XConfigManager, css::lang::XServiceInfo >
{
......@@ -81,13 +80,11 @@ public:
};
css::uno::Reference< css::uno::XInterface > PathService_CreateInstance (
SAL_UNUSED_PARAMETER const css::uno::Reference<
css::lang::XMultiServiceFactory > &)
extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
com_sun_star_comp_svl_PathService_get_implementation(::com::sun::star::uno::XComponentContext*,
::com::sun::star::uno::Sequence<css::uno::Any> const &)
{
return css::uno::Reference< css::uno::XInterface >(
static_cast< cppu::OWeakObject* >(new PathService()));
return cppu::acquire(new PathService());
}
......
/* -*- 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 <rtl/ustring.hxx>
#include <cppuhelper/factory.hxx>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <svl/svldllapi.h>
#include <registerservices.hxx>
using css::uno::Reference;
using css::uno::Sequence;
extern "C"
{
SVL_DLLPUBLIC void* SAL_CALL svl_component_getFactory (
const sal_Char * pImplementationName, void * _pServiceManager,
SAL_UNUSED_PARAMETER void * /* _pRegistryKey*/)
{
void * pResult = 0;
if ( _pServiceManager )
{
Reference< css::lang::XSingleServiceFactory > xFactory;
if (rtl_str_compare(
pImplementationName,
"com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject") == 0)
{
Sequence< OUString > aServiceNames(1);
aServiceNames.getArray()[0] =
"com.sun.star.util.NumberFormatsSupplier";
xFactory = ::cppu::createSingleFactory(
reinterpret_cast< css::lang::XMultiServiceFactory* >(_pServiceManager),
OUString::createFromAscii( pImplementationName ),
SvNumberFormatsSupplierServiceObject_CreateInstance,
aServiceNames);
}
else if (rtl_str_compare(
pImplementationName,
"com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject") == 0)
{
Sequence< OUString > aServiceNames(1);
aServiceNames.getArray()[0] = "com.sun.star.util.NumberFormatter";
xFactory = ::cppu::createSingleFactory(
reinterpret_cast< css::lang::XMultiServiceFactory* >(_pServiceManager),
OUString::createFromAscii( pImplementationName ),
SvNumberFormatterServiceObj_CreateInstance,
aServiceNames);
}
else if (rtl_str_compare (
pImplementationName, "com.sun.star.comp.svl.PathService") == 0)
{
Sequence< OUString > aServiceNames(1);
aServiceNames.getArray()[0] =
"com.sun.star.config.SpecialConfigManager";
xFactory = ::cppu::createSingleFactory (
reinterpret_cast< css::lang::XMultiServiceFactory* >( _pServiceManager ),
OUString::createFromAscii( pImplementationName ),
PathService_CreateInstance,
aServiceNames);
}
if ( xFactory.is() )
{
xFactory->acquire();
pResult = xFactory.get();
}
}
return pResult;
}
} // "C"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -19,13 +19,16 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="svl" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.svl.PathService">
<implementation name="com.sun.star.comp.svl.PathService"
constructor="com_sun_star_comp_svl_PathService_get_implementation">
<service name="com.sun.star.config.SpecialConfigManager"/>
</implementation>
<implementation name="com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject">
<implementation name="com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject"
constructor="com_sun_star_uno_util_numbers_SvNumberFormatsSupplierServiceObject_get_implementation">
<service name="com.sun.star.util.NumberFormatsSupplier"/>
</implementation>
<implementation name="com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject">
<implementation name="com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject"
constructor="com_sun_star_uno_util_numbers_SvNumberFormatterServiceObject_get_implementation">
<service name="com.sun.star.util.NumberFormatter"/>
</implementation>
</component>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment