diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-14 11:58:43 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-14 13:39:29 +0200 |
commit | c75a46fbd0ba4daf857fcd7d70badeed5aae8e28 (patch) | |
tree | 95d3e2945b6b7adbdd9bc5b31fc0d555c3ca818f | |
parent | 8bf8a2f3493273cb408ef86c5d971e18fa8fc40b (diff) |
fdo#46808, use DialogProvider service constructor
Change-Id: I1652be5cefd00892426cf8559cadc9605ad8d439
-rw-r--r-- | basic/source/classes/eventatt.cxx | 23 | ||||
-rw-r--r-- | offapi/com/sun/star/awt/DialogProvider.idl | 8 |
2 files changed, 16 insertions, 15 deletions
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index 7dfa94ba022e..f74bb95eb2a9 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -27,7 +27,7 @@ #include <com/sun/star/awt/XControl.hpp> #include <com/sun/star/awt/XDialog.hpp> #include <com/sun/star/awt/XWindow.hpp> -#include <com/sun/star/awt/XDialogProvider.hpp> +#include <com/sun/star/awt/DialogProvider.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/container/XNameContainer.hpp> @@ -533,24 +533,17 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit } Reference< XScriptListener > xScriptListener = new BasicScriptListener_Impl( GetSbData()->pInst->GetBasic(), xModel ); - Sequence< Any > aArgs( 4 ); - if( bDocDialog ) - { - aArgs[ 0 ] <<= xModel; - } - else - { - aArgs[ 0 ] <<= uno::Reference< uno::XInterface >(); - } - aArgs[ 1 ] <<= xInput; - aArgs[ 2 ] = aDlgLibAny; - aArgs[ 3 ] <<= xScriptListener; // Create a "living" Dialog Reference< XControl > xCntrl; try { - Reference< XDialogProvider > xDlgProv( xMSF->createInstanceWithArguments(OUString("com.sun.star.comp.scripting.DialogProvider" ), aArgs ), UNO_QUERY ); - xCntrl.set( xDlgProv->createDialog(OUString() ), UNO_QUERY_THROW ); + Reference< XDialogProvider > xDlgProv;; + if( bDocDialog ) + xDlgProv = css::awt::DialogProvider::createWithModelAndListener( xContext, xModel, xInput, aDlgLibAny, xScriptListener ); + else + xDlgProv = css::awt::DialogProvider::createWithModelAndListener( xContext, uno::Reference< frame::XModel >(), xInput, aDlgLibAny, xScriptListener ); + + xCntrl.set( xDlgProv->createDialog(OUString() ), UNO_QUERY_THROW ); // Add dialog model to dispose vector Reference< XComponent > xDlgComponent( xCntrl->getModel(), UNO_QUERY ); GetSbData()->pInst->getComponentVector().push_back( xDlgComponent ); diff --git a/offapi/com/sun/star/awt/DialogProvider.idl b/offapi/com/sun/star/awt/DialogProvider.idl index 9a578e117453..e259ad7e916c 100644 --- a/offapi/com/sun/star/awt/DialogProvider.idl +++ b/offapi/com/sun/star/awt/DialogProvider.idl @@ -22,6 +22,8 @@ #include <com/sun/star/awt/XDialogProvider.idl> #include <com/sun/star/frame/XModel.idl> +#include <com/sun/star/io/XInputStream.idl> +#include <com/sun/star/script/XScriptListener.idl> @@ -33,7 +35,13 @@ module com { module sun { module star { module awt { */ service DialogProvider : com::sun::star::awt::XDialogProvider { + createWithModel([in] com::sun::star::frame::XModel Model); + + createWithModelAndListener([in] com::sun::star::frame::XModel Model, + [in] com::sun::star::io::XInputStream InStream, + [in] any DialogLib, + [in] com::sun::star::script::XScriptListener ScriptListener); }; |