Tag: cws_src680_dba26 User: fs Date: 05/03/14 06:00:03 Modified: /dba/dbaccess/source/core/dataaccess/ documentcontainer.cxx
Log: RESYNC: (1.10-1.11); FILE MERGED 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.60.1&r2=1.10.60.2 Delta lines: +33 -4 -------------------- --- documentcontainer.cxx 11 Mar 2005 13:35:58 -0000 1.10.60.1 +++ documentcontainer.cxx 14 Mar 2005 14:00:00 -0000 1.10.60.2 @@ -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]
