Tag: cws_src680_dba24 User: oj Date: 05/01/31 00:53:11 Modified: /dba/dbaccess/source/core/dataaccess/ documentcontainer.cxx, documentcontainer.hxx, documentdefinition.cxx
Log: #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.10.28.1 Delta lines: +31 -3 -------------------- --- documentcontainer.cxx 16 Nov 2004 09:27:58 -0000 1.10 +++ documentcontainer.cxx 31 Jan 2005 08:53:08 -0000 1.10.28.1 @@ -2,9 +2,9 @@ * * $RCSfile: documentcontainer.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.10.28.1 $ * - * last change: $Author: obo $ $Date: 2004/11/16 09:27:58 $ + * last change: $Author: oj $ $Date: 2005/01/31 08:53:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -669,6 +669,34 @@ 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 File [changed]: documentcontainer.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentcontainer.hxx?r1=1.6&r2=1.6.80.1 Delta lines: +6 -3 ------------------- --- documentcontainer.hxx 2 Aug 2004 15:10:25 -0000 1.6 +++ documentcontainer.hxx 31 Jan 2005 08:53:08 -0000 1.6.80.1 @@ -2,9 +2,9 @@ * * $RCSfile: documentcontainer.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.6.80.1 $ * - * last change: $Author: hr $ $Date: 2004/08/02 15:10:25 $ + * last change: $Author: oj $ $Date: 2005/01/31 08:53:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -142,6 +142,9 @@ // XHierarchicalNameContainer virtual void SAL_CALL insertByHierarchicalName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeByHierarchicalName( const ::rtl::OUString& Name ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + // XNameContainer + virtual void SAL_CALL removeByName( const ::rtl::OUString& _rName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // XHierarchicalNameReplace virtual void SAL_CALL replaceByHierarchicalName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); File [changed]: documentdefinition.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.cxx?r1=1.19&r2=1.19.2.1 Delta lines: +10 -6 -------------------- --- documentdefinition.cxx 21 Jan 2005 17:04:28 -0000 1.19 +++ documentdefinition.cxx 31 Jan 2005 08:53:08 -0000 1.19.2.1 @@ -2,9 +2,9 @@ * * $RCSfile: documentdefinition.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.19.2.1 $ * - * last change: $Author: kz $ $Date: 2005/01/21 17:04:28 $ + * last change: $Author: oj $ $Date: 2005/01/31 08:53:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -752,9 +752,6 @@ { xPersist->storeToEntry(xStorage,sPersistentName,Sequence<PropertyValue>(),Sequence<PropertyValue>()); xPersist->storeOwn(); -// Reference<XTransactedObject> xTransact(xStorage,UNO_QUERY); -// if ( xTransact.is() ) -// xTransact->commit(); } else throw CommandAbortedException(); @@ -791,6 +788,12 @@ ////////////////////////////////////////////////////////////////// // delete ////////////////////////////////////////////////////////////////// + closeObject(); + Reference< XStorage> xStorage = getStorage(); + if ( xStorage.is() ) + xStorage->removeElement(m_pImpl->m_aProps.sPersistentName); + + dispose(); } else aRet = OContentHelper::execute(aCommand,CommandId,Environment); @@ -1200,6 +1203,7 @@ { sal_Int32 nHandle = PROPERTY_ID_NAME; osl::ClearableGuard< osl::Mutex > aGuard(m_aMutex); + Any aOld = makeAny(m_pImpl->m_aProps.aTitle); aGuard.clear(); Any aNew = makeAny(newName); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
