diff options
author | Mikhail Voitenko <mav@openoffice.org> | 2002-05-13 09:47:30 +0000 |
---|---|---|
committer | Mikhail Voitenko <mav@openoffice.org> | 2002-05-13 09:47:30 +0000 |
commit | 7169f6198f06f9049b5815ea455ecafd786db41d (patch) | |
tree | 4ab109ab2d05477baaa494fc99e13324b2297579 /package/source | |
parent | 92b78f7edef1b18bc4de1dbf0ae6787293a1916e (diff) |
#99253# throw an exception in case writing fails
Diffstat (limited to 'package/source')
-rw-r--r-- | package/source/zippackage/ZipPackageFolder.cxx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx index f2b317ba2163..514bdb86315c 100644 --- a/package/source/zippackage/ZipPackageFolder.cxx +++ b/package/source/zippackage/ZipPackageFolder.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ZipPackageFolder.cxx,v $ * - * $Revision: 1.57 $ + * $Revision: 1.58 $ * - * last change: $Author: mtg $ $Date: 2002-01-29 15:32:28 $ + * last change: $Author: mav $ $Date: 2002-05-13 10:47:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -269,6 +269,7 @@ static void ImplSetStoredData( ZipEntry & rEntry, Reference < XInputStream> & rS void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < PropertyValue > > &rManList, ZipOutputStream & rZipOut, Sequence < sal_Int8 > &rEncryptionKey, rtlRandomPool &rRandomPool) throw(RuntimeException) { + sal_Bool bWritingFailed = sal_False; ZipPackageFolder *pFolder = NULL; ZipPackageStream *pStream = NULL; const OUString sMediaTypeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "MediaType" ) ); @@ -475,13 +476,15 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr rZipOut.rawCloseEntry(); } - catch (ZipException&) + catch ( ZipException& r ) { VOS_ENSURE( 0, "Error writing ZipOutputStream" ); + bWritingFailed = sal_True; } - catch (IOException & ) + catch ( IOException& r ) { VOS_ENSURE( 0, "Error writing ZipOutputStream" ); + bWritingFailed = sal_True; } } else @@ -529,13 +532,15 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr rZipOut.closeEntry(); } - catch (ZipException&) + catch ( ZipException& r ) { VOS_ENSURE( 0, "Error writing ZipOutputStream" ); + bWritingFailed = sal_True; } - catch (IOException & ) + catch ( IOException& r ) { VOS_ENSURE( 0, "Error writing ZipOutputStream" ); + bWritingFailed = sal_True; } if ( bToBeEncrypted && !nMagicalHackPos ) { @@ -554,6 +559,9 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr } rManList.push_back (aPropSet); } + + if( bWritingFailed ) + throw RuntimeException(); } void ZipPackageFolder::releaseUpwardRef( void ) |