summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-12 17:18:33 +0200
committerNoel Grandin <noel@peralex.com>2012-12-21 09:12:09 +0200
commit6e5cb64670936ec86067c48b96e6b51715b6f18c (patch)
treeef7c622316248b87b8011c0867983c9a204ae956 /forms
parentec6843f51f38903b16750752e50dc0b05023edab (diff)
fdo#46808, Adapt sdb::FilterDialog UNO service to new style
The service already existed, it just did not have an IDL file. Change-Id: I2267bec182ad1cc8f6a37939861a7368a17fcef2
Diffstat (limited to 'forms')
-rw-r--r--forms/source/runtime/formoperations.cxx46
1 files changed, 25 insertions, 21 deletions
diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx
index 6ba363ee5eb9..996368e70ae9 100644
--- a/forms/source/runtime/formoperations.cxx
+++ b/forms/source/runtime/formoperations.cxx
@@ -37,6 +37,7 @@
#include <com/sun/star/form/XConfirmDeleteListener.hpp>
#include <com/sun/star/sdb/RowChangeEvent.hpp>
#include <com/sun/star/sdb/RowChangeAction.hpp>
+#include <com/sun/star/sdb/FilterDialog.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/form/XReset.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
@@ -1606,33 +1607,36 @@ namespace frm
return;
try
{
- PropertyValue aFirst;
- aFirst.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "QueryComposer" ) );
- aFirst.Value <<= m_xParser;
-
- PropertyValue aSecond;
- aSecond.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowSet" ) );
- aSecond.Value <<= m_xCursorProperties;
-
- Sequence<Any> aInit(2);
- aInit[0] <<= aFirst;
- aInit[1] <<= aSecond;
-
- ::rtl::OUString sDialogServiceName;
+ Reference< XExecutableDialog> xDialog;
if ( _bFilter )
- sDialogServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.FilterDialog" ) );
+ {
+ xDialog = com::sun::star::sdb::FilterDialog::createWithQuery(m_aContext.getUNOContext(), m_xParser, m_xCursor,
+ Reference<com::sun::star::awt::XWindow>());
+ }
else
- sDialogServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.OrderDialog" ) );
+ {
+ PropertyValue aFirst;
+ aFirst.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "QueryComposer" ) );
+ aFirst.Value <<= m_xParser;
- Reference< XExecutableDialog> xDialog;
- m_aContext.createComponentWithArguments( sDialogServiceName, aInit, xDialog );
+ PropertyValue aSecond;
+ aSecond.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowSet" ) );
+ aSecond.Value <<= m_xCursorProperties;
- if ( !xDialog.is() )
- {
- ShowServiceNotAvailableError( NULL, sDialogServiceName, sal_True );
- return;
+ Sequence<Any> aInit(2);
+ aInit[0] <<= aFirst;
+ aInit[1] <<= aSecond;
+
+ ::rtl::OUString sDialogServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.OrderDialog" ) );
+ m_aContext.createComponentWithArguments( sDialogServiceName, aInit, xDialog );
+ if ( !xDialog.is() )
+ {
+ ShowServiceNotAvailableError( NULL, sDialogServiceName, sal_True );
+ return;
+ }
}
+
if ( RET_OK == xDialog->execute() )
{
WaitObject aWO( NULL );