diff options
author | Noel Grandin <noel@peralex.com> | 2012-12-12 17:18:33 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2012-12-21 09:12:09 +0200 |
commit | 6e5cb64670936ec86067c48b96e6b51715b6f18c (patch) | |
tree | ef7c622316248b87b8011c0867983c9a204ae956 /sw/source | |
parent | ec6843f51f38903b16750752e50dc0b05023edab (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 'sw/source')
-rw-r--r-- | sw/source/ui/dbui/addresslistdialog.cxx | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 0617035de165..03f80d7c1295 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -40,6 +40,7 @@ #include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/XCompletedConnection.hpp> #include <com/sun/star/sdb/CommandType.hpp> +#include <com/sun/star/sdb/FilterDialog.hpp> #include <com/sun/star/sdb/XDocumentDataSource.hpp> #include <com/sun/star/sdbc/XRowSet.hpp> #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> @@ -290,8 +291,6 @@ IMPL_LINK_NOARG(SwAddressListDialog, FilterHdl_Impl) uno::Reference<XSingleSelectQueryComposer> xComposer( xConnectFactory->createInstance(C2U("com.sun.star.sdb.SingleSelectQueryComposer")), UNO_QUERY_THROW); - PropertyValue aSecond; - aSecond.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowSet" ) ); uno::Reference<XRowSet> xRowSet( xMgr->createInstance(C2U("com.sun.star.sdb.RowSet")), UNO_QUERY); uno::Reference<XPropertySet> xRowProperties(xRowSet, UNO_QUERY); @@ -302,24 +301,15 @@ IMPL_LINK_NOARG(SwAddressListDialog, FilterHdl_Impl) xRowProperties->setPropertyValue(C2U("CommandType"), makeAny(pUserData->nCommandType)); xRowProperties->setPropertyValue(C2U("ActiveConnection"), makeAny(pUserData->xConnection.getTyped())); xRowSet->execute(); - aSecond.Value <<= xRowSet; - PropertyValue aFirst; - aFirst.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "QueryComposer" ) ); ::rtl::OUString sQuery; xRowProperties->getPropertyValue(C2U("ActiveCommand"))>>= sQuery; xComposer->setQuery(sQuery); if(!pUserData->sFilter.isEmpty()) xComposer->setFilter(pUserData->sFilter); - aFirst.Value <<= xComposer; - uno::Sequence<Any> aInit(2); - aInit[0] <<= aFirst; - aInit[1] <<= aSecond; - - ::rtl::OUString sDialogServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.FilterDialog" ) ); - uno::Reference< XExecutableDialog> xDialog( - xMgr->createInstanceWithArguments( sDialogServiceName, aInit ), UNO_QUERY); + uno::Reference< XExecutableDialog> xDialog = sdb::FilterDialog::createWithQuery( comphelper::getComponentContext(xMgr), + xComposer,xRowSet, uno::Reference<awt::XWindow>() ); if ( RET_OK == xDialog->execute() ) { |