summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorRadu Ioan <ioan.radu.g@gmail.com>2013-01-09 00:14:10 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-01-14 08:47:52 +0000
commitd4bca924dd7ebe1b57f15de3e741f0fffcb67225 (patch)
tree0da7cdde17b8bbce4596d9d4a3d4e5069b78208d /basic
parent56c4deae00e42719652b3f8cc3375180d7fd801e (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')
-rw-r--r--basic/source/classes/sbxmod.cxx97
-rw-r--r--basic/source/runtime/iosys.cxx2
-rw-r--r--basic/source/runtime/methods1.cxx37
-rw-r--r--basic/source/runtime/runtime.cxx7
4 files changed, 73 insertions, 70 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index dc6688777f99..33abb260f1b3 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -37,6 +37,7 @@
#include "sbunoobj.hxx"
#include <svtools/syntaxhighlight.hxx>
+#include "sal/log.hxx"
#include <basic/basrdll.hxx>
#include <osl/mutex.hxx>
@@ -162,7 +163,7 @@ DocObjectWrapper::DocObjectWrapper( SbModule* pVar ) : m_pMod( pVar ), mName( pV
}
catch(const Exception& )
{
- OSL_FAIL( "DocObjectWrapper::DocObjectWrapper: Caught exception!" );
+ SAL_WARN( "basic", "DocObjectWrapper::DocObjectWrapper: Caught exception!" );
}
}
@@ -188,19 +189,19 @@ void SAL_CALL
DocObjectWrapper::acquire() throw ()
{
osl_atomic_increment( &m_refCount );
- OSL_TRACE("DocObjectWrapper::acquire(%s) 0x%x refcount is now %d", rtl::OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr(), this, m_refCount );
+ SAL_INFO("basic","DocObjectWrapper::acquire("<< OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr() << ") 0x" << this << " refcount is now " << m_refCount );
}
void SAL_CALL
DocObjectWrapper::release() throw ()
{
if ( osl_atomic_decrement( &m_refCount ) == 0 )
{
- OSL_TRACE("DocObjectWrapper::release(%s) 0x%x refcount is now %d", rtl::OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr(), this, m_refCount );
+ SAL_INFO("basic","DocObjectWrapper::release("<< OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr() << ") 0x" << this << " refcount is now " << m_refCount );
delete this;
}
else
{
- OSL_TRACE("DocObjectWrapper::release(%s) 0x%x refcount is now %d", rtl::OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr(), this, m_refCount );
+ SAL_INFO("basic","DocObjectWrapper::release("<< OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr() << ") 0x" << this << " refcount is now " << m_refCount );
}
}
@@ -266,7 +267,7 @@ DocObjectWrapper::invoke( const OUString& aFunctionName, const Sequence< Any >&
sal_Int32 nSbxCount = n - 1;
if ( nParamsCount < nSbxCount - nSbxOptional )
{
- throw RuntimeException( OUString( "wrong number of parameters!" ), Reference< XInterface >() );
+ throw RuntimeException( "wrong number of parameters!", Reference< XInterface >() );
}
}
// set parameters
@@ -451,7 +452,7 @@ uno::Reference< vba::XVBACompatibility > getVBACompatibility( const uno::Referen
try
{
uno::Reference< beans::XPropertySet > xModelProps( rxModel, uno::UNO_QUERY_THROW );
- xVBACompat.set( xModelProps->getPropertyValue( OUString( "BasicLibraries" ) ), uno::UNO_QUERY );
+ xVBACompat.set( xModelProps->getPropertyValue( "BasicLibraries" ), uno::UNO_QUERY );
}
catch(const uno::Exception& )
{
@@ -494,7 +495,7 @@ IMPL_LINK( AsyncQuitHandler, OnAsyncQuit, void*, /*pNull*/ )
// could be found from other module.
SbModule::SbModule( const OUString& rName, sal_Bool bVBACompat )
- : SbxObject( OUString("StarBASICModule") ),
+ : SbxObject( "StarBASICModule" ),
pImage( NULL ), pBreaks( NULL ), pClassData( NULL ), mbVBACompat( bVBACompat ), pDocObject( NULL ), bIsProxyModule( false )
{
SetName( rName );
@@ -502,7 +503,7 @@ SbModule::SbModule( const OUString& rName, sal_Bool bVBACompat )
SetModuleType( script::ModuleType::NORMAL );
// #i92642: Set name property to intitial name
- SbxVariable* pNameProp = pProps->Find( OUString("Name"), SbxCLASS_PROPERTY );
+ SbxVariable* pNameProp = pProps->Find( "Name", SbxCLASS_PROPERTY );
if( pNameProp != NULL )
{
pNameProp->PutString( GetName() );
@@ -511,7 +512,7 @@ SbModule::SbModule( const OUString& rName, sal_Bool bVBACompat )
SbModule::~SbModule()
{
- OSL_TRACE("Module named %s is destructing", rtl::OUStringToOString( GetName(), RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_INFO("basic","Module named " << OUStringToOString( GetName(), RTL_TEXTENCODING_UTF8 ).getStr() << " is destructing");
delete pImage;
delete pBreaks;
delete pClassData;
@@ -524,7 +525,7 @@ SbModule::GetUnoModule()
if ( !mxWrapper.is() )
mxWrapper = new DocObjectWrapper( this );
- OSL_TRACE("Module named %s returning wrapper mxWrapper (0x%x)", rtl::OUStringToOString( GetName(), RTL_TEXTENCODING_UTF8 ).getStr(), mxWrapper.get() );
+ SAL_INFO("basic","Module named " << OUStringToOString( GetName(), RTL_TEXTENCODING_UTF8 ).getStr() << " returning wrapper mxWrapper (0x" << mxWrapper.get() <<")" );
return mxWrapper;
}
@@ -1097,7 +1098,7 @@ void SbModule::SetVBACompat( bool bCompat )
{
StarBASIC* pBasic = static_cast< StarBASIC* >( GetParent() );
uno::Reference< lang::XMultiServiceFactory > xFactory( getDocumentModel( pBasic ), uno::UNO_QUERY_THROW );
- xFactory->createInstance( OUString("ooo.vba.VBAGlobals") );
+ xFactory->createInstance( "ooo.vba.VBAGlobals" );
}
catch( Exception& )
{
@@ -1108,7 +1109,7 @@ void SbModule::SetVBACompat( bool bCompat )
// Run a Basic-subprogram
sal_uInt16 SbModule::Run( SbMethod* pMeth )
{
- OSL_TRACE("About to run %s, vba compatmode is %d", rtl::OUStringToOString( pMeth->GetName(), RTL_TEXTENCODING_UTF8 ).getStr(), mbVBACompat );
+ SAL_INFO("basic","About to run " << OUStringToOString( pMeth->GetName(), RTL_TEXTENCODING_UTF8 ).getStr() << ", vba compatmode is " << mbVBACompat );
static sal_uInt16 nMaxCallLevel = 0;
sal_uInt16 nRes = 0;
@@ -1144,7 +1145,7 @@ sal_uInt16 SbModule::Run( SbMethod* pMeth )
// Launcher problem
// i80726 The Find below will genarate an error in Testtool so we reset it unless there was one before already
sal_Bool bWasError = SbxBase::GetError() != 0;
- SbxVariable* pMSOMacroRuntimeLibVar = Find( OUString("Launcher"), SbxCLASS_OBJECT );
+ SbxVariable* pMSOMacroRuntimeLibVar = Find( "Launcher", SbxCLASS_OBJECT );
if ( !bWasError && (SbxBase::GetError() == SbxERR_PROC_UNDEFINED) )
SbxBase::ResetError();
if( pMSOMacroRuntimeLibVar )
@@ -1154,7 +1155,7 @@ sal_uInt16 SbModule::Run( SbMethod* pMeth )
{
sal_uInt16 nGblFlag = pMSOMacroRuntimeLib->GetFlags() & SBX_GBLSEARCH;
pMSOMacroRuntimeLib->ResetFlag( SBX_GBLSEARCH );
- SbxVariable* pAppSymbol = pMSOMacroRuntimeLib->Find( OUString("Application"), SbxCLASS_METHOD );
+ SbxVariable* pAppSymbol = pMSOMacroRuntimeLib->Find( "Application", SbxCLASS_METHOD );
pMSOMacroRuntimeLib->SetFlag( nGblFlag );
if( pAppSymbol )
{
@@ -1255,7 +1256,7 @@ sal_uInt16 SbModule::Run( SbMethod* pMeth )
clearNativeObjectWrapperVector();
- DBG_ASSERT(GetSbData()->pInst->nCallLvl==0,"BASIC-Call-Level > 0");
+ SAL_WARN_IF(GetSbData()->pInst->nCallLvl != 0,"basic","BASIC-Call-Level > 0");
delete GetSbData()->pInst, GetSbData()->pInst = NULL, bDelInst = false;
// #i30690
@@ -1547,7 +1548,7 @@ const sal_uInt8* SbModule::FindNextStmnt( const sal_uInt8* p, sal_uInt16& nLine,
nPC++;
if( bFollowJumps && eOp == _JUMP && pImg )
{
- DBG_ASSERT( pImg, "FindNextStmnt: pImg==NULL with FollowJumps option" );
+ SAL_WARN_IF( !pImg, "basic", "FindNextStmnt: pImg==NULL with FollowJumps option" );
sal_uInt32 nOp1 = *p++; nOp1 |= *p++ << 8;
nOp1 |= *p++ << 16; nOp1 |= *p++ << 24;
p = (const sal_uInt8*) pImg->GetCode() + nOp1;
@@ -2108,7 +2109,7 @@ ErrCode SbMethod::Call( SbxValue* pRet, SbxVariable* pCaller )
{
if ( pCaller )
{
- OSL_TRACE("SbMethod::Call Have been passed a caller 0x%x", pCaller );
+ SAL_INFO("basic", "SbMethod::Call Have been passed a caller 0x" << pCaller );
mCaller = pCaller;
}
// RefCount vom Modul hochzaehlen
@@ -2203,7 +2204,7 @@ SbObjModule::SbObjModule( const OUString& rName, const com::sun::star::script::M
SetModuleType( mInfo.ModuleType );
if ( mInfo.ModuleType == script::ModuleType::FORM )
{
- SetClassName( OUString("Form" ) );
+ SetClassName( "Form" );
}
else if ( mInfo.ModuleObject.is() )
{
@@ -2224,13 +2225,13 @@ SbObjModule::SetUnoObject( const uno::Any& aObj ) throw ( uno::RuntimeException
pDocObject = new SbUnoObject( GetName(), uno::makeAny( aObj ) );
com::sun::star::uno::Reference< com::sun::star::lang::XServiceInfo > xServiceInfo( aObj, com::sun::star::uno::UNO_QUERY_THROW );
- if( xServiceInfo->supportsService( OUString("ooo.vba.excel.Worksheet" ) ) )
+ if( xServiceInfo->supportsService( "ooo.vba.excel.Worksheet" ) )
{
- SetClassName( OUString("Worksheet" ) );
+ SetClassName( "Worksheet" );
}
- else if( xServiceInfo->supportsService( OUString("ooo.vba.excel.Workbook" ) ) )
+ else if( xServiceInfo->supportsService( "ooo.vba.excel.Workbook" ) )
{
- SetClassName( OUString("Workbook" ) );
+ SetClassName( "Workbook" );
}
}
@@ -2282,7 +2283,7 @@ public:
{
if ( mxComponent.is() )
{
- OSL_TRACE("*********** Registering the listeners");
+ SAL_INFO("basic", "*********** Registering the listeners");
try
{
uno::Reference< awt::XTopWindow >( mxComponent, uno::UNO_QUERY_THROW )->addTopWindowListener( this );
@@ -2316,7 +2317,7 @@ public:
{
if ( mxComponent.is() && !mbDisposed )
{
- OSL_TRACE("*********** Removing the listeners");
+ SAL_INFO("basic", "*********** Removing the listeners");
try
{
uno::Reference< awt::XTopWindow >( mxComponent, uno::UNO_QUERY_THROW )->removeTopWindowListener( this );
@@ -2376,14 +2377,14 @@ public:
aParams[0] <<= nCancel;
aParams[1] <<= nCloseMode;
- mpUserForm->triggerMethod( OUString("Userform_QueryClose" ), aParams);
+ mpUserForm->triggerMethod( "Userform_QueryClose", aParams);
return;
}
}
}
- mpUserForm->triggerMethod( OUString("Userform_QueryClose" ) );
+ mpUserForm->triggerMethod( "Userform_QueryClose" );
#endif
}
@@ -2458,7 +2459,7 @@ public:
virtual void SAL_CALL disposing( const lang::EventObject& /*Source*/ ) throw (uno::RuntimeException)
{
- OSL_TRACE("** Userform/Dialog disposing");
+ SAL_INFO("basic", "** Userform/Dialog disposing");
removeListener();
mbDisposed = true;
if ( mpUserForm )
@@ -2480,7 +2481,7 @@ SbUserFormModule::~SbUserFormModule()
void SbUserFormModule::ResetApiObj( bool bTriggerTerminateEvent )
{
- OSL_TRACE(" SbUserFormModule::ResetApiObj( %s )", bTriggerTerminateEvent ? "true" : "false" );
+ SAL_INFO("basic", " SbUserFormModule::ResetApiObj( " << (bTriggerTerminateEvent ? "true )" : "false )") );
if ( bTriggerTerminateEvent && m_xDialog.is() ) // probably someone close the dialog window
{
triggerTerminateEvent();
@@ -2497,7 +2498,7 @@ void SbUserFormModule::triggerMethod( const OUString& aMethodToRun )
void SbUserFormModule::triggerMethod( const OUString& aMethodToRun, Sequence< Any >& aArguments )
{
- OSL_TRACE("*** trigger %s ***", rtl::OUStringToOString( aMethodToRun, RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_INFO("basic", "*** trigger " << OUStringToOString( aMethodToRun, RTL_TEXTENCODING_UTF8 ).getStr() << " ***");
// Search method
SbxVariable* pMeth = SbObjModule::Find( aMethodToRun, SbxCLASS_METHOD );
if( pMeth )
@@ -2538,22 +2539,22 @@ void SbUserFormModule::triggerMethod( const OUString& aMethodToRun, Sequence< An
void SbUserFormModule::triggerActivateEvent( void )
{
- OSL_TRACE("**** entering SbUserFormModule::triggerActivate");
- triggerMethod( OUString( "UserForm_Activate" ) );
- OSL_TRACE("**** leaving SbUserFormModule::triggerActivate");
+ SAL_INFO("basic", "**** entering SbUserFormModule::triggerActivate");
+ triggerMethod( "UserForm_Activate" );
+ SAL_INFO("basic", "**** leaving SbUserFormModule::triggerActivate");
}
void SbUserFormModule::triggerDeactivateEvent( void )
{
- OSL_TRACE("**** SbUserFormModule::triggerDeactivate");
- triggerMethod( OUString("Userform_Deactivate" ) );
+ SAL_INFO("basic", "**** SbUserFormModule::triggerDeactivate");
+ triggerMethod( "Userform_Deactivate" );
}
void SbUserFormModule::triggerInitializeEvent( void )
{
if ( mbInit )
return;
- OSL_TRACE("**** SbUserFormModule::triggerInitializeEvent");
+ SAL_INFO("basic", "**** SbUserFormModule::triggerInitializeEvent");
static OUString aInitMethodName( "Userform_Initialize");
triggerMethod( aInitMethodName );
mbInit = true;
@@ -2561,7 +2562,7 @@ void SbUserFormModule::triggerInitializeEvent( void )
void SbUserFormModule::triggerTerminateEvent( void )
{
- OSL_TRACE("**** SbUserFormModule::triggerTerminateEvent");
+ SAL_INFO("basic", "**** SbUserFormModule::triggerTerminateEvent");
static OUString aTermMethodName( "Userform_Terminate" );
triggerMethod( aTermMethodName );
mbInit=false;
@@ -2608,7 +2609,7 @@ SbxVariable* SbUserFormModuleInstance::Find( const OUString& rName, SbxClassType
void SbUserFormModule::Load()
{
- OSL_TRACE("** load() ");
+ SAL_INFO("basic", "** load() ");
// forces a load
if ( !pDocObject )
InitObject();
@@ -2617,7 +2618,7 @@ void SbUserFormModule::Load()
void SbUserFormModule::Unload()
{
- OSL_TRACE("** Unload() ");
+ SAL_INFO("basic", "** Unload() ");
sal_Int8 nCancel = 0;
sal_Int8 nCloseMode = ::ooo::vba::VbQueryClose::vbFormCode;
@@ -2627,7 +2628,7 @@ void SbUserFormModule::Unload()
aParams[0] <<= nCancel;
aParams[1] <<= nCloseMode;
- triggerMethod( OUString("Userform_QueryClose" ), aParams);
+ triggerMethod( "Userform_QueryClose", aParams);
aParams[0] >>= nCancel;
// basic boolean ( and what the user might use ) can be ambiguous ( e.g. basic true = -1 )
@@ -2643,17 +2644,17 @@ void SbUserFormModule::Unload()
triggerTerminateEvent();
}
// Search method
- SbxVariable* pMeth = SbObjModule::Find( OUString("UnloadObject"), SbxCLASS_METHOD );
+ SbxVariable* pMeth = SbObjModule::Find( "UnloadObject", SbxCLASS_METHOD );
if( pMeth )
{
- OSL_TRACE("Attempting too run the UnloadObjectMethod");
+ SAL_INFO("basic", "Attempting too run the UnloadObjectMethod");
m_xDialog.clear(); //release ref to the uno object
SbxValues aVals;
bool bWaitForDispose = true; // assume dialog is showing
if ( m_DialogListener.get() )
{
bWaitForDispose = m_DialogListener->isShowing();
- OSL_TRACE("Showing %d", bWaitForDispose );
+ SAL_INFO("basic", "Showing " << bWaitForDispose );
}
pMeth->Get( aVals);
if ( !bWaitForDispose )
@@ -2661,7 +2662,7 @@ void SbUserFormModule::Unload()
// we've either already got a dispose or we'er never going to get one
ResetApiObj();
} // else wait for dispose
- OSL_TRACE("UnloadObject completed ( we hope )");
+ SAL_INFO("basic", "UnloadObject completed ( we hope )");
}
}
@@ -2690,14 +2691,14 @@ void SbUserFormModule::InitObject()
try
{
Reference< beans::XPropertySet > xProps( m_xModel, UNO_QUERY_THROW );
- uno::Reference< script::vba::XVBACompatibility > xVBAMode( xProps->getPropertyValue( OUString( "BasicLibraries" ) ), uno::UNO_QUERY_THROW );
+ uno::Reference< script::vba::XVBACompatibility > xVBAMode( xProps->getPropertyValue( "BasicLibraries" ), uno::UNO_QUERY_THROW );
sProjectName = xVBAMode->getProjectName();
}
catch(const Exception& ) {}
sDialogUrl = sDialogUrl + sProjectName + "." + GetName() + "?location=document";
- uno::Reference< awt::XDialogProvider > xProvider( xFactory->createInstanceWithArguments( OUString( "com.sun.star.awt.DialogProvider"), aArgs ), uno::UNO_QUERY_THROW );
+ uno::Reference< awt::XDialogProvider > xProvider( xFactory->createInstanceWithArguments( "com.sun.star.awt.DialogProvider", aArgs ), uno::UNO_QUERY_THROW );
m_xDialog = xProvider->createDialog( sDialogUrl );
// create vba api object
@@ -2706,7 +2707,7 @@ void SbUserFormModule::InitObject()
aArgs[ 1 ] <<= m_xDialog;
aArgs[ 2 ] <<= m_xModel;
aArgs[ 3 ] <<= rtl::OUString( GetParent()->GetName() );
- pDocObject = new SbUnoObject( GetName(), uno::makeAny( xVBAFactory->createInstanceWithArguments( rtl::OUString( "ooo.vba.msforms.UserForm"), aArgs ) ) );
+ pDocObject = new SbUnoObject( GetName(), uno::makeAny( xVBAFactory->createInstanceWithArguments( "ooo.vba.msforms.UserForm", aArgs ) ) );
uno::Reference< lang::XComponent > xComponent( m_xDialog, uno::UNO_QUERY_THROW );
@@ -2721,7 +2722,7 @@ void SbUserFormModule::InitObject()
}
while( pParentBasic == NULL && pCurObject != NULL );
- OSL_ASSERT( pParentBasic != NULL );
+ SAL_WARN_IF( pParentBasic == NULL, "basic", "pParentBasic == NULL" );
registerComponentToBeDisposedForBasic( xComponent, pParentBasic );
// if old listener object exists, remove it from dialog and document model
@@ -2739,7 +2740,7 @@ void SbUserFormModule::InitObject()
}
SbxVariable*
-SbUserFormModule::Find( const rtl::OUString& rName, SbxClassType t )
+SbUserFormModule::Find( const OUString& rName, SbxClassType t )
{
if ( !pDocObject && !GetSbData()->bRunInit && GetSbData()->pInst )
InitObject();
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) ) )