diff options
author | Radu Ioan <ioan.radu.g@gmail.com> | 2013-01-09 00:14:10 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-01-14 08:47:52 +0000 |
commit | d4bca924dd7ebe1b57f15de3e741f0fffcb67225 (patch) | |
tree | 0da7cdde17b8bbce4596d9d4a3d4e5069b78208d /basic/source/runtime | |
parent | 56c4deae00e42719652b3f8cc3375180d7fd801e (diff) |
fdo#43157 - Clean up OSL_ASSERT, DBG_ASSERT
- Clean up OSL_
- Clean up DBG_
- Clean up OUString
Change-Id: I002d17ffbbd8371b0518ede34931b2eea30865a3
Reviewed-on: https://gerrit.libreoffice.org/1602
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'basic/source/runtime')
-rw-r--r-- | basic/source/runtime/iosys.cxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/methods1.cxx | 37 | ||||
-rw-r--r-- | basic/source/runtime/runtime.cxx | 7 |
3 files changed, 24 insertions, 22 deletions
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index bc4d78a08836..1fccd9224b38 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -547,7 +547,7 @@ void UCBStream::SetSize( sal_uIntPtr nSize ) { (void)nSize; - OSL_FAIL( "not allowed to call from basic" ); + SAL_WARN("basic", "UCBStream::SetSize not allowed to call from basic" ); SetError( ERRCODE_IO_GENERAL ); } diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 4412eb0424f9..7f7529a1a6de 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -44,6 +44,7 @@ #include <iosys.hxx> #include "sbunoobj.hxx" #include "propacc.hxx" +#include "sal/log.hxx" #include <comphelper/processfactory.hxx> @@ -722,7 +723,7 @@ RTLFUNC(Trim) } else { - rtl::OUString aStr(comphelper::string::strip(rPar.Get(1)->GetOUString(), ' ')); + OUString aStr(comphelper::string::strip(rPar.Get(1)->GetOUString(), ' ')); rPar.Get(0)->PutString(aStr); } } @@ -1197,7 +1198,7 @@ static sal_Bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm, static sal_Bool lcl_WriteReadSbxArray( SbxDimArray& rArr, SvStream* pStrm, sal_Bool bBinary, short nCurDim, short* pOtherDims, sal_Bool bWrite ) { - DBG_ASSERT( nCurDim > 0,"Bad Dim"); + SAL_WARN_IF( nCurDim <= 0,"basic", "Bad Dim"); short nLower, nUpper; if( !rArr.GetDim( nCurDim, nLower, nUpper ) ) return sal_False; @@ -1327,7 +1328,7 @@ RTLFUNC(Environ) const char* pEnvStr = getenv(aByteStr.getStr()); if ( pEnvStr ) { - aResult = rtl::OUString::createFromAscii( pEnvStr ); + aResult = OUString::createFromAscii( pEnvStr ); } rPar.Get(0)->PutString( aResult ); } @@ -2673,7 +2674,7 @@ void CallFunctionAccessFunction( const Sequence< Any >& aArgs, const rtl::OUStri Reference< XMultiServiceFactory > xFactory( getProcessServiceFactory() ); if( xFactory.is() ) { - xFunc.set( xFactory->createInstance(OUString("com.sun.star.sheet.FunctionAccess")), UNO_QUERY_THROW); + xFunc.set( xFactory->createInstance("com.sun.star.sheet.FunctionAccess"), UNO_QUERY_THROW); } } Any aRet = xFunc->callFunction( sFuncName, aArgs ); @@ -2708,7 +2709,7 @@ RTLFUNC(SYD) aParams[ 2 ] <<= makeAny( rPar.Get(3)->GetDouble() ); aParams[ 3 ] <<= makeAny( rPar.Get(4)->GetDouble() ); - CallFunctionAccessFunction( aParams, OUString( "SYD" ), rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "SYD", rPar.Get( 0 ) ); } RTLFUNC(SLN) @@ -2731,7 +2732,7 @@ RTLFUNC(SLN) aParams[ 1 ] <<= makeAny( rPar.Get(2)->GetDouble() ); aParams[ 2 ] <<= makeAny( rPar.Get(3)->GetDouble() ); - CallFunctionAccessFunction( aParams, OUString( "SLN" ), rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "SLN", rPar.Get( 0 ) ); } RTLFUNC(Pmt) @@ -2776,7 +2777,7 @@ RTLFUNC(Pmt) aParams[ 3 ] <<= fv; aParams[ 4 ] <<= type; - CallFunctionAccessFunction( aParams, OUString( "Pmt" ), rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "Pmt", rPar.Get( 0 ) ); } RTLFUNC(PPmt) @@ -2823,7 +2824,7 @@ RTLFUNC(PPmt) aParams[ 4 ] <<= fv; aParams[ 5 ] <<= type; - CallFunctionAccessFunction( aParams, OUString( "PPmt" ), rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "PPmt", rPar.Get( 0 ) ); } RTLFUNC(PV) @@ -2868,7 +2869,7 @@ RTLFUNC(PV) aParams[ 3 ] <<= fv; aParams[ 4 ] <<= type; - CallFunctionAccessFunction( aParams, OUString( "PV" ), rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "PV", rPar.Get( 0 ) ); } RTLFUNC(NPV) @@ -2896,7 +2897,7 @@ RTLFUNC(NPV) aParams[ 1 ] <<= aValues; - CallFunctionAccessFunction( aParams, OUString( "NPV" ), rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "NPV", rPar.Get( 0 ) ); } RTLFUNC(NPer) @@ -2941,7 +2942,7 @@ RTLFUNC(NPer) aParams[ 3 ] <<= fv; aParams[ 4 ] <<= type; - CallFunctionAccessFunction( aParams, OUString( "NPer" ), rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "NPer", rPar.Get( 0 ) ); } RTLFUNC(MIRR) @@ -2972,7 +2973,7 @@ RTLFUNC(MIRR) aParams[ 1 ] <<= makeAny( rPar.Get(2)->GetDouble() ); aParams[ 2 ] <<= makeAny( rPar.Get(3)->GetDouble() ); - CallFunctionAccessFunction( aParams, OUString( "MIRR" ), rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "MIRR", rPar.Get( 0 ) ); } RTLFUNC(IRR) @@ -3009,7 +3010,7 @@ RTLFUNC(IRR) aParams[ 0 ] <<= aValues; aParams[ 1 ] <<= guess; - CallFunctionAccessFunction( aParams, OUString( "IRR" ), rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "IRR", rPar.Get( 0 ) ); } RTLFUNC(IPmt) @@ -3056,7 +3057,7 @@ RTLFUNC(IPmt) aParams[ 4 ] <<= fv; aParams[ 5 ] <<= type; - CallFunctionAccessFunction( aParams, OUString( "IPmt" ), rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "IPmt", rPar.Get( 0 ) ); } RTLFUNC(FV) @@ -3101,7 +3102,7 @@ RTLFUNC(FV) aParams[ 3 ] <<= pv; aParams[ 4 ] <<= type; - CallFunctionAccessFunction( aParams, OUString( "FV" ), rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "FV", rPar.Get( 0 ) ); } RTLFUNC(DDB) @@ -3140,7 +3141,7 @@ RTLFUNC(DDB) aParams[ 3 ] <<= period; aParams[ 4 ] <<= factor; - CallFunctionAccessFunction( aParams, OUString( "DDB" ), rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "DDB", rPar.Get( 0 ) ); } RTLFUNC(Rate) @@ -3199,7 +3200,7 @@ RTLFUNC(Rate) aParams[ 4 ] <<= type; aParams[ 5 ] <<= guess; - CallFunctionAccessFunction( aParams, OUString( "Rate" ), rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "Rate", rPar.Get( 0 ) ); } RTLFUNC(StrReverse) @@ -3220,7 +3221,7 @@ RTLFUNC(StrReverse) return; } - rtl::OUString aStr = comphelper::string::reverseString(pSbxVariable->GetOUString()); + OUString aStr = comphelper::string::reverseString(pSbxVariable->GetOUString()); rPar.Get(0)->PutString( aStr ); } diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index f8309a0bf1af..eba60649f255 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -34,6 +34,7 @@ #include <com/sun/star/container/XEnumerationAccess.hpp> #include "sbunoobj.hxx" #include "errobject.hxx" +#include "sal/log.hxx" #include "comenumwrapper.hxx" @@ -303,7 +304,7 @@ SbiInstance::~SbiInstance() } catch( const Exception& ) { - OSL_FAIL( "SbiInstance::~SbiInstance: caught an exception while disposing the components!" ); + SAL_WARN("basic", "SbiInstance::~SbiInstance: caught an exception while disposing the components!" ); } ComponentVector.clear(); @@ -916,7 +917,7 @@ sal_Int32 SbiRuntime::translateErrorToVba( SbError nError, OUString& rMsg ) // TEST, has to be vb here always #ifdef DBG_UTIL SbError nTmp = StarBASIC::GetSfxFromVBError( (sal_uInt16)nError ); - DBG_ASSERT( nTmp, "No VB error!" ); + SAL_WARN_IF( nTmp == 0, "basic", "No VB error!" ); #endif StarBASIC::MakeErrorText( nError, rMsg ); @@ -964,7 +965,7 @@ SbxVariableRef SbiRuntime::PopVar() SbxVariableRef xVar = refExprStk->Get( --nExprLvl ); #ifdef DBG_UTIL if ( xVar->GetName().equalsAscii( "Cells" ) ) - OSL_TRACE( "" ); + SAL_INFO("basic", "" ); #endif // methods hold themselves in parameter 0 if( xVar->IsA( TYPE(SbxMethod) ) ) |