summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2004-01-06 07:46:41 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2004-01-06 07:46:41 +0000
commitacdf4d664fad9feb5727ed4881116c76424c2f4d (patch)
tree549428dc993906a3683df2d5b79406f54f5222cd /package
parent6fe9e878faa3d2922a8387a97cf317162a560b5d (diff)
INTEGRATION: CWS mav07 (1.2.4); FILE MERGED
2003/12/17 17:47:01 mav 1.2.4.6: #112923# fix recync problem 2003/12/16 09:34:21 mav 1.2.4.5: RESYNC: (1.2-1.3); FILE MERGED 2003/11/21 12:12:36 mav 1.2.4.4: #112923# allow storage copiing when stream is opened for writing 2003/11/12 12:42:02 mav 1.2.4.3: #112923# reopen substorage for writing 2003/09/24 11:14:17 mav 1.2.4.2: #110406# fix typo 2003/09/24 11:04:24 mav 1.2.4.1: #110406# fix assertion
Diffstat (limited to 'package')
-rw-r--r--package/source/xstor/xstorage.cxx28
1 files changed, 11 insertions, 17 deletions
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 3d5ed259531e..2b8624d09e8a 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xstorage.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: rt $ $Date: 2004-01-05 12:36:40 $
+ * last change: $Author: rt $ $Date: 2004-01-06 08:46:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -591,33 +591,22 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement,
// TODO: copy encrypted element
if ( !pElement->m_pStream->IsEncrypted() )
{
- uno::Reference< io::XStream > xOwnStream = pElement->m_pStream->GetStream(
- embed::ElementModes::ELEMENT_READ );
-
- if ( !xOwnStream.is() )
- throw io::IOException(); // TODO
-
uno::Reference< io::XStream > xSubStr =
xDest->openStreamElement( pElement->m_aName,
embed::ElementModes::ELEMENT_READWRITE | embed::ElementModes::ELEMENT_TRUNCATE );
OSL_ENSURE( xSubStr.is(), "No destination substream!\n" );
- completeStorageStreamCopy_Impl( xOwnStream, xSubStr );
+ pElement->m_pStream->CopyInternallyTo_Impl( xSubStr );
}
else if ( pElement->m_pStream->HasCachedPassword() && pElement->m_pStream->IsModified() )
{
- uno::Reference< io::XStream > xOwnStream = pElement->m_pStream->GetStream( embed::ElementModes::ELEMENT_READ,
- pElement->m_pStream->GetCachedPassword() );
- if ( !xOwnStream.is() )
- throw io::IOException(); // TODO
-
uno::Reference< io::XStream > xSubStr =
xDest->openEncryptedStreamElement( pElement->m_aName,
embed::ElementModes::ELEMENT_READWRITE | embed::ElementModes::ELEMENT_TRUNCATE,
pElement->m_pStream->GetCachedPassword() );
OSL_ENSURE( xSubStr.is(), "No destination substream!\n" );
- completeStorageStreamCopy_Impl( xOwnStream, xSubStr );
+ pElement->m_pStream->CopyInternallyTo_Impl( xSubStr, pElement->m_pStream->GetCachedPassword() );
}
else
{
@@ -695,7 +684,7 @@ void OStorage_Impl::Commit()
if ( m_bCommited || m_bIsRoot )
xNewPackageFolder->removeByName( (*pDeletedIter)->m_aOriginalName );
delete *pDeletedIter;
- pDeletedIter = NULL;
+ *pDeletedIter = NULL;
}
m_aDeletedList.clear();
@@ -1045,7 +1034,7 @@ SotElement_Impl* OStorage_Impl::InsertElement( ::rtl::OUString aName, sal_Bool b
OSL_ENSURE( (*pElementIter)->m_bIsRemoved, "Try to insert an element instead of existing one!\n" );
if ( (*pElementIter)->m_bIsRemoved )
{
- OSL_ENSURE( (*pElementIter)->m_bIsInserted, "Inserted elements must be deleted immediatelly!\n" );
+ OSL_ENSURE( !(*pElementIter)->m_bIsInserted, "Inserted elements must be deleted immediatelly!\n" );
pDeletedElm = *pElementIter;
break;
}
@@ -1595,6 +1584,11 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement(
if ( pElement->m_pStorage->m_nStorageMode & embed::ElementModes::ELEMENT_WRITE )
nStorageMode |= embed::ElementModes::ELEMENT_WRITE;
+ // in case parent storage allows writing the readonly mode of the child storage is
+ // virtual, that means that it is just enough to change the flag to let it be writable
+ // and since there is no AntiImpl nobody should be notified about it
+ pElement->m_pStorage->m_nStorageMode = nStorageMode | embed::ElementModes::ELEMENT_READ;
+
if ( ( nStorageMode & embed::ElementModes::ELEMENT_TRUNCATE ) )
{
for ( SotElementList_Impl::iterator pElementIter = m_pImpl->m_aChildrenList.begin();