diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-10-06 12:44:38 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-10-06 12:48:18 +0200 |
commit | e41fad1944139e5129f8a99e07c08655f50136f7 (patch) | |
tree | 337ff880ae38e848dea28538f444279086f9d5e3 /sc | |
parent | f94d4952dcf7fe8a46883184dc841b1f64274656 (diff) |
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
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/xestring.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/filter/excel/xestring.cxx b/sc/source/filter/excel/xestring.cxx index 1404e18ca4a5..6076f5aaa07c 100644 --- a/sc/source/filter/excel/xestring.cxx +++ b/sc/source/filter/excel/xestring.cxx @@ -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 ) |