summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/inc/connectivity/dbtools.hxx2
-rw-r--r--connectivity/source/commontools/dbtools.cxx20
2 files changed, 6 insertions, 16 deletions
diff --git a/connectivity/inc/connectivity/dbtools.hxx b/connectivity/inc/connectivity/dbtools.hxx
index a3956b967a1e..fb1ff42d34d8 100644
--- a/connectivity/inc/connectivity/dbtools.hxx
+++ b/connectivity/inc/connectivity/dbtools.hxx
@@ -546,7 +546,7 @@ namespace dbtools
OOO_DLLPUBLIC_DBTOOLS
void showError( const SQLExceptionInfo& _rInfo,
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& _pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext);
/** implements <method scope="com.sun.star.sdb">XRowUpdate::updateObject</method>
<p>The object which is to be set is analyzed, and in case it is a simlpe scalar type for which there
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!");
}