Tag: cws_dev300_odbmacros3 User: fs Date: 2008-07-23 10:08:40+0000 Modified: dba/dbaccess/source/filter/xml/dbloader2.cxx
Log: #i76128# don't notify document events - this is the document's own responsibility File Changes: Directory: /dba/dbaccess/source/filter/xml/ =========================================== File [changed]: dbloader2.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/filter/xml/dbloader2.cxx?r1=1.32.28.5&r2=1.32.28.6 Delta lines: +11 -33 --------------------- --- dbloader2.cxx 2008-07-01 07:39:32+0000 1.32.28.5 +++ dbloader2.cxx 2008-07-23 10:08:37+0000 1.32.28.6 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dbloader2.cxx,v $ - * $Revision: 1.32.28.5 $ + * $Revision: 1.32.28.6 $ * * This file is part of OpenOffice.org. * @@ -62,6 +62,7 @@ #include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/sdb/application/DatabaseObjectContainer.hpp> #include <com/sun/star/sdb/application/NamedDatabaseObject.hpp> +#include <com/sun/star/frame/XLoadable.hpp> /** === end UNO includes === **/ #include <comphelper/componentcontext.hxx> @@ -484,7 +485,11 @@ try { aMediaDesc.put( "FileName", _rURL ); - xModel->attachResource( _rURL, aMediaDesc.getPropertyValues() ); + Reference< XLoadable > xLoad( xModel, UNO_QUERY_THROW ); + + Sequence< PropertyValue > aResource( aMediaDesc.getPropertyValues() ); + xLoad->load( aResource ); + xModel->attachResource( _rURL, aResource ); } catch(const Exception&) { @@ -521,40 +526,13 @@ { try { - Reference< css::container::XSet > xModelCollection; + Reference< XSet > xModelCollection; if ( m_aContext.createComponent( "com.sun.star.frame.GlobalEventBroadcaster", xModelCollection ) ) - xModelCollection->insert(css::uno::makeAny(xModel)); - - Reference< css::document::XEventListener > xDocEventBroadcaster(xModel,UNO_QUERY_THROW); - css::document::EventObject aEvent; - aEvent.Source = xModel; - ::std::vector< ::rtl::OUString > aEvents; - if ( bCreateNew ) - { - aEvents.push_back(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnCreate"))); - aEvents.push_back(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnNew"))); // UI event - } - else - { - aEvents.push_back(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnLoadFinished"))); - aEvents.push_back(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnLoad"))); // UI event - } - - std::vector< rtl::OUString >::iterator aIter = aEvents.begin(); - const std::vector< rtl::OUString >::iterator aEnd = aEvents.end(); - for (; aIter != aEnd; ++aIter) - { - aEvent.EventName = *aIter; - xDocEventBroadcaster->notifyEvent(aEvent); - } - - aEvent.EventName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnViewCreated")); - Reference< css::document::XEventListener > xGlobalDocEventBroadcaster(xModelCollection,UNO_QUERY_THROW); - xGlobalDocEventBroadcaster->notifyEvent(aEvent); + xModelCollection->insert( makeAny( xModel ) ); } catch(Exception) { - OSL_ENSURE(0,"Could not add database model to global model collection and broadcast the events OnNew/OnLoad!"); + DBG_UNHANDLED_EXCEPTION(); } if ( rListener.is() ) rListener->loadFinished(this); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
