summaryrefslogtreecommitdiffstats
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-06 14:15:55 +0200
committerNoel Grandin <noel@peralex.com>2012-12-06 14:16:44 +0200
commit19854e653be1dc01f5b655fca851a6e3a651a940 (patch)
treef19e921125d72db2c132742d3d0a2ea0c66cff79 /svx
parentDrop unused declaration (diff)
downloadcore-19854e653be1dc01f5b655fca851a6e3a651a940.tar.gz
core-19854e653be1dc01f5b655fca851a6e3a651a940.zip
fdo#46808, Adapt sdb::ErrorMessageDialog UNO service to new style
Change-Id: Iaf12324e6aa64b268555b0f4c82f04f4c0f6f123
Diffstat (limited to 'svx')
-rw-r--r--svx/source/form/fmtools.cxx16
1 files changed, 4 insertions, 12 deletions
diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx
index 8a671fbf49ce..3e4553f29c2f 100644
--- a/svx/source/form/fmtools.cxx
+++ b/svx/source/form/fmtools.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/sdb/ErrorCondition.hpp>
+#include <com/sun/star/sdb/ErrorMessageDialog.hpp>
#include <com/sun/star/sdb/SQLContext.hpp>
#include <com/sun/star/sdb/XCompletedConnection.hpp>
#include <com/sun/star/sdb/XQueriesSupplier.hpp>
@@ -136,19 +137,10 @@ void displayException(const Any& _rExcept, Window* _pParent)
Window* pParentWindow = _pParent ? _pParent : GetpApp()->GetDefDialogParent();
Reference< XWindow > xParentWindow = VCLUnoHelper::GetInterface(pParentWindow);
- Sequence< Any > aArgs(2);
- aArgs[0] <<= PropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLException")), 0, _rExcept, PropertyState_DIRECT_VALUE);
- aArgs[1] <<= PropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow")), 0, makeAny(xParentWindow), PropertyState_DIRECT_VALUE);
-
- static ::rtl::OUString s_sDialogServiceName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.ErrorMessageDialog") );
- Reference< XExecutableDialog > xErrorDialog(
- ::comphelper::getProcessServiceFactory()->createInstanceWithArguments(s_sDialogServiceName, aArgs), UNO_QUERY);
- if (xErrorDialog.is())
- xErrorDialog->execute();
- else
- ShowServiceNotAvailableError(pParentWindow, s_sDialogServiceName, sal_True);
+ Reference< XExecutableDialog > xErrorDialog = ErrorMessageDialog::create(::comphelper::getProcessComponentContext(), "", xParentWindow, _rExcept);
+ xErrorDialog->execute();
}
- catch(Exception&)
+ catch(const Exception&)
{
OSL_FAIL("displayException: could not display the error message!");
}