Tag: cws_src680_dba23 User: oj Date: 05/02/03 05:06:48 Modified: /dba/dbaccess/source/ui/uno/ DBTypeWizDlgSetup.cxx
Log: RESYNC: (1.2-1.3); FILE MERGED File Changes: Directory: /dba/dbaccess/source/ui/uno/ ======================================= File [changed]: DBTypeWizDlgSetup.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx?r1=1.2.42.2&r2=1.2.42.3 Delta lines: +36 -4 -------------------- --- DBTypeWizDlgSetup.cxx 20 Jan 2005 16:55:09 -0000 1.2.42.2 +++ DBTypeWizDlgSetup.cxx 3 Feb 2005 13:06:45 -0000 1.2.42.3 @@ -62,6 +62,9 @@ #ifndef _DBU_REGHELPER_HXX_ #include "dbu_reghelper.hxx" #endif +#ifndef _COM_SUN_STAR_DOCUMENT_XEVENTLISTENER_HPP_ +#include <com/sun/star/document/XEventListener.hpp> +#endif #ifndef DBAUI_DBTYPEWIZDLGSETUP_HXX #include "DBTypeWizDlgSetup.hxx" #endif @@ -111,7 +114,36 @@ //------------------------------------------------------------------------- Reference< XInterface > SAL_CALL ODBTypeWizDialogSetup::Create(const Reference< XMultiServiceFactory >& _rxFactory) { - return *(new ODBTypeWizDialogSetup(_rxFactory)); + Reference < XInterface > xDBContext = _rxFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DatabaseDocument"))); + Sequence<Any> aSequence(1); + PropertyValue aPropertyValue; + Any aTmp; + aTmp <<= xDBContext; + aPropertyValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InitialSelection")); + aPropertyValue.Value = aTmp; + aSequence[0] <<= aPropertyValue; + Reference < XInterface > xDBWizard = *(new ODBTypeWizDialogSetup(_rxFactory)); + Reference < XInitialization > xDBWizardInit(xDBWizard, UNO_QUERY); + + xDBWizardInit->initialize(aSequence); + + try + { + Reference< ::com::sun::star::document::XEventListener > xDocEventBroadcaster(_rxFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster"))), + UNO_QUERY); + if ( xDocEventBroadcaster.is() ) + { + ::com::sun::star::document::EventObject aEvent(xDBContext, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnNew")) ); + xDocEventBroadcaster->notifyEvent(aEvent); + } + } + catch(Exception) + { + OSL_ENSURE(0,"Could not create GlobalEventBroadcaster!"); + } + Reference <com::sun::star::ui::dialogs::XExecutableDialog> xDBWizardExecute( xDBWizard, UNO_QUERY ); + xDBWizardExecute->execute(); + return xDBWizard; } //------------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
