User: vg Date: 05/03/10 08:34:55 Modified: /dba/dbaccess/source/core/dataaccess/ documentcontainer.cxx
Log: INTEGRATION: CWS dba24 (1.10.28); FILE MERGED 2005/02/22 10:07:21 oj 1.10.28.3: build problems 2005/02/18 12:25:27 oj 1.10.28.2: #i42460# changes for the separation of datasource and database document(model) 2005/01/31 08:53:08 oj 1.10.28.1: #i40866# impl delete File Changes: Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: documentcontainer.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentcontainer.cxx?r1=1.10&r2=1.11 Delta lines: +30 -1 -------------------- --- documentcontainer.cxx 16 Nov 2004 09:27:58 -0000 1.10 +++ documentcontainer.cxx 10 Mar 2005 16:34:52 -0000 1.11 @@ -663,12 +663,41 @@ { static const ::rtl::OUString s_sForms = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("forms")); static const ::rtl::OUString s_sReports = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("reports")); - return m_pImpl->m_pDataSource ? m_pImpl->m_pDataSource->getStorage(m_bFormsContainer ? s_sForms : s_sReports) : Reference< XStorage>(); + Reference<XTransactionListener> xEvt(m_pImpl->m_pDataSource->m_xModel,UNO_QUERY); + return m_pImpl->m_pDataSource ? m_pImpl->m_pDataSource->getStorage(m_bFormsContainer ? s_sForms : s_sReports,xEvt) : Reference< XStorage>(); } // ----------------------------------------------------------------------------- sal_Bool ODocumentContainer::approveNewObject(const ::rtl::OUString& _sName,const Reference< XContent >& _rxObject) const { return (_sName.indexOf('/',0) == -1) && ODefinitionContainer::approveNewObject(_sName,_rxObject); +} +// ----------------------------------------------------------------------------- +void SAL_CALL ODocumentContainer::removeByName( const ::rtl::OUString& _rName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException) +{ + Reference< XContent > xOldElement; + ClearableMutexGuard aGuard(m_aMutex); + { + // check the arguments + if (!_rName.getLength()) + throw IllegalArgumentException(); + + if (!checkExistence(_rName)) + throw NoSuchElementException(_rName,*this); + + Reference< XCommandProcessor > xContent(implGetByName(_rName),UNO_QUERY); + if ( xContent.is() ) + { + Command aCommand; + + aCommand.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")); + xContent->execute(aCommand,xContent->createCommandIdentifier(),Reference< XCommandEnvironment >()); + } + // do the removal + implRemove(_rName); + + // disposeComponent(xOldElement); // no dispose here, the object amy be inserted again unde a different name + } + notifyByName(aGuard,_rName,NULL,NULL,E_REMOVED); } //........................................................................ } // namespace dbaccess --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
