Kaydet (Commit) 286a8622 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: If86cb14d107077da5f10bddd81deda7cf61442ed
üst 24d53ed0
...@@ -28,9 +28,11 @@ ...@@ -28,9 +28,11 @@
#include <com/sun/star/beans/XPropertySetInfo.hpp> #include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/sdb/XTextConnectionSettings.hpp>
#include <comphelper/componentcontext.hxx> #include <comphelper/componentcontext.hxx>
#include <svtools/genericunodialog.hxx> #include <svtools/genericunodialog.hxx>
#include <cppuhelper/implbase1.hxx>
//........................................................................ //........................................................................
namespace dbaui namespace dbaui
...@@ -58,12 +60,15 @@ namespace dbaui ...@@ -58,12 +60,15 @@ namespace dbaui
//==================================================================== //====================================================================
class OTextConnectionSettingsDialog; class OTextConnectionSettingsDialog;
typedef ODatabaseAdministrationDialog OTextConnectionSettingsDialog_BASE; typedef ::cppu::ImplInheritanceHelper1 < ODatabaseAdministrationDialog
, ::com::sun::star::sdb::XTextConnectionSettings
> OTextConnectionSettingsDialog_BASE;
typedef ::comphelper::OPropertyArrayUsageHelper< OTextConnectionSettingsDialog > OTextConnectionSettingsDialog_PBASE; typedef ::comphelper::OPropertyArrayUsageHelper< OTextConnectionSettingsDialog > OTextConnectionSettingsDialog_PBASE;
class OTextConnectionSettingsDialog class OTextConnectionSettingsDialog
:public OTextConnectionSettingsDialog_BASE :public OTextConnectionSettingsDialog_BASE
,public OTextConnectionSettingsDialog_PBASE ,public OTextConnectionSettingsDialog_PBASE
,public ::cppu::WeakImplHelper1< com::sun::star::sdb::XTextConnectionSettings >
{ {
OModuleClient m_aModuleClient; OModuleClient m_aModuleClient;
PropertyValues m_aPropertyValues; PropertyValues m_aPropertyValues;
...@@ -81,6 +86,24 @@ namespace dbaui ...@@ -81,6 +86,24 @@ namespace dbaui
virtual sal_Bool SAL_CALL convertFastPropertyValue( Any& rConvertedValue, Any& rOldValue, sal_Int32 nHandle, const Any& rValue) throw(IllegalArgumentException); virtual sal_Bool SAL_CALL convertFastPropertyValue( Any& rConvertedValue, Any& rOldValue, sal_Int32 nHandle, const Any& rValue) throw(IllegalArgumentException);
virtual void SAL_CALL getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const; virtual void SAL_CALL getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const;
// Overrides to resolve inheritance ambiguity
virtual void SAL_CALL setPropertyValue(const rtl::OUString& p1, const css::uno::Any& p2) throw (css::uno::RuntimeException)
{ ODatabaseAdministrationDialog::setPropertyValue(p1, p2); }
virtual css::uno::Any SAL_CALL getPropertyValue(const rtl::OUString& p1) throw (css::uno::RuntimeException)
{ return ODatabaseAdministrationDialog::getPropertyValue(p1); }
virtual void SAL_CALL addPropertyChangeListener(const rtl::OUString& p1, const css::uno::Reference<css::beans::XPropertyChangeListener>& p2) throw (css::uno::RuntimeException)
{ ODatabaseAdministrationDialog::addPropertyChangeListener(p1, p2); }
virtual void SAL_CALL removePropertyChangeListener(const rtl::OUString& p1, const css::uno::Reference<css::beans::XPropertyChangeListener>& p2) throw (css::uno::RuntimeException)
{ ODatabaseAdministrationDialog::removePropertyChangeListener(p1, p2); }
virtual void SAL_CALL addVetoableChangeListener(const rtl::OUString& p1, const css::uno::Reference<css::beans::XVetoableChangeListener>& p2) throw (css::uno::RuntimeException)
{ ODatabaseAdministrationDialog::addVetoableChangeListener(p1, p2); }
virtual void SAL_CALL removeVetoableChangeListener(const rtl::OUString& p1, const css::uno::Reference<css::beans::XVetoableChangeListener>& p2) throw (css::uno::RuntimeException)
{ ODatabaseAdministrationDialog::removeVetoableChangeListener(p1, p2); }
virtual void SAL_CALL setTitle(const rtl::OUString& p1) throw (css::uno::RuntimeException)
{ ODatabaseAdministrationDialog::setTitle(p1); }
virtual sal_Int16 SAL_CALL execute() throw (css::uno::RuntimeException)
{ return ODatabaseAdministrationDialog::execute(); }
protected: protected:
// OGenericUnoDialog overridables // OGenericUnoDialog overridables
virtual Dialog* createDialog( Window* _pParent ); virtual Dialog* createDialog( Window* _pParent );
......
...@@ -3138,6 +3138,7 @@ $(eval $(call gb_ZipUnoApi_add_idlfiles,offapi,offapi/com/sun/star/sdb,\ ...@@ -3138,6 +3138,7 @@ $(eval $(call gb_ZipUnoApi_add_idlfiles,offapi,offapi/com/sun/star/sdb,\
XSingleSelectQueryAnalyzer \ XSingleSelectQueryAnalyzer \
XSingleSelectQueryComposer \ XSingleSelectQueryComposer \
XSubDocument \ XSubDocument \
XTextConnectionSettings \
)) ))
$(eval $(call gb_ZipUnoApi_add_idlfiles,offapi,offapi/com/sun/star/sdb/application,\ $(eval $(call gb_ZipUnoApi_add_idlfiles,offapi,offapi/com/sun/star/sdb/application,\
CopyTableContinuation \ CopyTableContinuation \
......
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
#ifndef __com_sun_star_sdb_TextConnectionSettings_idl__ #ifndef __com_sun_star_sdb_TextConnectionSettings_idl__
#define __com_sun_star_sdb_TextConnectionSettings_idl__ #define __com_sun_star_sdb_TextConnectionSettings_idl__
#include <com/sun/star/ui/dialogs/XExecutableDialog.idl> #include <com/sun/star/sdb/XTextConnectionSettings.idl>
module com { module sun { module star { module sdb { module com { module sun { module star { module sdb {
/** /**
@since LibreOffice 4.1 @since LibreOffice 4.1
*/ */
service TextConnectionSettings : com::sun::star::ui::dialogs::XExecutableDialog; service TextConnectionSettings : XTextConnectionSettings;
}; }; }; }; }; }; }; };
......
/* -*- 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_XTextConnectionSettings_idl__
#define __com_sun_star_sdb_XTextConnectionSettings_idl__
#include <com/sun/star/ui/dialogs/XExecutableDialog.idl>
#include <com/sun/star/beans/XPropertySet.idl>
module com { module sun { module star { module sdb {
/**
@since LibreOffice 4.1
*/
interface XTextConnectionSettings {
interface com::sun::star::ui::dialogs::XExecutableDialog;
interface com::sun::star::beans::XPropertySet;
};
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -2322,14 +2322,14 @@ String SwNewDBMgr::LoadAndRegisterDataSource() ...@@ -2322,14 +2322,14 @@ String SwNewDBMgr::LoadAndRegisterDataSource()
if( bTextConnection ) if( bTextConnection )
{ {
uno::Reference < ui::dialogs::XExecutableDialog > xSettingsDlg = sdb::TextConnectionSettings::create(xContext); uno::Reference < sdb::XTextConnectionSettings > xSettingsDlg = sdb::TextConnectionSettings::create(xContext);
if( xSettingsDlg->execute() ) if( xSettingsDlg->execute() )
{ {
uno::Any aSettings = xDataProperties->getPropertyValue( "Settings" ); uno::Any aSettings = xDataProperties->getPropertyValue( "Settings" );
uno::Reference < beans::XPropertySet > xDSSettings; uno::Reference < beans::XPropertySet > xDSSettings;
aSettings >>= xDSSettings; aSettings >>= xDSSettings;
::comphelper::copyProperties( ::comphelper::copyProperties(
uno::Reference < beans::XPropertySet >( xSettingsDlg, uno::UNO_QUERY ), uno::Reference < beans::XPropertySet >( xSettingsDlg, uno::UNO_QUERY_THROW ),
xDSSettings ); xDSSettings );
xDSSettings->setPropertyValue( "Extension", uno::makeAny( ::rtl::OUString( sExt ))); xDSSettings->setPropertyValue( "Extension", uno::makeAny( ::rtl::OUString( sExt )));
} }
......
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