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

Adapt to sal/log.hxx

Change-Id: Ibb4549bcca6dd93ae31ef84fbb34f5054d50fe7b
üst 3afc2760
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <sal/config.h>
#include <iomanip>
#include <tools/stream.hxx> #include <tools/stream.hxx>
#include <basic/sbx.hxx> #include <basic/sbx.hxx>
#include "sbxres.hxx" #include "sbxres.hxx"
...@@ -212,14 +216,15 @@ SbxVariable* SbxObject::FindUserData( sal_uInt32 nData ) ...@@ -212,14 +216,15 @@ SbxVariable* SbxObject::FindUserData( sal_uInt32 nData )
SbxVariable* SbxObject::Find( const OUString& rName, SbxClassType t ) SbxVariable* SbxObject::Find( const OUString& rName, SbxClassType t )
{ {
#ifdef DBG_UTIL #ifdef DBG_UTIL
static sal_uInt16 nLvl = 0; static int nLvl = 1;
static const char* pCls[] = { "DontCare","Array","Value","Variable","Method","Property","Object" }; static const char* pCls[] = { "DontCare","Array","Value","Variable","Method","Property","Object" };
OString aNameStr1(OUStringToOString(rName, RTL_TEXTENCODING_ASCII_US)); SAL_INFO(
OString aNameStr2(OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US)); "basic.sbx",
DbgOutf( "SBX: Search %.*s %s %s in %s", "search" << std::setw(nLvl) << " "
nLvl++, " ", << (t >= SbxCLASS_DONTCARE && t <= SbxCLASS_OBJECT
( t >= SbxCLASS_DONTCARE && t <= SbxCLASS_OBJECT ) ? pCls[t - 1] : "Unknown class")
? pCls[ t-1 ] : "Unknown class", aNameStr1.getStr(), aNameStr2.getStr() ); << " " << rName << " in " << SbxVariable::GetName());
++nLvl;
#endif #endif
if( !GetAll( t ) ) if( !GetAll( t ) )
...@@ -279,14 +284,11 @@ SbxVariable* SbxObject::Find( const OUString& rName, SbxClassType t ) ...@@ -279,14 +284,11 @@ SbxVariable* SbxObject::Find( const OUString& rName, SbxClassType t )
} }
} }
#ifdef DBG_UTIL #ifdef DBG_UTIL
nLvl--; --nLvl;
if( pRes ) SAL_INFO_IF(
{ pRes, "basic.sbx",
OString aNameStr3(OUStringToOString(rName, RTL_TEXTENCODING_ASCII_US)); "found" << std::setw(nLvl) << " " << rName << " in "
OString aNameStr4(OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US)); << SbxVariable::GetName());
DbgOutf( "SBX: Found %.*s %s in %s",
nLvl, " ", aNameStr3.getStr(), aNameStr4.getStr() );
}
#endif #endif
return pRes; return pRes;
} }
...@@ -498,12 +500,13 @@ void SbxObject::Insert( SbxVariable* pVar ) ...@@ -498,12 +500,13 @@ void SbxObject::Insert( SbxVariable* pVar )
{ {
aVarName = PTR_CAST(SbxObject,pVar)->GetClassName(); aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
} }
OString aNameStr1(OUStringToOString(aVarName, RTL_TEXTENCODING_ASCII_US)); SAL_INFO(
OString aNameStr2(OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US)); "basic.sbx",
DbgOutf( "SBX: Insert %s %s in %s", "insert "
( pVar->GetClass() >= SbxCLASS_DONTCARE && << ((pVar->GetClass() >= SbxCLASS_DONTCARE
pVar->GetClass() <= SbxCLASS_OBJECT ) && pVar->GetClass() <= SbxCLASS_OBJECT)
? pCls[ pVar->GetClass()-1 ] : "Unknown class", aNameStr1.getStr(), aNameStr2.getStr() ); ? pCls[pVar->GetClass() - 1] : "Unknown class")
<< " " << aVarName << " in " << SbxVariable::GetName());
#endif #endif
} }
} }
...@@ -541,12 +544,13 @@ void SbxObject::QuickInsert( SbxVariable* pVar ) ...@@ -541,12 +544,13 @@ void SbxObject::QuickInsert( SbxVariable* pVar )
{ {
aVarName = PTR_CAST(SbxObject,pVar)->GetClassName(); aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
} }
OString aNameStr1(OUStringToOString(aVarName, RTL_TEXTENCODING_ASCII_US)); SAL_INFO(
OString aNameStr2(OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US)); "basic.sbx",
DbgOutf( "SBX: Insert %s %s in %s", "insert "
( pVar->GetClass() >= SbxCLASS_DONTCARE && << ((pVar->GetClass() >= SbxCLASS_DONTCARE
pVar->GetClass() <= SbxCLASS_OBJECT ) && pVar->GetClass() <= SbxCLASS_OBJECT)
? pCls[ pVar->GetClass()-1 ] : "Unknown class", aNameStr1.getStr(), aNameStr2.getStr() ); ? pCls[pVar->GetClass() - 1] : "Unknown class")
<< " " << aVarName << " in " << SbxVariable::GetName());
#endif #endif
} }
} }
...@@ -568,10 +572,9 @@ void SbxObject::Remove( SbxVariable* pVar ) ...@@ -568,10 +572,9 @@ void SbxObject::Remove( SbxVariable* pVar )
{ {
aVarName = PTR_CAST(SbxObject,pVar)->GetClassName(); aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
} }
OString aNameStr1(OUStringToOString(aVarName, RTL_TEXTENCODING_ASCII_US)); SAL_INFO(
OString aNameStr2(OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US)); "basic.sbx",
DbgOutf( "SBX: Remove %s in %s", "remove " << aVarName << " in " << SbxVariable::GetName());
aNameStr1.getStr(), aNameStr2.getStr() );
#endif #endif
SbxVariableRef pVar_ = pArray->Get( nIdx ); SbxVariableRef pVar_ = pArray->Get( nIdx );
if( pVar_->IsBroadcaster() ) if( pVar_->IsBroadcaster() )
......
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