From ffa5b8a82eab18041bbee4d6914892b82c7801d3 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Tue, 18 Dec 2018 16:33:21 +0100 Subject: Turn OSL_ENSURE(IsCalculated()) into assert() That is a programming error if precondition is not fulfilled. Change-Id: I9eb04cc99d10c27f193321ecaee74cc1b41ce531 Reviewed-on: https://gerrit.libreoffice.org/65359 Reviewed-by: Eike Rathke Tested-by: Jenkins --- sc/source/core/data/dptabres.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'sc') diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index b0084cefbb42..c1ac4eb130d7 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -597,42 +597,42 @@ bool ScDPAggData::IsCalculated() const double ScDPAggData::GetResult() const { - OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); + assert( IsCalculated() && "ScDPAggData not calculated" ); return fVal; // use calculated value } bool ScDPAggData::HasError() const { - OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); + assert( IsCalculated() && "ScDPAggData not calculated" ); return ( nCount == SC_DPAGG_RESULT_ERROR ); } bool ScDPAggData::HasData() const { - OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); + assert( IsCalculated() && "ScDPAggData not calculated" ); return ( nCount != SC_DPAGG_RESULT_EMPTY ); // values or error } void ScDPAggData::SetResult( double fNew ) { - OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); + assert( IsCalculated() && "ScDPAggData not calculated" ); fVal = fNew; // don't reset error flag } void ScDPAggData::SetError() { - OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); + assert( IsCalculated() && "ScDPAggData not calculated" ); nCount = SC_DPAGG_RESULT_ERROR; } void ScDPAggData::SetEmpty( bool bSet ) { - OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); + assert( IsCalculated() && "ScDPAggData not calculated" ); if ( bSet ) nCount = SC_DPAGG_RESULT_EMPTY; @@ -643,7 +643,7 @@ void ScDPAggData::SetEmpty( bool bSet ) double ScDPAggData::GetAuxiliary() const { // after Calculate, fAux is used as auxiliary value for running totals and reference values - OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); + assert( IsCalculated() && "ScDPAggData not calculated" ); return fAux; } @@ -651,7 +651,7 @@ double ScDPAggData::GetAuxiliary() const void ScDPAggData::SetAuxiliary( double fNew ) { // after Calculate, fAux is used as auxiliary value for running totals and reference values - OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); + assert( IsCalculated() && "ScDPAggData not calculated" ); fAux = fNew; } -- cgit