Kaydet (Commit) 881c3dfa authored tarafından Matúš Kukan's avatar Matúš Kukan

svt: Use constructor feature for OAddressBookSourceDialogUno.

Change-Id: Ie046b43f40bd704090bbca4d14ea5321ff7639d9
üst 67bb39e3
......@@ -36,7 +36,6 @@ core_factory_list = [
("libsfxlo.a", "sfx_component_getFactory"),
("libsotlo.a", "sot_component_getFactory"),
("libspelllo.a", "spell_component_getFactory"),
("libsvtlo.a", "svt_component_getFactory"),
("libtklo.a", "tk_component_getFactory"),
("libucb1.a", "ucb_component_getFactory"),
("libucpfile1.a", "ucpfile_component_getFactory"),
......
......@@ -230,7 +230,6 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/uno/framestatuslistener \
svtools/source/uno/generictoolboxcontroller \
svtools/source/uno/genericunodialog \
svtools/source/uno/miscservices \
svtools/source/uno/popupmenucontrollerbase \
svtools/source/uno/popupwindowcontroller \
svtools/source/uno/statusbarcontroller \
......
......@@ -17,18 +17,18 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "svtools/genericunodialog.hxx"
#include <svtools/addresstemplate.hxx>
#include <svtools/genericunodialog.hxx>
#include <comphelper/extract.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/property.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/sdbc/XDataSource.hpp>
#include <rtl/ref.hxx>
// .......................................................................
namespace svt
{
// .......................................................................
using namespace svt;
namespace {
#define UNODIALOG_PROPERTY_ID_ALIASES 100
#define UNODIALOG_PROPERTY_ALIASES "FieldMapping"
......@@ -39,24 +39,20 @@ namespace svt
using namespace com::sun::star::beans;
using namespace com::sun::star::sdbc;
//=========================================================================
//= OAddressBookSourceDialogUno
//=========================================================================
typedef OGenericUnoDialog OAddressBookSourceDialogUnoBase;
class OAddressBookSourceDialogUno
:public OAddressBookSourceDialogUnoBase
,public ::comphelper::OPropertyArrayUsageHelper< OAddressBookSourceDialogUno >
{
protected:
private:
Sequence< AliasProgrammaticPair > m_aAliases;
Reference< XDataSource > m_xDataSource;
OUString m_sDataSourceName;
OUString m_sTable;
protected:
public:
OAddressBookSourceDialogUno(const Reference< XComponentContext >& _rxORB);
public:
// XTypeProvider
virtual Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(RuntimeException);
......@@ -64,12 +60,6 @@ namespace svt
virtual OUString SAL_CALL getImplementationName() throw(RuntimeException);
virtual ::comphelper::StringSequence SAL_CALL getSupportedServiceNames() throw(RuntimeException);
// XServiceInfo - static methods
static Sequence< OUString > getSupportedServiceNames_Static(void) throw( RuntimeException );
static OUString getImplementationName_Static(void) throw( RuntimeException );
static Reference< XInterface >
SAL_CALL Create(const Reference< com::sun::star::lang::XMultiServiceFactory >&);
// XPropertySet
virtual Reference< XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(RuntimeException);
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
......@@ -88,15 +78,6 @@ namespace svt
virtual void executedDialog(sal_Int16 _nExecutionResult);
};
//=========================================================================
//= OAddressBookSourceDialogUno
//=========================================================================
Reference< XInterface > SAL_CALL OAddressBookSourceDialogUno_CreateInstance( const Reference< XMultiServiceFactory >& _rxFactory)
{
return OAddressBookSourceDialogUno::Create(_rxFactory);
}
//-------------------------------------------------------------------------
OAddressBookSourceDialogUno::OAddressBookSourceDialogUno(const Reference< XComponentContext >& _rxORB)
:OGenericUnoDialog(_rxORB)
......@@ -112,32 +93,14 @@ namespace svt
return aId.getImplementationId();
}
//-------------------------------------------------------------------------
Reference< XInterface > SAL_CALL OAddressBookSourceDialogUno::Create(const Reference< XMultiServiceFactory >& _rxFactory)
{
return *(new OAddressBookSourceDialogUno( comphelper::getComponentContext(_rxFactory)));
}
//-------------------------------------------------------------------------
OUString SAL_CALL OAddressBookSourceDialogUno::getImplementationName() throw(RuntimeException)
{
return getImplementationName_Static();
}
//-------------------------------------------------------------------------
OUString OAddressBookSourceDialogUno::getImplementationName_Static() throw(RuntimeException)
{
return OUString( "com.sun.star.comp.svtools.OAddressBookSourceDialogUno" );
}
//-------------------------------------------------------------------------
::comphelper::StringSequence SAL_CALL OAddressBookSourceDialogUno::getSupportedServiceNames() throw(RuntimeException)
{
return getSupportedServiceNames_Static();
}
//-------------------------------------------------------------------------
::comphelper::StringSequence OAddressBookSourceDialogUno::getSupportedServiceNames_Static() throw(RuntimeException)
{
::comphelper::StringSequence aSupported(1);
aSupported.getArray()[0] = "com.sun.star.ui.AddressBookSourceDialog";
......@@ -258,8 +221,16 @@ namespace svt
return new AddressBookSourceDialog( _pParent, m_aContext );
}
// .......................................................................
} // namespace svt
// .......................................................................
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_svtools_OAddressBookSourceDialogUno_get_implementation(
css::uno::XComponentContext * context,
css::uno::Sequence<css::uno::Any> const &)
{
rtl::Reference<OAddressBookSourceDialogUno> x(new OAddressBookSourceDialogUno(context));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 <cppuhelper/weak.hxx>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <osl/diagnose.h>
#include <uno/mapping.hxx>
#include "hatchwindow.hxx"
#include "comphelper/servicedecl.hxx"
#include "cppuhelper/implementationentry.hxx"
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::registry;
using namespace ::com::sun::star::lang;
// for CreateInstance functions implemented elsewhere, while the function is within a namespace
#define DECLARE_CREATEINSTANCE_NAMESPACE( nmspe, ImplName ) \
namespace nmspe { \
Reference< XInterface > SAL_CALL ImplName##_CreateInstance( const Reference< XMultiServiceFactory >& ); \
}
DECLARE_CREATEINSTANCE_NAMESPACE( svt, OAddressBookSourceDialogUno )
extern "C"
{
SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory (
const sal_Char * pImplementationName, void * _pServiceManager, void * )
{
void * pResult = 0;
if ( _pServiceManager )
{
Reference< XMultiServiceFactory > xSMgr(reinterpret_cast< XMultiServiceFactory * >( _pServiceManager ) );
Reference< XSingleServiceFactory > xFactory;
if (rtl_str_compare (
pImplementationName, "com.sun.star.comp.svtools.OAddressBookSourceDialogUno") == 0)
{
Sequence< OUString > aServiceNames(1);
aServiceNames.getArray()[0] =
OUString( "com.sun.star.ui.AddressBookSourceDialog" );
xFactory = ::cppu::createSingleFactory (xSMgr,
OUString::createFromAscii( pImplementationName ),
svt::OAddressBookSourceDialogUno_CreateInstance,
aServiceNames);
}
if ( xFactory.is() )
{
xFactory->acquire();
pResult = xFactory.get();
}
}
return pResult;
}
} // "C"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -18,7 +18,7 @@
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="svt" xmlns="http://openoffice.org/2010/uno-components">
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.graphic.GraphicProvider"
constructor="com_sun_star_comp_graphic_GraphicProvider_get_implementation">
<service name="com.sun.star.graphic.GraphicProvider"/>
......@@ -27,7 +27,8 @@
constructor="com_sun_star_comp_graphic_GraphicRendererVCL_get_implementation">
<service name="com.sun.star.graphic.GraphicRendererVCL"/>
</implementation>
<implementation name="com.sun.star.comp.svtools.OAddressBookSourceDialogUno">
<implementation name="com.sun.star.comp.svtools.OAddressBookSourceDialogUno"
constructor="com_sun_star_comp_svtools_OAddressBookSourceDialogUno_get_implementation">
<service name="com.sun.star.ui.AddressBookSourceDialog"/>
</implementation>
<implementation name="com.sun.star.comp.svtools.uno.Wizard"
......
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