diff options
author | Noel Grandin <noel@peralex.com> | 2013-03-08 13:08:30 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-03-20 07:32:51 +0200 |
commit | 24d53ed075b9c904c6947cf3ca7096d3d4a70bce (patch) | |
tree | e38d35c5d9fb5235a260e1b1d4308acd99c3dce7 | |
parent | e655c756c48f3ba21e18eae6b705432e5dd37a08 (diff) |
fdo#46808, Convert sdb::TextConnectionSettings to new style
The service already existed, it just needed an IDL file
Change-Id: Ia8729e87d65e8a6deda07c102a2a71cae3ce83fd
-rw-r--r-- | offapi/UnoApi_offapi.mk | 1 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/TextConnectionSettings.idl | 38 | ||||
-rw-r--r-- | sw/source/ui/dbui/dbmgr.cxx | 4 |
3 files changed, 41 insertions, 2 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index d77807466d5e..fff6747e0f06 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -292,6 +292,7 @@ $(eval $(call gb_ZipUnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sdb,\ OrderDialog \ ReportDesign \ TableDefinition \ + TextConnectionSettings \ )) $(eval $(call gb_ZipUnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sdb/application,\ CopyTableWizard \ diff --git a/offapi/com/sun/star/sdb/TextConnectionSettings.idl b/offapi/com/sun/star/sdb/TextConnectionSettings.idl new file mode 100644 index 000000000000..3f422dd32a99 --- /dev/null +++ b/offapi/com/sun/star/sdb/TextConnectionSettings.idl @@ -0,0 +1,38 @@ +/* -*- 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 __com_sun_star_sdb_TextConnectionSettings_idl__ +#define __com_sun_star_sdb_TextConnectionSettings_idl__ + +#include <com/sun/star/ui/dialogs/XExecutableDialog.idl> + +module com { module sun { module star { module sdb { + +/** + @since LibreOffice 4.1 +*/ +service TextConnectionSettings : com::sun::star::ui::dialogs::XExecutableDialog; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index d10e27773c90..b6bca9d25baf 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/lang/XEventListener.hpp> #include <com/sun/star/util/NumberFormatter.hpp> #include <com/sun/star/sdb/DatabaseContext.hpp> +#include <com/sun/star/sdb/TextConnectionSettings.hpp> #include <com/sun/star/sdb/XCompletedConnection.hpp> #include <com/sun/star/sdb/XCompletedExecution.hpp> #include <com/sun/star/container/XChild.hpp> @@ -2278,7 +2279,6 @@ String SwNewDBMgr::LoadAndRegisterDataSource() #endif try { - Reference<XMultiServiceFactory> xMgr( ::comphelper::getProcessServiceFactory() ); Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); Reference<XDatabaseContext> xDBContext = DatabaseContext::create(xContext); Reference<XSingleServiceFactory> xFact( xDBContext, UNO_QUERY); @@ -2322,7 +2322,7 @@ String SwNewDBMgr::LoadAndRegisterDataSource() if( bTextConnection ) { - uno::Reference < ui::dialogs::XExecutableDialog > xSettingsDlg(xMgr->createInstance( "com.sun.star.sdb.TextConnectionSettings" ), uno::UNO_QUERY); + uno::Reference < ui::dialogs::XExecutableDialog > xSettingsDlg = sdb::TextConnectionSettings::create(xContext); if( xSettingsDlg->execute() ) { uno::Any aSettings = xDataProperties->getPropertyValue( "Settings" ); |