Kaydet (Commit) e41fad19 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Replace some OSL_ENSURE with assert

...at least in the !IsEmpty() branch of XclExpString::WriteBufferToMem, pnMem is
used in ways were being null would be undefined behavior, and the only place
from which WriteHeaderToMem, WriteBufferToMem are called (lclAppend in
sc/source/filter/excel/xeformula.cxx, via WriteToMem) will always pass a non-
null argument anyway

Change-Id: Iabc06b53ae6059246c5c222d43a789c6bdc440d5
üst f94d4952
......@@ -18,6 +18,7 @@
*/
#include <algorithm>
#include <cassert>
#include <osl/diagnose.h>
#include "xlstyle.hxx"
......@@ -335,7 +336,7 @@ void XclExpString::Write( XclExpStream& rStrm ) const
void XclExpString::WriteHeaderToMem( sal_uInt8* pnMem ) const
{
OSL_ENSURE( pnMem, "XclExpString::WriteHeaderToMem - no memory to write to" );
assert(pnMem);
OSL_ENSURE( !mb8BitLen || (mnLen < 256), "XclExpString::WriteHeaderToMem - string too long" );
OSL_ENSURE( !IsWriteFormats(), "XclExpString::WriteHeaderToMem - formatted strings not supported" );
// length
......@@ -356,7 +357,7 @@ void XclExpString::WriteHeaderToMem( sal_uInt8* pnMem ) const
void XclExpString::WriteBufferToMem( sal_uInt8* pnMem ) const
{
OSL_ENSURE( pnMem, "XclExpString::WriteBufferToMem - no memory to write to" );
assert(pnMem);
if( !IsEmpty() )
{
if( mbIsBiff8 )
......
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