Kaydet (Commit) aafb4750 authored tarafından Kurt Zenker's avatar Kurt Zenker

INTEGRATION: CWS directsbasemacros_DEV300 (1.29.66); FILE MERGED

2008/03/03 22:06:53 fs 1.29.66.2: #i10000# (NamedValueCollection::getPropertyValues does not yet exist on this branch)
2008/03/03 22:03:23 fs 1.29.66.1: #i86585# pass an InteractionHandler and a MacroExecMode when loading an existing DB doc
üst 265f21bd
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: dbwizsetup.cxx,v $ * $RCSfile: dbwizsetup.cxx,v $
* *
* $Revision: 1.29 $ * $Revision: 1.30 $
* *
* last change: $Author: ihi $ $Date: 2007-11-21 17:00:03 $ * last change: $Author: kz $ $Date: 2008-03-05 16:33:46 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -162,6 +162,9 @@ ...@@ -162,6 +162,9 @@
#ifndef _COM_SUN_STAR_SDBC_XDRIVERACCESS_HPP_ #ifndef _COM_SUN_STAR_SDBC_XDRIVERACCESS_HPP_
#include <com/sun/star/sdbc/XDriverAccess.hpp> #include <com/sun/star/sdbc/XDriverAccess.hpp>
#endif #endif
#ifndef _COM_SUN_STAR_DOCUMENT_MACROEXECMODE_HPP_
#include <com/sun/star/document/MacroExecMode.hpp>
#endif
/** === end UNO includes === **/ /** === end UNO includes === **/
#ifndef _DBAUI_LINKEDDOCUMENTS_HXX_ #ifndef _DBAUI_LINKEDDOCUMENTS_HXX_
...@@ -173,6 +176,9 @@ ...@@ -173,6 +176,9 @@
#ifndef _COMPHELPER_INTERACTION_HXX_ #ifndef _COMPHELPER_INTERACTION_HXX_
#include <comphelper/interaction.hxx> #include <comphelper/interaction.hxx>
#endif #endif
#ifndef COMPHELPER_NAMEDVALUECOLLECTION_HXX
#include <comphelper/namedvaluecollection.hxx>
#endif
#ifndef _COMPHELPER_SEQUENCEASHASHMAP_HXX_ #ifndef _COMPHELPER_SEQUENCEASHASHMAP_HXX_
#include <comphelper/sequenceashashmap.hxx> #include <comphelper/sequenceashashmap.hxx>
#endif #endif
...@@ -210,6 +216,7 @@ using namespace com::sun::star::container; ...@@ -210,6 +216,7 @@ using namespace com::sun::star::container;
using namespace com::sun::star::frame; using namespace com::sun::star::frame;
using namespace com::sun::star::ucb; using namespace com::sun::star::ucb;
using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::document;
using namespace ::comphelper; using namespace ::comphelper;
using namespace ::cppu; using namespace ::cppu;
...@@ -1144,10 +1151,11 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() ...@@ -1144,10 +1151,11 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
class AsyncLoader : public AsyncLoader_Base class AsyncLoader : public AsyncLoader_Base
{ {
private: private:
Reference< XComponentLoader > m_xFrameLoader; Reference< XComponentLoader > m_xFrameLoader;
Reference< XDesktop > m_xDesktop; Reference< XDesktop > m_xDesktop;
::rtl::OUString m_sURL; Reference< XInteractionHandler > m_xInteractionHandler;
OAsyncronousLink m_aAsyncCaller; ::rtl::OUString m_sURL;
OAsyncronousLink m_aAsyncCaller;
public: public:
AsyncLoader( const Reference< XMultiServiceFactory >& _rxORB, const ::rtl::OUString& _rURL ); AsyncLoader( const Reference< XMultiServiceFactory >& _rxORB, const ::rtl::OUString& _rURL );
...@@ -1173,6 +1181,11 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() ...@@ -1173,6 +1181,11 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
{ {
m_xDesktop.set( _rxORB->createInstance( SERVICE_FRAME_DESKTOP ), UNO_QUERY_THROW ); m_xDesktop.set( _rxORB->createInstance( SERVICE_FRAME_DESKTOP ), UNO_QUERY_THROW );
m_xFrameLoader.set( m_xDesktop, UNO_QUERY_THROW ); m_xFrameLoader.set( m_xDesktop, UNO_QUERY_THROW );
m_xInteractionHandler.set(
_rxORB->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.InteractionHandler" ) )
),
UNO_QUERY_THROW );
} }
catch( const Exception& ) catch( const Exception& )
{ {
...@@ -1202,8 +1215,20 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() ...@@ -1202,8 +1215,20 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
try try
{ {
if ( m_xFrameLoader.is() ) if ( m_xFrameLoader.is() )
{
::comphelper::NamedValueCollection aLoadArgs;
aLoadArgs.put( "InteractionHandler", m_xInteractionHandler );
aLoadArgs.put( "MacroExecutionMode", MacroExecMode::USE_CONFIG );
Sequence< PropertyValue > aLoadArgPV;
aLoadArgs >>= aLoadArgPV;
m_xFrameLoader->loadComponentFromURL( m_sURL, m_xFrameLoader->loadComponentFromURL( m_sURL,
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ), FrameSearchFlag::ALL, Sequence<PropertyValue >() ); ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ),
FrameSearchFlag::ALL,
aLoadArgPV
);
}
} }
catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment