summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-01-18 09:18:17 +0200
committerNoel Grandin <noel@peralex.com>2013-02-11 08:02:12 +0200
commitbed621572c397c7a2c6dac934801c947e45c83da (patch)
treef59fd8c762704d09138f906f21943971c3421d80
parentfdo#46808, Adapt document::XML*BasicExporter UNO services to new style (diff)
downloadcore-bed621572c397c7a2c6dac934801c947e45c83da.tar.gz
core-bed621572c397c7a2c6dac934801c947e45c83da.zip
fdo#46808, Use service constructor for awt::DialogProvider
Change-Id: I5d0a3e66afeadafa6d53ff0a255d036b7e3d528d
-rw-r--r--basic/source/classes/sbxmod.cxx11
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.cxx13
-rw-r--r--offapi/com/sun/star/awt/DialogProvider.idl13
3 files changed, 15 insertions, 22 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 33abb260f1b3..3c3ded97bc65 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -85,7 +85,7 @@ using namespace com::sun::star::script;
#include <com/sun/star/script/XLibraryContainer.hpp>
-#include <com/sun/star/awt/XDialogProvider.hpp>
+#include <com/sun/star/awt/DialogProvider.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/XControl.hpp>
@@ -2680,11 +2680,8 @@ void SbUserFormModule::InitObject()
// broadcast INITIALIZE_USERFORM script event before the dialog is created
Reference< script::vba::XVBACompatibility > xVBACompat( getVBACompatibility( m_xModel ), uno::UNO_SET_THROW );
xVBACompat->broadcastVBAScriptEvent( script::vba::VBAScriptEventId::INITIALIZE_USERFORM, GetName() );
-
uno::Reference< lang::XMultiServiceFactory > xVBAFactory( pGlobs->getUnoAny(), uno::UNO_QUERY_THROW );
- uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
- uno::Sequence< uno::Any > aArgs(1);
- aArgs[ 0 ] <<= m_xModel;
+ uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
OUString sDialogUrl( "vnd.sun.star.script:" );
OUString sProjectName( "Standard" );
@@ -2698,11 +2695,11 @@ void SbUserFormModule::InitObject()
sDialogUrl = sDialogUrl + sProjectName + "." + GetName() + "?location=document";
- uno::Reference< awt::XDialogProvider > xProvider( xFactory->createInstanceWithArguments( "com.sun.star.awt.DialogProvider", aArgs ), uno::UNO_QUERY_THROW );
+ uno::Reference< awt::XDialogProvider > xProvider = awt::DialogProvider::createWithModel( xContext, m_xModel );
m_xDialog = xProvider->createDialog( sDialogUrl );
// create vba api object
- aArgs.realloc( 4 );
+ uno::Sequence< uno::Any > aArgs(4);
aArgs[ 0 ] = uno::Any();
aArgs[ 1 ] <<= m_xDialog;
aArgs[ 2 ] <<= m_xModel;
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 42b4cfbbe2b1..45af1b04e5b9 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -60,7 +60,7 @@
#include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
#include <com/sun/star/awt/XControl.hpp>
-#include <com/sun/star/awt/XDialogProvider.hpp>
+#include <com/sun/star/awt/DialogProvider.hpp>
#include <com/sun/star/document/XGraphicObjectResolver.hpp>
@@ -401,7 +401,7 @@ static OUString sPictures( "Pictures" );
// document for anything, I believe this is a valid assumption ( as much as
// I could check anyway )
-void lcl_uglyHackToStoreDialogeEmbedImages( const Reference< XStorageBasedLibraryContainer >& xDlgCont, const Reference< XStorage >& xStorage, const Reference< XModel >& rxModel, const ::comphelper::ComponentContext& aContext ) throw ( RuntimeException )
+void lcl_uglyHackToStoreDialogeEmbedImages( const Reference< XStorageBasedLibraryContainer >& xDlgCont, const Reference< XStorage >& xStorage, const Reference< XModel >& rxModel, const Reference<XComponentContext >& rxContext ) throw ( RuntimeException )
{
Sequence< OUString > sLibraries = xDlgCont->getElementNames();
Reference< XStorage > xTmpPic = xStorage->openStorageElement( "tempPictures", ElementModes::READWRITE );
@@ -419,10 +419,7 @@ void lcl_uglyHackToStoreDialogeEmbedImages( const Reference< XStorageBasedLibrar
sal_Int32 nDialogs( sDialogs.getLength() );
for ( sal_Int32 j=0; j < nDialogs; ++j )
{
- Reference < ::com::sun::star::awt::XDialogProvider > xDlgPrv;
- Sequence< Any > aArgs(1);
- aArgs[ 0 ] <<= rxModel;
- xDlgPrv.set( aContext.createComponentWithArguments( "com.sun.star.awt.DialogProvider", aArgs), UNO_QUERY );
+ Reference < awt::XDialogProvider > xDlgPrv = awt::DialogProvider::createWithModel(rxContext, rxModel);
OUString sDialogUrl = "vnd.sun.star.script:";
sDialogUrl = sDialogUrl.concat( sLibraries[ i ] ).concat( "." ).concat ( sDialogs[ j ] ).concat( "?location=document" );
@@ -436,7 +433,7 @@ void lcl_uglyHackToStoreDialogeEmbedImages( const Reference< XStorageBasedLibrar
if ( !vEmbedImgUrls.empty() )
{
// Export the images to the storage
- Reference< XGraphicObjectResolver > xGraphicResolver = GraphicObjectResolver::createWithStorage(aContext.getUNOContext(), xTmpPic);
+ Reference< XGraphicObjectResolver > xGraphicResolver = GraphicObjectResolver::createWithStorage(rxContext, xTmpPic);
std::vector< OUString >::iterator it = vEmbedImgUrls.begin();
std::vector< OUString >::iterator it_end = vEmbedImgUrls.end();
if ( xGraphicResolver.is() )
@@ -1679,7 +1676,7 @@ void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _r
if ( xDlgs.is() )
{
Reference< XModel > xModel(const_cast< ODatabaseDocument*>(this));
- lcl_uglyHackToStoreDialogeEmbedImages( m_pImpl->getLibraryContainer(false), _rxTargetStorage, xModel, m_pImpl->m_aContext );
+ lcl_uglyHackToStoreDialogeEmbedImages( m_pImpl->getLibraryContainer(false), _rxTargetStorage, xModel, m_pImpl->m_aContext.getUNOContext() );
}
}
catch ( const Exception& )
diff --git a/offapi/com/sun/star/awt/DialogProvider.idl b/offapi/com/sun/star/awt/DialogProvider.idl
index 764519b94dce..9a578e117453 100644
--- a/offapi/com/sun/star/awt/DialogProvider.idl
+++ b/offapi/com/sun/star/awt/DialogProvider.idl
@@ -20,22 +20,21 @@
#ifndef __com_sun_star_awt_DialogProvider_idl__
#define __com_sun_star_awt_DialogProvider_idl__
-#include <com/sun/star/uno/XInterface.idl>
#include <com/sun/star/awt/XDialogProvider.idl>
+#include <com/sun/star/frame/XModel.idl>
module com { module sun { module star { module awt {
-/** specifies a provider for dialogs implementing the
+/** Sspecifies a provider for dialogs implementing the
<type scope="com::sun::star::awt">XDialog</type> interface.
*/
-service DialogProvider : com::sun::star::awt::XDialogProvider;
-
-// service DialogProvider {
- // interface com::sun::star::awt::XDialogProvider;
-// };
+service DialogProvider : com::sun::star::awt::XDialogProvider
+{
+ createWithModel([in] com::sun::star::frame::XModel Model);
+};
}; }; }; };