summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorMikhail Voitenko <mav@openoffice.org>2002-09-25 09:34:04 +0000
committerMikhail Voitenko <mav@openoffice.org>2002-09-25 09:34:04 +0000
commit0cd5140819fa5f0efc40c64ceabc02f38dfe81a6 (patch)
tree1a548571e3ce479e304273cc7b7d2fa5e880fdee /package
parent27a3fb6ae3953b902941307d2179761532204934 (diff)
#92926# throw an exception in case package format is wrong
Diffstat (limited to 'package')
-rw-r--r--package/source/zippackage/ZipPackage.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 6b9a1d1faa05..d829032fd38d 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ZipPackage.cxx,v $
*
- * $Revision: 1.84 $
+ * $Revision: 1.85 $
*
- * last change: $Author: cl $ $Date: 2002-09-25 09:51:21 $
+ * last change: $Author: mav $ $Date: 2002-09-25 10:34:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -429,9 +429,10 @@ void ZipPackage::getZipFileContents()
}
}
else
- VOS_ENSURE ( 0, "Couldn't get a ManifestReader!" );
+ VOS_ENSURE ( 0, "Couldn't get a ManifestReader!" ); // throw RuntimeException?
}
}
+
const OUString sMeta ( RTL_CONSTASCII_USTRINGPARAM ( "META-INF" ) );
if ( xRootFolder->hasByName( sMeta ) )
xRootFolder->removeByName( sMeta );
@@ -524,10 +525,16 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments )
{
bBadZipFile = sal_True;
}
+ catch ( Exception & )
+ {
+ if( pZipFile ) { delete pZipFile; pZipFile = NULL; }
+ throw;
+ }
+
if ( bBadZipFile )
{
// clean up the memory, and tell the UCB about the error
- delete pZipFile; pZipFile = NULL;
+ if( pZipFile ) { delete pZipFile; pZipFile = NULL; }
throw com::sun::star::uno::Exception ( OUString( RTL_CONSTASCII_USTRINGPARAM ( "Bad Zip File." ) ),
static_cast < ::cppu::OWeakObject * > ( this ) );
}