summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-03-19 10:52:27 +0200
committerNoel Grandin <noel@peralex.com>2013-03-20 07:32:51 +0200
commit286a86221b0b666fb9c54ffc30fdf1fd99a1316d (patch)
tree9f5b292c981bfca0be9b4e79770fbf51bae87e13
parent24d53ed075b9c904c6947cf3ca7096d3d4a70bce (diff)
fdo#46808, Convert sdb::TextConnectionSettings to new style
The service already existed, it just needed an IDL file Change-Id: If86cb14d107077da5f10bddd81deda7cf61442ed
-rw-r--r--dbaccess/source/ui/uno/textconnectionsettings_uno.cxx25
-rw-r--r--offapi/UnoApi_offapi.mk1
-rw-r--r--offapi/com/sun/star/sdb/TextConnectionSettings.idl4
-rw-r--r--offapi/com/sun/star/sdb/XTextConnectionSettings.idl44
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx4
5 files changed, 73 insertions, 5 deletions
diff --git a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx
index 5cc0b6ac5d47..1db5b7a12460 100644
--- a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx
+++ b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx
@@ -28,9 +28,11 @@
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/sdb/XTextConnectionSettings.hpp>
#include <comphelper/componentcontext.hxx>
#include <svtools/genericunodialog.hxx>
+#include <cppuhelper/implbase1.hxx>
//........................................................................
namespace dbaui
@@ -58,12 +60,15 @@ namespace dbaui
//====================================================================
class OTextConnectionSettingsDialog;
- typedef ODatabaseAdministrationDialog OTextConnectionSettingsDialog_BASE;
+ typedef ::cppu::ImplInheritanceHelper1 < ODatabaseAdministrationDialog
+ , ::com::sun::star::sdb::XTextConnectionSettings
+ > OTextConnectionSettingsDialog_BASE;
typedef ::comphelper::OPropertyArrayUsageHelper< OTextConnectionSettingsDialog > OTextConnectionSettingsDialog_PBASE;
class OTextConnectionSettingsDialog
:public OTextConnectionSettingsDialog_BASE
,public OTextConnectionSettingsDialog_PBASE
+ ,public ::cppu::WeakImplHelper1< com::sun::star::sdb::XTextConnectionSettings >
{
OModuleClient m_aModuleClient;
PropertyValues m_aPropertyValues;
@@ -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 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:
// OGenericUnoDialog overridables
virtual Dialog* createDialog( Window* _pParent );
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index fff6747e0f06..ed4a01f35061 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -3138,6 +3138,7 @@ $(eval $(call gb_ZipUnoApi_add_idlfiles,offapi,offapi/com/sun/star/sdb,\
XSingleSelectQueryAnalyzer \
XSingleSelectQueryComposer \
XSubDocument \
+ XTextConnectionSettings \
))
$(eval $(call gb_ZipUnoApi_add_idlfiles,offapi,offapi/com/sun/star/sdb/application,\
CopyTableContinuation \
diff --git a/offapi/com/sun/star/sdb/TextConnectionSettings.idl b/offapi/com/sun/star/sdb/TextConnectionSettings.idl
index 3f422dd32a99..fecb15005e64 100644
--- a/offapi/com/sun/star/sdb/TextConnectionSettings.idl
+++ b/offapi/com/sun/star/sdb/TextConnectionSettings.idl
@@ -21,14 +21,14 @@
#ifndef __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 {
/**
@since LibreOffice 4.1
*/
-service TextConnectionSettings : com::sun::star::ui::dialogs::XExecutableDialog;
+service TextConnectionSettings : XTextConnectionSettings;
}; }; }; };
diff --git a/offapi/com/sun/star/sdb/XTextConnectionSettings.idl b/offapi/com/sun/star/sdb/XTextConnectionSettings.idl
new file mode 100644
index 000000000000..89645ec0fc15
--- /dev/null
+++ b/offapi/com/sun/star/sdb/XTextConnectionSettings.idl
@@ -0,0 +1,44 @@
+/* -*- 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: */
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index b6bca9d25baf..7279ef1163a7 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -2322,14 +2322,14 @@ String SwNewDBMgr::LoadAndRegisterDataSource()
if( bTextConnection )
{
- uno::Reference < ui::dialogs::XExecutableDialog > xSettingsDlg = sdb::TextConnectionSettings::create(xContext);
+ uno::Reference < sdb::XTextConnectionSettings > xSettingsDlg = sdb::TextConnectionSettings::create(xContext);
if( xSettingsDlg->execute() )
{
uno::Any aSettings = xDataProperties->getPropertyValue( "Settings" );
uno::Reference < beans::XPropertySet > xDSSettings;
aSettings >>= xDSSettings;
::comphelper::copyProperties(
- uno::Reference < beans::XPropertySet >( xSettingsDlg, uno::UNO_QUERY ),
+ uno::Reference < beans::XPropertySet >( xSettingsDlg, uno::UNO_QUERY_THROW ),
xDSSettings );
xDSSettings->setPropertyValue( "Extension", uno::makeAny( ::rtl::OUString( sExt )));
}