From 6e5cb64670936ec86067c48b96e6b51715b6f18c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 12 Dec 2012 17:18:33 +0200 Subject: 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 --- forms/source/runtime/formoperations.cxx | 46 ++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 21 deletions(-) (limited to 'forms/source/runtime') 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 #include #include +#include #include #include #include @@ -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 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()); + } 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 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 ); -- cgit v1.2.3