summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-01-08 18:10:34 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-01-10 10:08:09 +0100
commit8f84aa5e91a36788d3aff834729b07ff689376be (patch)
tree380518b0e0c2ba039e7714424ceca596f211c94d
parentc25fe48143b716855dfc06ffd0d65bb50b2a0cbf (diff)
svt: Use constructor feature for OAddressBookSourceDialogUno.
Change-Id: Ie046b43f40bd704090bbca4d14ea5321ff7639d9
-rwxr-xr-xsolenv/bin/native-code.py1
-rw-r--r--svtools/Library_svt.mk1
-rw-r--r--svtools/source/uno/addrtempuno.cxx70
-rw-r--r--svtools/source/uno/miscservices.cxx84
-rw-r--r--svtools/util/svt.component5
5 files changed, 26 insertions, 135 deletions
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 603a849d11b5..0936d3d9da8e 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -41,7 +41,6 @@ core_factory_list = [
("libsotlo.a", "sot_component_getFactory"),
("libspelllo.a", "spell_component_getFactory"),
("libsvllo.a", "svl_component_getFactory"),
- ("libsvtlo.a", "svt_component_getFactory"),
("libtklo.a", "tk_component_getFactory"),
("libucb1.a", "ucb_component_getFactory"),
("libucpexpand1lo.a", "ucpexpand1_component_getFactory"),
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index 47628080b2c3..4690961c25de 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -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 \
diff --git a/svtools/source/uno/addrtempuno.cxx b/svtools/source/uno/addrtempuno.cxx
index 1bea46d4ce3c..09cbba507050 100644
--- a/svtools/source/uno/addrtempuno.cxx
+++ b/svtools/source/uno/addrtempuno.cxx
@@ -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)
@@ -113,32 +94,14 @@ namespace svt
}
//-------------------------------------------------------------------------
- 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";
return aSupported;
@@ -258,8 +221,21 @@ 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,
+ uno_Sequence * arguments)
+{
+ assert(arguments != 0);
+ rtl::Reference<OAddressBookSourceDialogUno> x(new OAddressBookSourceDialogUno(context));
+ css::uno::Sequence<css::uno::Any> aArgs(
+ reinterpret_cast<css::uno::Any *>(arguments->elements),
+ arguments->nElements);
+ x->initialize(aArgs);
+ x->acquire();
+ return static_cast<cppu::OWeakObject *>(x.get());
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/miscservices.cxx b/svtools/source/uno/miscservices.cxx
deleted file mode 100644
index 2a9671941951..000000000000
--- a/svtools/source/uno/miscservices.cxx
+++ /dev/null
@@ -1,84 +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 "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: */
diff --git a/svtools/util/svt.component b/svtools/util/svt.component
index ccb0dff116d8..5e5438ef7a07 100644
--- a/svtools/util/svt.component
+++ b/svtools/util/svt.component
@@ -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"