Kaydet (Commit) 24d53ed0 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Convert sdb::TextConnectionSettings to new style

The service already existed, it just needed an IDL file

Change-Id: Ia8729e87d65e8a6deda07c102a2a71cae3ce83fd
üst e655c756
......@@ -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 \
......
/* -*- 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: */
......@@ -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" );
......
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