fdo#46808, use DialogProvider service constructor
Change-Id: I1652be5cefd00892426cf8559cadc9605ad8d439
This commit is contained in:
@@ -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 );
|
||||
|
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user