diff options
author | Noel Grandin <noel@peralex.com> | 2012-12-06 14:15:55 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2012-12-06 14:16:44 +0200 |
commit | 19854e653be1dc01f5b655fca851a6e3a651a940 (patch) | |
tree | f19e921125d72db2c132742d3d0a2ea0c66cff79 /connectivity/source/commontools | |
parent | 8909b2c384154baa2174aa53b433b12b02871e75 (diff) |
fdo#46808, Adapt sdb::ErrorMessageDialog UNO service to new style
Change-Id: Iaf12324e6aa64b268555b0f4c82f04f4c0f6f123
Diffstat (limited to 'connectivity/source/commontools')
-rw-r--r-- | connectivity/source/commontools/dbtools.cxx | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index a5420fcc6ea1..a33e4a47529f 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -33,6 +33,7 @@ #include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/BooleanComparisonMode.hpp> #include <com/sun/star/sdb/CommandType.hpp> +#include <com/sun/star/sdb/ErrorMessageDialog.hpp> #include <com/sun/star/sdb/ParametersRequest.hpp> #include <com/sun/star/sdb/RowSetVetoException.hpp> #include <com/sun/star/sdb/SQLContext.hpp> @@ -1479,27 +1480,16 @@ sal_Int32 getSearchColumnFlag( const Reference< XConnection>& _rxConn,sal_Int32 // ----------------------------------------------------------------------------- void showError(const SQLExceptionInfo& _rInfo, const Reference< XWindow>& _xParent, - const Reference< XMultiServiceFactory >& _xFactory) + const Reference< XComponentContext >& _rxContext) { if (_rInfo.isValid()) { try { - Sequence< Any > aArgs(2); - aArgs[0] <<= PropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLException")), 0, _rInfo.get(), PropertyState_DIRECT_VALUE); - aArgs[1] <<= PropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow")), 0, makeAny(_xParent), PropertyState_DIRECT_VALUE); - - static ::rtl::OUString s_sDialogServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.ErrorMessageDialog" )); - Reference< XExecutableDialog > xErrorDialog( - _xFactory->createInstanceWithArguments(s_sDialogServiceName, aArgs), UNO_QUERY); - if (xErrorDialog.is()) - xErrorDialog->execute(); - else - { - OSL_FAIL("dbtools::showError: no XExecutableDialog found!"); - } + Reference< XExecutableDialog > xErrorDialog = ErrorMessageDialog::create( _rxContext, "", _xParent, _rInfo.get() ); + xErrorDialog->execute(); } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("showError: could not display the error message!"); } |