summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-01-03 14:39:09 +0200
committerNoel Grandin <noel@peralex.com>2013-01-09 08:08:14 +0200
commit3a50e97499d0c1ff6307dcfe9883aea1af300947 (patch)
tree24e6c2801ecfffbd649aaa7fdc47fdd4d58cd2d2
parentb498ff10d202287eabb27aa286c860cb766f8423 (diff)
fdo#46808, Adapt sdb::OrderDialog UNO service to new style
The service already existed, it just did not have an IDL file. Change-Id: If24e9d6069bf7454bb0add3be8c4bc5916cc4d1f
-rw-r--r--dbaccess/source/ui/uno/composerdialogs.cxx17
-rw-r--r--dbaccess/source/ui/uno/composerdialogs.hxx2
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx8
-rw-r--r--forms/source/runtime/formoperations.cxx21
-rw-r--r--offapi/UnoApi_offapi.mk1
-rw-r--r--offapi/com/sun/star/sdb/OrderDialog.idl49
6 files changed, 73 insertions, 25 deletions
diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx b/dbaccess/source/ui/uno/composerdialogs.cxx
index 99645b4ed8a1..008d17416b6c 100644
--- a/dbaccess/source/ui/uno/composerdialogs.cxx
+++ b/dbaccess/source/ui/uno/composerdialogs.cxx
@@ -153,6 +153,7 @@ namespace dbaui
{
if( aArguments.getLength() == 3 )
{
+ // this is the FilterDialog::createWithQuery method
Reference<com::sun::star::sdb::XSingleSelectQueryComposer> xQueryComposer;
aArguments[0] >>= xQueryComposer;
Reference<com::sun::star::sdbc::XRowSet> xRowSet;
@@ -195,6 +196,22 @@ namespace dbaui
}
//---------------------------------------------------------------------
+ void SAL_CALL RowsetOrderDialog::initialize( const Sequence< Any >& aArguments ) throw (Exception, RuntimeException)
+ {
+ if( aArguments.getLength() == 2 )
+ {
+ Reference<com::sun::star::sdb::XSingleSelectQueryComposer> xQueryComposer;
+ aArguments[0] >>= xQueryComposer;
+ Reference<com::sun::star::beans::XPropertySet> xRowSet;
+ aArguments[1] >>= xRowSet;
+ setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "QueryComposer" ) ), makeAny( xQueryComposer ) );
+ setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowSet" ) ), makeAny( xRowSet ) );
+ }
+ else
+ ComposerDialog::initialize(aArguments);
+ }
+
+ //---------------------------------------------------------------------
void RowsetOrderDialog::executedDialog( sal_Int16 _nExecutionResult )
{
ComposerDialog::executedDialog( _nExecutionResult );
diff --git a/dbaccess/source/ui/uno/composerdialogs.hxx b/dbaccess/source/ui/uno/composerdialogs.hxx
index 8dc83d00d326..618eacfd902f 100644
--- a/dbaccess/source/ui/uno/composerdialogs.hxx
+++ b/dbaccess/source/ui/uno/composerdialogs.hxx
@@ -125,6 +125,8 @@ namespace dbaui
// OGenericUnoDialog overridables
virtual void executedDialog( sal_Int16 _nExecutionResult );
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
+ throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
};
//.........................................................................
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 2a26b9e249d5..fb691d0f850f 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/form/XForm.hpp>
#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/sdb/OrderDialog.hpp>
#include <com/sun/star/sdb/FilterDialog.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
@@ -2644,12 +2645,7 @@ namespace pcr
}
else
{
- const sal_Char* pAsciiServiceName = "com.sun.star.sdb.OrderDialog";
- if ( !m_aContext.createComponent( pAsciiServiceName, xDialog ) )
- {
- ShowServiceNotAvailableError( impl_getDefaultDialogParent_nothrow(), ::rtl::OUString::createFromAscii( pAsciiServiceName ), sal_True );
- return false;
- }
+ xDialog.set( sdb::OrderDialog::createDefault(m_aContext.getUNOContext()) );
}
diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx
index 996368e70ae9..529a43ea8546 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/OrderDialog.hpp>
#include <com/sun/star/sdb/FilterDialog.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/form/XReset.hpp>
@@ -1615,25 +1616,7 @@ namespace frm
}
else
{
- 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( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.OrderDialog" ) );
- m_aContext.createComponentWithArguments( sDialogServiceName, aInit, xDialog );
- if ( !xDialog.is() )
- {
- ShowServiceNotAvailableError( NULL, sDialogServiceName, sal_True );
- return;
- }
+ xDialog = com::sun::star::sdb::OrderDialog::createWithQuery(m_aContext.getUNOContext(), m_xParser, m_xCursorProperties);
}
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 662f066e4351..61c5da08925c 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -250,6 +250,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sdb,\
ErrorMessageDialog \
InteractionHandler \
FilterDialog \
+ OrderDialog \
ReportDesign \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sdb/application,\
diff --git a/offapi/com/sun/star/sdb/OrderDialog.idl b/offapi/com/sun/star/sdb/OrderDialog.idl
new file mode 100644
index 000000000000..461fef0f966b
--- /dev/null
+++ b/offapi/com/sun/star/sdb/OrderDialog.idl
@@ -0,0 +1,49 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __com_sun_star_sdb_OrderDialog_idl__
+#define __com_sun_star_sdb_OrderDialog_idl__
+
+#include <com/sun/star/beans/XPropertySet.idl>
+#include <com/sun/star/sdb/XSingleSelectQueryComposer.idl>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.idl>
+
+
+module com { module sun { module star { module sdb {
+
+/**
+ This interface could be incomplete since I derived it from its places of use.
+
+ @since LibreOffice 4.1
+*/
+service OrderDialog : com::sun::star::ui::dialogs::XExecutableDialog
+{
+ createDefault();
+
+ createWithQuery([in] com::sun::star::sdb::XSingleSelectQueryComposer QueryComposer,
+ [in] com::sun::star::beans::XPropertySet RowSet);
+};
+
+
+}; }; }; };
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */