Move OSL_ENSURE(0,...) to OSL_FAIL(...)

This commit is contained in:
Thomas Arnhold 2011-03-12 12:05:07 +01:00
parent 5ad6920963
commit c9eddb9d35
6 changed files with 20 additions and 20 deletions

View file

@ -332,7 +332,7 @@ void SAL_CALL IUnknownWrapper_Impl::setValue( const OUString& aPropertyName,
OUString msg(OUSTR("[automation bridge] Property ") + aPropertyName +
OUSTR(" is read-only"));
OString sMsg = OUStringToOString(msg, osl_getThreadTextEncoding());
OSL_ENSURE(0, sMsg.getStr());
OSL_FAIL(sMsg.getStr());
// ignore silently
return;
}

View file

@ -988,7 +988,7 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut )
}
catch ( ::com::sun::star::io::IOException & r )
{
OSL_ENSURE( 0, "Error adding mimetype to the ZipOutputStream" );
OSL_FAIL( "Error adding mimetype to the ZipOutputStream" );
throw WrappedTargetException(
OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Error adding mimetype to the ZipOutputStream!" ) ),
static_cast < OWeakObject * > ( this ),
@ -1033,7 +1033,7 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< Sequence
}
else
{
OSL_ENSURE ( 0, "Couldn't get a ManifestWriter!" );
OSL_FAIL( "Couldn't get a ManifestWriter!" );
IOException aException;
throw WrappedTargetException(
OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Couldn't get a ManifestWriter!" ) ),

View file

@ -341,12 +341,12 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
}
catch ( ZipException& )
{
OSL_ENSURE( 0, "Error writing ZipOutputStream" );
OSL_FAIL( "Error writing ZipOutputStream" );
bWritingFailed = sal_True;
}
catch ( IOException& )
{
OSL_ENSURE( 0, "Error writing ZipOutputStream" );
OSL_FAIL( "Error writing ZipOutputStream" );
bWritingFailed = sal_True;
}
}
@ -437,7 +437,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
if ( !xStream.is() )
{
OSL_ENSURE( 0, "ZipPackageStream didn't have a stream associated with it, skipping!" );
OSL_FAIL( "ZipPackageStream didn't have a stream associated with it, skipping!" );
bWritingFailed = sal_True;
continue;
}
@ -490,14 +490,14 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
}
else
{
OSL_ENSURE( 0, "The package component requires that every stream either be FROM a package or it must support XSeekable!" );
OSL_FAIL( "The package component requires that every stream either be FROM a package or it must support XSeekable!" );
continue;
}
}
}
catch ( Exception& )
{
OSL_ENSURE( 0, "The stream provided to the package component has problems!" );
OSL_FAIL( "The stream provided to the package component has problems!" );
bWritingFailed = sal_True;
continue;
}
@ -560,7 +560,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
if ( !xStream.is() )
{
// Make sure that we actually _got_ a new one !
OSL_ENSURE( 0, "ZipPackageStream didn't have a stream associated with it, skipping!" );
OSL_FAIL( "ZipPackageStream didn't have a stream associated with it, skipping!" );
continue;
}
}
@ -588,12 +588,12 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
}
catch ( ZipException& )
{
OSL_ENSURE( 0, "Error writing ZipOutputStream" );
OSL_FAIL( "Error writing ZipOutputStream" );
bWritingFailed = sal_True;
}
catch ( IOException& )
{
OSL_ENSURE( 0, "Error writing ZipOutputStream" );
OSL_FAIL( "Error writing ZipOutputStream" );
bWritingFailed = sal_True;
}
}
@ -615,7 +615,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
if ( !xStream.is() )
{
// Make sure that we actually _got_ a new one !
OSL_ENSURE( 0, "ZipPackageStream didn't have a stream associated with it, skipping!" );
OSL_FAIL( "ZipPackageStream didn't have a stream associated with it, skipping!" );
continue;
}
}
@ -645,12 +645,12 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
}
catch ( ZipException& )
{
OSL_ENSURE( 0, "Error writing ZipOutputStream" );
OSL_FAIL( "Error writing ZipOutputStream" );
bWritingFailed = sal_True;
}
catch ( IOException& )
{
OSL_ENSURE( 0, "Error writing ZipOutputStream" );
OSL_FAIL( "Error writing ZipOutputStream" );
bWritingFailed = sal_True;
}

View file

@ -417,12 +417,12 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getRawData()
}
catch (ZipException &)//rException)
{
OSL_ENSURE( 0, "ZipException thrown");//rException.Message);
OSL_FAIL( "ZipException thrown");//rException.Message);
return Reference < io::XInputStream > ();
}
catch (Exception &)
{
OSL_ENSURE( 0, "Exception is thrown during stream wrapping!\n");
OSL_FAIL( "Exception is thrown during stream wrapping!\n");
return Reference < io::XInputStream > ();
}
}
@ -448,12 +448,12 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getInputStream( )
}
catch (ZipException &)//rException)
{
OSL_ENSURE( 0,"ZipException thrown");//rException.Message);
OSL_FAIL( "ZipException thrown");//rException.Message);
return Reference < io::XInputStream > ();
}
catch (Exception &)
{
OSL_ENSURE( 0, "Exception is thrown during stream wrapping!\n");
OSL_FAIL( "Exception is thrown during stream wrapping!\n");
return Reference < io::XInputStream > ();
}
}

View file

@ -340,7 +340,7 @@ DocumentDigitalSignatures::ImplVerifySignatures(
rSigInfo.CertificateStatus = xSecEnv->verifyCertificate(rSigInfo.Signer,
Sequence<Reference<css::security::XCertificate> >());
} catch (SecurityException& ) {
OSL_ENSURE(0, "Verification of certificate failed");
OSL_FAIL("Verification of certificate failed");
rSigInfo.CertificateStatus = css::security::CertificateValidity::INVALID;
}
}

View file

@ -640,7 +640,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
nValidCerts++;
} catch (css::uno::SecurityException& ) {
OSL_ENSURE(0, "Verification of certificate failed");
OSL_FAIL("Verification of certificate failed");
bCertValid = false;
}