diff options
Diffstat (limited to 'forms/source/runtime/formoperations.cxx')
-rw-r--r-- | forms/source/runtime/formoperations.cxx | 46 |
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 ); |