Kaydet (Commit) c9eddb9d authored tarafından Thomas Arnhold's avatar Thomas Arnhold

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

üst 5ad69209
...@@ -332,7 +332,7 @@ void SAL_CALL IUnknownWrapper_Impl::setValue( const OUString& aPropertyName, ...@@ -332,7 +332,7 @@ void SAL_CALL IUnknownWrapper_Impl::setValue( const OUString& aPropertyName,
OUString msg(OUSTR("[automation bridge] Property ") + aPropertyName + OUString msg(OUSTR("[automation bridge] Property ") + aPropertyName +
OUSTR(" is read-only")); OUSTR(" is read-only"));
OString sMsg = OUStringToOString(msg, osl_getThreadTextEncoding()); OString sMsg = OUStringToOString(msg, osl_getThreadTextEncoding());
OSL_ENSURE(0, sMsg.getStr()); OSL_FAIL(sMsg.getStr());
// ignore silently // ignore silently
return; return;
} }
......
...@@ -988,7 +988,7 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut ) ...@@ -988,7 +988,7 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut )
} }
catch ( ::com::sun::star::io::IOException & r ) 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( throw WrappedTargetException(
OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Error adding mimetype to the ZipOutputStream!" ) ), OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Error adding mimetype to the ZipOutputStream!" ) ),
static_cast < OWeakObject * > ( this ), static_cast < OWeakObject * > ( this ),
...@@ -1033,7 +1033,7 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< Sequence ...@@ -1033,7 +1033,7 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< Sequence
} }
else else
{ {
OSL_ENSURE ( 0, "Couldn't get a ManifestWriter!" ); OSL_FAIL( "Couldn't get a ManifestWriter!" );
IOException aException; IOException aException;
throw WrappedTargetException( throw WrappedTargetException(
OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Couldn't get a ManifestWriter!" ) ), OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Couldn't get a ManifestWriter!" ) ),
......
...@@ -341,12 +341,12 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr ...@@ -341,12 +341,12 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
} }
catch ( ZipException& ) catch ( ZipException& )
{ {
OSL_ENSURE( 0, "Error writing ZipOutputStream" ); OSL_FAIL( "Error writing ZipOutputStream" );
bWritingFailed = sal_True; bWritingFailed = sal_True;
} }
catch ( IOException& ) catch ( IOException& )
{ {
OSL_ENSURE( 0, "Error writing ZipOutputStream" ); OSL_FAIL( "Error writing ZipOutputStream" );
bWritingFailed = sal_True; bWritingFailed = sal_True;
} }
} }
...@@ -437,7 +437,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr ...@@ -437,7 +437,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
if ( !xStream.is() ) 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; bWritingFailed = sal_True;
continue; continue;
} }
...@@ -490,14 +490,14 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr ...@@ -490,14 +490,14 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
} }
else 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; continue;
} }
} }
} }
catch ( Exception& ) 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; bWritingFailed = sal_True;
continue; continue;
} }
...@@ -560,7 +560,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr ...@@ -560,7 +560,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
if ( !xStream.is() ) if ( !xStream.is() )
{ {
// Make sure that we actually _got_ a new one ! // 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; continue;
} }
} }
...@@ -588,12 +588,12 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr ...@@ -588,12 +588,12 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
} }
catch ( ZipException& ) catch ( ZipException& )
{ {
OSL_ENSURE( 0, "Error writing ZipOutputStream" ); OSL_FAIL( "Error writing ZipOutputStream" );
bWritingFailed = sal_True; bWritingFailed = sal_True;
} }
catch ( IOException& ) catch ( IOException& )
{ {
OSL_ENSURE( 0, "Error writing ZipOutputStream" ); OSL_FAIL( "Error writing ZipOutputStream" );
bWritingFailed = sal_True; bWritingFailed = sal_True;
} }
} }
...@@ -615,7 +615,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr ...@@ -615,7 +615,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
if ( !xStream.is() ) if ( !xStream.is() )
{ {
// Make sure that we actually _got_ a new one ! // 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; continue;
} }
} }
...@@ -645,12 +645,12 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr ...@@ -645,12 +645,12 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
} }
catch ( ZipException& ) catch ( ZipException& )
{ {
OSL_ENSURE( 0, "Error writing ZipOutputStream" ); OSL_FAIL( "Error writing ZipOutputStream" );
bWritingFailed = sal_True; bWritingFailed = sal_True;
} }
catch ( IOException& ) catch ( IOException& )
{ {
OSL_ENSURE( 0, "Error writing ZipOutputStream" ); OSL_FAIL( "Error writing ZipOutputStream" );
bWritingFailed = sal_True; bWritingFailed = sal_True;
} }
......
...@@ -417,12 +417,12 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getRawData() ...@@ -417,12 +417,12 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getRawData()
} }
catch (ZipException &)//rException) catch (ZipException &)//rException)
{ {
OSL_ENSURE( 0, "ZipException thrown");//rException.Message); OSL_FAIL( "ZipException thrown");//rException.Message);
return Reference < io::XInputStream > (); return Reference < io::XInputStream > ();
} }
catch (Exception &) 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 > (); return Reference < io::XInputStream > ();
} }
} }
...@@ -448,12 +448,12 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getInputStream( ) ...@@ -448,12 +448,12 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getInputStream( )
} }
catch (ZipException &)//rException) catch (ZipException &)//rException)
{ {
OSL_ENSURE( 0,"ZipException thrown");//rException.Message); OSL_FAIL( "ZipException thrown");//rException.Message);
return Reference < io::XInputStream > (); return Reference < io::XInputStream > ();
} }
catch (Exception &) 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 > (); return Reference < io::XInputStream > ();
} }
} }
......
...@@ -340,7 +340,7 @@ DocumentDigitalSignatures::ImplVerifySignatures( ...@@ -340,7 +340,7 @@ DocumentDigitalSignatures::ImplVerifySignatures(
rSigInfo.CertificateStatus = xSecEnv->verifyCertificate(rSigInfo.Signer, rSigInfo.CertificateStatus = xSecEnv->verifyCertificate(rSigInfo.Signer,
Sequence<Reference<css::security::XCertificate> >()); Sequence<Reference<css::security::XCertificate> >());
} catch (SecurityException& ) { } catch (SecurityException& ) {
OSL_ENSURE(0, "Verification of certificate failed"); OSL_FAIL("Verification of certificate failed");
rSigInfo.CertificateStatus = css::security::CertificateValidity::INVALID; rSigInfo.CertificateStatus = css::security::CertificateValidity::INVALID;
} }
} }
......
...@@ -640,7 +640,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() ...@@ -640,7 +640,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
nValidCerts++; nValidCerts++;
} catch (css::uno::SecurityException& ) { } catch (css::uno::SecurityException& ) {
OSL_ENSURE(0, "Verification of certificate failed"); OSL_FAIL("Verification of certificate failed");
bCertValid = false; bCertValid = false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment