summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2011-03-19 14:06:18 +0100
committerThomas Arnhold <thomas@arnhold.org>2011-03-19 14:06:18 +0100
commit352f1a58e24c9c3ec45829111a77fa9fbd8065ab (patch)
treef4d3ec761af697a535fad86c5fec2e045c933d0e /package
parent00d5ba291e359368ee484a7c0c43281c22bd3df6 (diff)
Move OSL_ENSURE(sal_False,...) to OSL_FAIL(...)
Diffstat (limited to 'package')
-rw-r--r--package/source/xstor/owriteablestream.cxx24
-rw-r--r--package/source/xstor/switchpersistencestream.cxx2
-rw-r--r--package/source/xstor/xfactory.cxx16
-rw-r--r--package/source/xstor/xstorage.cxx10
-rw-r--r--package/source/zippackage/ZipPackage.cxx2
-rw-r--r--package/source/zippackage/wrapstreamforshare.cxx2
-rw-r--r--package/source/zippackage/zipfileaccess.cxx6
7 files changed, 31 insertions, 31 deletions
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index bb1eb8598705..99ad649a4d28 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -125,7 +125,7 @@ void SetEncryptionKeyProperty_Impl( const uno::Reference< beans::XPropertySet >&
{
::package::StaticAddLog( aException.Message );
::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can't set encryption") ) );
- OSL_ENSURE( sal_False, "Can't write encryption related properties!\n" );
+ OSL_FAIL( "Can't write encryption related properties!\n" );
throw io::IOException(); // TODO
}
}
@@ -146,7 +146,7 @@ uno::Any GetEncryptionKeyProperty_Impl( const uno::Reference< beans::XPropertySe
::package::StaticAddLog( aException.Message );
::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can't get encryption property" ) ) );
- OSL_ENSURE( sal_False, "Can't get encryption related properties!\n" );
+ OSL_FAIL( "Can't get encryption related properties!\n" );
throw io::IOException(); // TODO
}
}
@@ -377,7 +377,7 @@ sal_Bool OWriteStream_Impl::IsEncrypted()
uno::Any aValue = xPropSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WasEncrypted") ) );
if ( !( aValue >>= bWasEncr ) )
{
- OSL_ENSURE( sal_False, "The property WasEncrypted has wrong type!\n" );
+ OSL_FAIL( "The property WasEncrypted has wrong type!\n" );
}
}
@@ -388,7 +388,7 @@ sal_Bool OWriteStream_Impl::IsEncrypted()
{
if ( !( m_aProps[nInd].Value >>= bToBeEncr ) )
{
- OSL_ENSURE( sal_False, "The property has wrong type!\n" );
+ OSL_FAIL( "The property has wrong type!\n" );
}
}
}
@@ -1158,13 +1158,13 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::ReadPackageStreamProper
AddLog( aException.Message );
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Quiet exception" ) ) );
- OSL_ENSURE( sal_False, "A property can't be retrieved!\n" );
+ OSL_FAIL( "A property can't be retrieved!\n" );
}
}
}
else
{
- OSL_ENSURE( sal_False, "Can not get properties from a package stream!\n" );
+ OSL_FAIL( "Can not get properties from a package stream!\n" );
throw uno::RuntimeException();
}
@@ -1309,7 +1309,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream( sal_Int32 nStreamMod
AddLog( aException.Message );
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Quiet exception" ) ) );
- OSL_ENSURE( sal_False, "Can't write encryption related properties!\n" );
+ OSL_FAIL( "Can't write encryption related properties!\n" );
SetEncryptionKeyProperty_Impl( xPropertySet, uno::Sequence< sal_Int8 >() );
throw io::IOException(); // TODO:
}
@@ -1655,7 +1655,7 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
if ( !xDataToCopy.is() )
{
- OSL_ENSURE( sal_False, "Encrypted ZipStream must already have input stream inside!\n" );
+ OSL_FAIL( "Encrypted ZipStream must already have input stream inside!\n" );
SetEncryptionKeyProperty_Impl( xPropertySet, uno::Sequence< sal_Int8 >() );
}
}
@@ -1667,7 +1667,7 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
if ( !xDataToCopy.is() )
{
- OSL_ENSURE( sal_False, "Encrypted ZipStream must already have input stream inside!\n" );
+ OSL_FAIL( "Encrypted ZipStream must already have input stream inside!\n" );
SetEncryptionKeyProperty_Impl( xPropertySet, uno::Sequence< sal_Int8 >() );
AddLog( aWrongPasswordException.Message );
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
@@ -1684,7 +1684,7 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
}
catch( uno::Exception& aException )
{
- OSL_ENSURE( sal_False, "Can't open encrypted stream!\n" );
+ OSL_FAIL( "Can't open encrypted stream!\n" );
SetEncryptionKeyProperty_Impl( xPropertySet, uno::Sequence< sal_Int8 >() );
AddLog( aException.Message );
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
@@ -1963,7 +1963,7 @@ void OWriteStream::CopyToStreamInternally_Impl( const uno::Reference< io::XStrea
m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Quiet exception" ) ) );
// TODO: set the stoream in invalid state or dispose
- OSL_ENSURE( sal_False, "The stream become invalid during copiing!\n" );
+ OSL_FAIL( "The stream become invalid during copiing!\n" );
throw uno::RuntimeException();
}
@@ -2581,7 +2581,7 @@ void SAL_CALL OWriteStream::truncate()
if ( !xTruncate.is() )
{
- OSL_ENSURE( sal_False, "The output stream must support XTruncate interface!\n" );
+ OSL_FAIL( "The output stream must support XTruncate interface!\n" );
throw uno::RuntimeException();
}
diff --git a/package/source/xstor/switchpersistencestream.cxx b/package/source/xstor/switchpersistencestream.cxx
index f43f96dd5744..1de56c2163ee 100644
--- a/package/source/xstor/switchpersistencestream.cxx
+++ b/package/source/xstor/switchpersistencestream.cxx
@@ -372,7 +372,7 @@ void SAL_CALL SwitchablePersistenceStream::flush( )
if ( !m_pStreamData || m_pStreamData->m_bInStreamBased )
{
- OSL_ENSURE( sal_False, "flush() is not acceptable!\n" );
+ OSL_FAIL( "flush() is not acceptable!\n" );
return;
// in future throw exception, for now some code might call flush() on closed stream
// since file ucp implementation allows it
diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx
index e0e1ce8148e4..80be2484a307 100644
--- a/package/source/xstor/xfactory.cxx
+++ b/package/source/xstor/xfactory.cxx
@@ -134,7 +134,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
{
if( !( aArguments[1] >>= nStorageMode ) )
{
- OSL_ENSURE( sal_False, "Wrong second argument!\n" );
+ OSL_FAIL( "Wrong second argument!\n" );
throw lang::IllegalArgumentException(); // TODO:
}
// it's allways possible to read written storage in this implementation
@@ -154,13 +154,13 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
{
if ( !aURL.getLength() )
{
- OSL_ENSURE( sal_False, "Empty URL is provided!\n" );
+ OSL_FAIL( "Empty URL is provided!\n" );
throw lang::IllegalArgumentException(); // TODO:
}
if ( aURL.equalsIgnoreAsciiCaseAsciiL( "vnd.sun.star.pkg", 16 ) )
{
- OSL_ENSURE( sal_False, "Packages URL's are not valid for storages!\n" ); // ???
+ OSL_FAIL( "Packages URL's are not valid for storages!\n" ); // ???
throw lang::IllegalArgumentException(); // TODO:
}
@@ -179,7 +179,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
}
else if ( !( aArguments[0] >>= xStream ) && !( aArguments[0] >>= xInputStream ) )
{
- OSL_ENSURE( sal_False, "Wrong first argument!\n" );
+ OSL_FAIL( "Wrong first argument!\n" );
throw uno::Exception(); // TODO: Illegal argument
}
@@ -240,12 +240,12 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 );
}
else
- OSL_ENSURE( sal_False, "Unacceptable property, will be ignored!\n" );
+ OSL_FAIL( "Unacceptable property, will be ignored!\n" );
}
}
else
{
- OSL_ENSURE( sal_False, "Wrong third argument!\n" );
+ OSL_FAIL( "Wrong third argument!\n" );
throw uno::Exception(); // TODO: Illegal argument
}
@@ -262,7 +262,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
if ( !xSeekable.is() )
{
// TODO: wrap stream to let it be seekable
- OSL_ENSURE( sal_False, "Nonseekable streams are not supported for now!\n" );
+ OSL_FAIL( "Nonseekable streams are not supported for now!\n" );
}
if ( !CheckPackageSignature_Impl( xInputStream, xSeekable ) )
@@ -282,7 +282,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
if ( !xSeekable.is() )
{
// TODO: wrap stream to let it be seekable
- OSL_ENSURE( sal_False, "Nonseekable streams are not supported for now!\n" );
+ OSL_FAIL( "Nonseekable streams are not supported for now!\n" );
}
if ( !CheckPackageSignature_Impl( xStream->getInputStream(), xSeekable ) )
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 79728a00a9d6..1f7b0dd9daf0 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -228,7 +228,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XInputStream > xInputStream,
if ( m_nStorageMode & embed::ElementModes::WRITE )
{
// check that the stream allows to write
- OSL_ENSURE( sal_False, "No stream for writing is provided!\n" );
+ OSL_FAIL( "No stream for writing is provided!\n" );
}
}
@@ -655,7 +655,7 @@ void OStorage_Impl::ReadContents()
if ( !xNamed.is() )
{
- OSL_ENSURE( sal_False, "XNamed is not supported!\n" );
+ OSL_FAIL( "XNamed is not supported!\n" );
throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
}
@@ -689,7 +689,7 @@ void OStorage_Impl::ReadContents()
AddLog( aNoSuchElementException.Message );
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "NoSuchElement" ) ) );
- OSL_ENSURE( sal_False, "hasMoreElements() implementation has problems!\n" );
+ OSL_FAIL( "hasMoreElements() implementation has problems!\n" );
break;
}
}
@@ -911,7 +911,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement,
}
else if ( m_nStorageType != embed::StorageFormats::PACKAGE )
{
- OSL_ENSURE( sal_False, "Encryption is only supported in package storage!\n" );
+ OSL_FAIL( "Encryption is only supported in package storage!\n" );
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
}
else if ( pElement->m_pStream->HasCachedEncryptionData()
@@ -4714,7 +4714,7 @@ void SAL_CALL OStorage::removeEncryption()
m_pImpl->AddLog( aException.Message );
m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
- OSL_ENSURE( sal_False, "The call must not fail, it is pretty simple!" );
+ OSL_FAIL( "The call must not fail, it is pretty simple!" );
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
}
}
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 454a4e66094f..e3ab5caabd63 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1539,7 +1539,7 @@ void ZipPackage::DisconnectFromTargetAndThrowException_Impl( const uno::Referenc
}
catch ( uno::Exception& )
{
- OSL_ENSURE( sal_False, "These calls are pretty simple, they should not fail!\n" );
+ OSL_FAIL( "These calls are pretty simple, they should not fail!\n" );
}
::rtl::OUString aErrTxt( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "This package is read only!" ) );
diff --git a/package/source/zippackage/wrapstreamforshare.cxx b/package/source/zippackage/wrapstreamforshare.cxx
index 9afb2f8f9428..c39bfa06edbb 100644
--- a/package/source/zippackage/wrapstreamforshare.cxx
+++ b/package/source/zippackage/wrapstreamforshare.cxx
@@ -44,7 +44,7 @@ WrapStreamForShare::WrapStreamForShare( const uno::Reference< io::XInputStream >
m_xSeekable = uno::Reference< io::XSeekable >( m_xInStream, uno::UNO_QUERY );
if ( !m_rMutexRef.Is() || !m_xInStream.is() || !m_xSeekable.is() )
{
- OSL_ENSURE( sal_False, "Wrong initialization of wrapping stream!\n" );
+ OSL_FAIL( "Wrong initialization of wrapping stream!\n" );
throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
}
}
diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx
index cb5996aa3c8e..a75bed446335 100644
--- a/package/source/zippackage/zipfileaccess.cxx
+++ b/package/source/zippackage/zipfileaccess.cxx
@@ -103,7 +103,7 @@ uno::Sequence< ::rtl::OUString > OZipFileAccess::GetPatternsFromString_Impl( con
}
else
{
- OSL_ENSURE( sal_False, "The backslash is not guarded!\n" );
+ OSL_FAIL( "The backslash is not guarded!\n" );
aPattern[nInd] += ::rtl::OUString::valueOf( (sal_Unicode)'\\' );
}
}
@@ -281,7 +281,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OZipFileAccess::getElementNames()
{
if ( aNames.getLength() < ++nLen )
{
- OSL_ENSURE( sal_False, "The size must be the same!\n" );
+ OSL_FAIL( "The size must be the same!\n" );
aNames.realloc( nLen );
}
@@ -290,7 +290,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OZipFileAccess::getElementNames()
if ( aNames.getLength() != nLen )
{
- OSL_ENSURE( sal_False, "The size must be the same!\n" );
+ OSL_FAIL( "The size must be the same!\n" );
aNames.realloc( nLen );
}