[Libreoffice-commits] .: 2 commits - rsc/inc rsc/source sot/source tools/bootstrp tools/source
Caolán McNamara
caolan at kemper.freedesktop.org
Fri Jul 1 01:09:59 PDT 2011
rsc/inc/rscdef.hxx | 3 -
rsc/source/misc/rscdbl.cxx | 2
rsc/source/parser/erscerr.cxx | 4 -
rsc/source/parser/rscyacc.cxx | 7 +--
rsc/source/rsc/rsc.cxx | 15 +++----
rsc/source/tools/rscdef.cxx | 65 +++++++++++++-----------------
sot/source/base/factory.cxx | 7 +--
tools/bootstrp/mkunroll/mkunroll.cxx | 2
tools/source/generic/config.cxx | 33 ++++++++-------
tools/source/inet/inetmsg.cxx | 47 ++++++++++++----------
tools/source/rc/resmgr.cxx | 74 +++++++++++++++++++----------------
tools/source/ref/errinf.cxx | 36 +++++++++--------
tools/source/ref/pstm.cxx | 20 +++++----
13 files changed, 169 insertions(+), 146 deletions(-)
New commits:
commit b77cfb990afdc6645d0b2c2d0f0cfee0db52b871
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jul 1 08:59:03 2011 +0100
ByteString->rtl::OStringBuffer
diff --git a/rsc/inc/rscdef.hxx b/rsc/inc/rscdef.hxx
index d82dc6f..0f5af47 100644
--- a/rsc/inc/rscdef.hxx
+++ b/rsc/inc/rscdef.hxx
@@ -30,6 +30,7 @@
#include <tools/unqidx.hxx>
#include <rsctree.hxx>
+#include <rtl/strbuf.hxx>
#include <vector>
/****************** C L A S S E S ****************************************/
@@ -70,7 +71,7 @@ public:
((sal_Int32)aExp.aLong.nHi << 16);
}
sal_Bool Evaluate( sal_Int32 * pValue ) const;
- void GetMacro( ByteString & ) const;
+ void AppendMacro( rtl::OStringBuffer & ) const;
};
/*********** R s c I d ***************************************************/
diff --git a/rsc/source/misc/rscdbl.cxx b/rsc/source/misc/rscdbl.cxx
index f566478..401164a 100644
--- a/rsc/source/misc/rscdbl.cxx
+++ b/rsc/source/misc/rscdbl.cxx
@@ -52,7 +52,7 @@ REResourceList * InsertList( Atom nClassName, const RscId& rId,
if( pStrClass )
aStrClass = pStrClass;
else
- aStrClass = ByteString::CreateFromInt32( (long)nClassName );
+ aStrClass = rtl::OString::valueOf(static_cast<sal_Int32>(nClassName));
pSubList = new REResourceList( pList, aStrClass, rId );
diff --git a/rsc/source/parser/erscerr.cxx b/rsc/source/parser/erscerr.cxx
index a6b6faf..8746990 100644
--- a/rsc/source/parser/erscerr.cxx
+++ b/rsc/source/parser/erscerr.cxx
@@ -123,9 +123,9 @@ void RscError::WriteError( const ERRTYPE& rError, const char * pMessage )
case ERR_ERROR: {
StdLstErr( "!! " );
if( 1 == nErrors )
- StdLstErr( ByteString::CreateFromInt32( nErrors ).GetBuffer() );
+ StdLstErr(rtl::OString::valueOf(static_cast<sal_Int32>(nErrors )).getStr());
else
- StdLstErr( ByteString::CreateFromInt32( (nErrors -1) ).GetBuffer() );
+ StdLstErr(rtl::OString::valueOf(static_cast<sal_Int32>(nErrors -1)).getStr());
StdLstErr( " Error" );
StdLstErr( " found!!" );
}
diff --git a/rsc/source/parser/rscyacc.cxx b/rsc/source/parser/rscyacc.cxx
index f70f207..8c505a8 100644
--- a/rsc/source/parser/rscyacc.cxx
+++ b/rsc/source/parser/rscyacc.cxx
@@ -111,15 +111,16 @@ void SetString( const RSCINST & rInst, const char * pVarName, const char * pStr
RscId MakeRscId( RscExpType aExpType )
{
- if( !aExpType.IsNothing() ){
- sal_Int32 lValue;
+ if( !aExpType.IsNothing() )
+ {
+ sal_Int32 lValue(0);
if( !aExpType.Evaluate( &lValue ) )
pTC->pEH->Error( ERR_ZERODIVISION, NULL, RscId() );
if( lValue < 1 || lValue > (sal_Int32)0x7FFF )
{
pTC->pEH->Error( ERR_IDRANGE, NULL, RscId(),
- ByteString::CreateFromInt32( lValue ).GetBuffer() );
+ rtl::OString::valueOf(lValue).getStr() );
}
if( aExpType.IsDefinition() )
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index e2fedb2..40717c4 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -1248,7 +1248,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
sal_Int32 nNumber = atoi( aLine.GetBuffer() );
if( nNumber < 10000 )
- aBaseFileName += ByteString::CreateFromInt32( 0 );
+ aBaseFileName += '0';
if( GetImageFilePath( rOutputFile, rContext, aBaseFileName += aLine , aFilePath, pSysListFile ) )
aEntryVector.push_back( ::std::pair< ByteString, sal_Int32 >( aFilePath, nNumber ) );
@@ -1276,14 +1276,15 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
for( sal_uInt32 i = 0; i < aEntryVector.size(); ++i )
{
- ByteString aEntryString( "< \"" );
+ rtl::OStringBuffer aEntryString(
+ RTL_CONSTASCII_STRINGPARAM("< \""));
- aEntryString += aEntryVector[ i ].first;
- aEntryString += "\"; ";
- aEntryString += ByteString::CreateFromInt32( aEntryVector[ i ].second );
- aEntryString += "; >;";
+ aEntryString.append(aEntryVector[i].first);
+ aEntryString.append(RTL_CONSTASCII_STRINGPARAM("\"; "));
+ aEntryString.append(static_cast<sal_Int32>(aEntryVector[ i ].second));
+ aEntryString.append(RTL_CONSTASCII_STRINGPARAM("; >;"));
- aOStm.WriteLine( aEntryString );
+ aOStm.WriteLine(aEntryString.makeStringAndClear());
}
aOStm.WriteLine( "};" );
diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx
index 6f2e642..3b92996 100644
--- a/rsc/source/tools/rscdef.cxx
+++ b/rsc/source/tools/rscdef.cxx
@@ -170,17 +170,17 @@ RscId::operator sal_Int32() const
*************************************************************************/
ByteString RscId::GetName() const
{
- ByteString aStr;
+ rtl::OStringBuffer aStr;
if ( !aExp.IsNothing() )
{
if( bNames )
- aExp.GetMacro( aStr );
+ aExp.AppendMacro(aStr);
else
- aStr = ByteString::CreateFromInt32( GetNumber() );
+ aStr.append(GetNumber());
}
- return aStr;
+ return aStr.makeStringAndClear();
}
/*************************************************************************
@@ -190,14 +190,14 @@ ByteString RscId::GetName() const
*************************************************************************/
ByteString RscId::GetMacro() const
{
- ByteString aStr;
+ rtl::OStringBuffer aStr;
if ( aExp.IsDefinition() )
- aStr = aExp.aExp.pDef->GetMacro();
+ aStr.append(aExp.aExp.pDef->GetMacro());
else
- aExp.GetMacro( aStr );
+ aExp.AppendMacro(aStr);
- return aStr;
+ return aStr.makeStringAndClear();
}
/****************** R s c D e f i n e ************************************/
@@ -259,7 +259,7 @@ void RscDefine::DefineToNumber()
if( pExp )
delete pExp;
pExp = NULL;
- SetName( ByteString::CreateFromInt32( lId ) );
+ SetName(rtl::OString::valueOf(lId));
}
/*************************************************************************
@@ -314,7 +314,7 @@ ByteString RscDefine::GetMacro()
{
if( pExp )
return pExp->GetMacro();
- return ByteString::CreateFromInt32( lId );
+ return rtl::OString::valueOf(lId);
}
/****************** R s c D e f i n e L i s t ****************************/
@@ -459,23 +459,14 @@ sal_Bool RscExpType::Evaluate( sal_Int32 * plValue ) const{
return sal_True;
}
-/*************************************************************************
-|*
-|* RscExpType::GetMacro()
-|*
-*************************************************************************/
-void RscExpType::GetMacro( ByteString & rStr ) const
+void RscExpType::AppendMacro(rtl::OStringBuffer& rStr) const
{
- ByteString aStr;
-
if( IsDefinition() )
- {
- rStr += aExp.pDef->GetName();
- }
+ rStr.append(aExp.pDef->GetName());
else if( IsExpression() )
- rStr += aExp.pExp->GetMacro();
+ rStr.append(aExp.pExp->GetMacro());
else if( IsNumber() )
- rStr += ByteString::CreateFromInt32( GetLong() );
+ rStr.append(GetLong());
}
@@ -555,38 +546,38 @@ sal_Bool RscExpression::Evaluate( sal_Int32 * plValue ){
*************************************************************************/
ByteString RscExpression::GetMacro()
{
- ByteString aLeft;
+ rtl::OStringBuffer aLeft;
// Ausgabeoptimierung
if( aLeftExp.IsNothing() )
{
if ( '-' == cOperation )
{
- aLeft += '(';
- aLeft += '-';
+ aLeft.append('(');
+ aLeft.append('-');
}
- aRightExp.GetMacro( aLeft );
+ aRightExp.AppendMacro(aLeft);
if( '-' == cOperation )
- aLeft += ')';
+ aLeft.append(')');
}
else if( aRightExp.IsNothing() )
- aLeftExp.GetMacro( aLeft );
+ aLeftExp.AppendMacro(aLeft);
else{
- aLeft += '(';
+ aLeft.append('(');
// linken Zweig auswerten
- aLeftExp.GetMacro( aLeft );
+ aLeftExp.AppendMacro(aLeft);
- aLeft += cOperation;
+ aLeft.append(cOperation);
- aLeft += '(';
+ aLeft.append('(');
// rechten Zweig auswerten
- aRightExp.GetMacro( aLeft );
- aLeft += ')';
+ aRightExp.AppendMacro(aLeft);
+ aLeft.append(')');
- aLeft += ')';
+ aLeft.append(')');
}
- return aLeft;
+ return aLeft.makeStringAndClear();
}
/****************** R s c F i l e ****************************************/
commit 2f69e80ecf44d0efeeb623078fda7c2c644cd05f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jun 30 22:54:36 2011 +0100
ByteString::CreateFromInt32 -> OString::valueOf
diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx
index 01d098e..7939337 100644
--- a/sot/source/base/factory.cxx
+++ b/sot/source/base/factory.cxx
@@ -39,6 +39,7 @@
#include <sot/sotdata.hxx>
#include <sot/clsids.hxx>
#include <rtl/instance.hxx>
+#include <rtl/strbuf.hxx>
/************** class SotData_Impl *********************************************/
/*************************************************************************
@@ -78,9 +79,9 @@ void SotFactory::DeInit()
if( pSotData->nSvObjCount )
{
#ifdef DBG_UTIL
- ByteString aStr( "Objects alive: " );
- aStr.Append( ByteString::CreateFromInt32( pSotData->nSvObjCount ) );
- DBG_WARNING( aStr.GetBuffer() );
+ rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Objects alive: "));
+ aStr.append(static_cast<sal_Int32>(pSotData->nSvObjCount));
+ DBG_WARNING(aStr.getStr());
#endif
return;
}
diff --git a/tools/bootstrp/mkunroll/mkunroll.cxx b/tools/bootstrp/mkunroll/mkunroll.cxx
index 6ee1f07..fdb39a6 100644
--- a/tools/bootstrp/mkunroll/mkunroll.cxx
+++ b/tools/bootstrp/mkunroll/mkunroll.cxx
@@ -212,7 +212,7 @@ void MkFilter::Filter()
{
MkLine *pMkLine = (*pLine->pPrivateTnrLst)[ i ];
ByteString aLine = pMkLine->aLine;
- while( aLine.SearchAndReplace( aTnr, ByteString::CreateFromInt32( n )) != (sal_uInt16)-1 ) ;
+ while( aLine.SearchAndReplace( aTnr, rtl::OString::valueOf(static_cast<sal_Int32>(n)) ) != (sal_uInt16)-1 ) ;
fputs( aLine.GetBuffer(), pOut );
fprintf( stderr, "o" );
}
diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx
index 0e8a2f5..d8e3abe 100644
--- a/tools/source/generic/config.cxx
+++ b/tools/source/generic/config.cxx
@@ -45,6 +45,7 @@
#include <tools/debug.hxx>
#include <tools/config.hxx>
#include <osl/security.h>
+#include <rtl/strbuf.hxx>
#define MAXBUFLEN 1024 // Fuer Buffer bei VOS-Funktionen
@@ -1188,13 +1189,15 @@ sal_uInt16 Config::GetKeyCount() const
ByteString Config::GetKeyName( sal_uInt16 nKey ) const
{
#ifdef DBG_UTIL
- ByteString aTraceStr( "Config::GetKeyName( " );
- aTraceStr += ByteString::CreateFromInt32(nKey);
- aTraceStr += " ) from ";
- aTraceStr += GetGroup();
- aTraceStr += " in ";
- aTraceStr += ByteString( maFileName, RTL_TEXTENCODING_UTF8 );
- OSL_TRACE( "%s", aTraceStr.GetBuffer() );
+ rtl::OStringBuffer aTraceStr(
+ RTL_CONSTASCII_STRINGPARAM("Config::GetKeyName( "));
+ aTraceStr.append(static_cast<sal_Int32>(nKey));
+ aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" ) from "));
+ aTraceStr.append(GetGroup());
+ aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" in "));
+ aTraceStr.append(rtl::OUStringToOString(
+ maFileName, RTL_TEXTENCODING_UTF8));
+ OSL_TRACE("%s", aTraceStr.getStr());
#endif
// Key suchen und Name zurueckgeben
@@ -1223,13 +1226,15 @@ ByteString Config::GetKeyName( sal_uInt16 nKey ) const
ByteString Config::ReadKey( sal_uInt16 nKey ) const
{
#ifdef DBG_UTIL
- ByteString aTraceStr( "Config::ReadKey( " );
- aTraceStr += ByteString::CreateFromInt32( nKey );
- aTraceStr += " ) from ";
- aTraceStr += GetGroup();
- aTraceStr += " in ";
- aTraceStr += ByteString( maFileName, RTL_TEXTENCODING_UTF8 );
- OSL_TRACE( "%s", aTraceStr.GetBuffer() );
+ rtl::OStringBuffer aTraceStr(
+ RTL_CONSTASCII_STRINGPARAM("Config::ReadKey( "));
+ aTraceStr.append(static_cast<sal_Int32>(nKey));
+ aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" ) from "));
+ aTraceStr.append(GetGroup());
+ aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" in "));
+ aTraceStr.append(rtl::OUStringToOString(maFileName,
+ RTL_TEXTENCODING_UTF8));
+ OSL_TRACE("%s", aTraceStr.getStr());
#endif
// Key suchen und Value zurueckgeben
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx
index ec21249..eac75e3 100644
--- a/tools/source/inet/inetmsg.cxx
+++ b/tools/source/inet/inetmsg.cxx
@@ -34,6 +34,7 @@
#include <tools/inetmsg.hxx>
#include <tools/inetstrm.hxx>
#include <rtl/instance.hxx>
+#include <rtl/strbuf.hxx>
#include <stdio.h>
@@ -367,41 +368,47 @@ sal_Bool INetRFC822Message::GenerateDateField (
(rDateTime.GetHour() > 23) ) return sal_False;
// Prepare output string.
- ByteString rDateField;
+ rtl::OStringBuffer aDateField;
// Insert Date.
- rDateField += wkdays[(sal_uInt16)(rDateTime.GetDayOfWeek())];
- rDateField += ", ";
+ aDateField.append(wkdays[(sal_uInt16)(rDateTime.GetDayOfWeek())]);
+ aDateField.append(RTL_CONSTASCII_STRINGPARAM(", "));
sal_uInt16 nNum = rDateTime.GetDay();
- if (nNum < 10) rDateField += '0';
- rDateField += ByteString::CreateFromInt32(nNum);
- rDateField += ' ';
+ if (nNum < 10)
+ aDateField.append('0');
+ aDateField.append(static_cast<sal_Int32>(nNum));
+ aDateField.append(' ');
- rDateField += months[(sal_uInt16)(rDateTime.GetMonth() - 1)];
- rDateField += ' ';
+ aDateField.append(months[(sal_uInt16)(rDateTime.GetMonth() - 1)]);
+ aDateField.append(' ');
- rDateField += ByteString::CreateFromInt32(rDateTime.GetYear());
- rDateField += ' ';
+ aDateField.append(static_cast<sal_Int32>(rDateTime.GetYear()));
+ aDateField.append(' ');
// Insert Time.
nNum = rDateTime.GetHour();
- if (nNum < 10) rDateField += '0';
- rDateField += ByteString::CreateFromInt32(nNum);
- rDateField += ':';
+ if (nNum < 10)
+ aDateField.append('0');
+ aDateField.append(static_cast<sal_Int32>(nNum));
+ aDateField.append(':');
nNum = rDateTime.GetMin();
- if (nNum < 10) rDateField += '0';
- rDateField += ByteString::CreateFromInt32(nNum);
- rDateField += ':';
+ if (nNum < 10)
+ aDateField.append('0');
+ aDateField.append(static_cast<sal_Int32>(nNum));
+ aDateField.append(':');
nNum = rDateTime.GetSec();
- if (nNum < 10) rDateField += '0';
- rDateField += ByteString::CreateFromInt32(nNum);
- rDateField += " GMT";
+ if (nNum < 10)
+ aDateField.append('0');
+ aDateField.append(static_cast<sal_Int32>(nNum));
+ aDateField.append(RTL_CONSTASCII_STRINGPARAM(" GMT"));
// Done.
- rDateFieldW = UniString (rDateField, RTL_TEXTENCODING_ASCII_US);
+ rDateFieldW = rtl::OStringToOUString(aDateField.makeStringAndClear(),
+ RTL_TEXTENCODING_ASCII_US);
+
return sal_True;
}
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index f397532..44ea6f5 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -590,19 +590,20 @@ InternalResMgr::~InternalResMgr()
{
SvFileStream aStm( UniString( pLogFile, RTL_TEXTENCODING_ASCII_US ), STREAM_WRITE );
aStm.Seek( STREAM_SEEK_TO_END );
- ByteString aLine( "FileName: " );
- aLine.Append( ByteString( OUStringToOString( aFileName, RTL_TEXTENCODING_UTF8 ) ) );
- aStm.WriteLine( aLine );
+ rtl::OStringBuffer aLine(RTL_CONSTASCII_STRINGPARAM("FileName: "));
+ aLine.append(rtl::OUStringToOString(aFileName,
+ RTL_TEXTENCODING_UTF8));
+ aStm.WriteLine(aLine.makeStringAndClear());
for( boost::unordered_map<sal_uInt64, int>::const_iterator it = pResUseDump->begin();
it != pResUseDump->end(); ++it )
{
sal_uInt64 nKeyId = it->first;
- aLine.Assign( "Type/Id: " );
- aLine.Append( ByteString::CreateFromInt32( sal::static_int_cast< sal_Int32 >((nKeyId >> 32) & 0xFFFFFFFF) ) );
- aLine.Append( '/' );
- aLine.Append( ByteString::CreateFromInt32( sal::static_int_cast< sal_Int32 >(nKeyId & 0xFFFFFFFF) ) );
- aStm.WriteLine( aLine );
+ aLine.append(RTL_CONSTASCII_STRINGPARAM("Type/Id: "));
+ aLine.append(sal::static_int_cast< sal_Int32 >((nKeyId >> 32) & 0xFFFFFFFF));
+ aLine.append('/');
+ aLine.append(sal::static_int_cast< sal_Int32 >(nKeyId & 0xFFFFFFFF));
+ aStm.WriteLine(aLine.makeStringAndClear());
}
}
}
@@ -817,31 +818,37 @@ void ResMgr::RscError_Impl( const sal_Char* pMessage, ResMgr* pResMgr,
ResMgr* pNewResMgr = new ResMgr( pImp );
- ByteString aStr = OUStringToOString( pResMgr->GetFileName(), RTL_TEXTENCODING_UTF8 );
- if ( aStr.Len() )
- aStr += '\n';
+ rtl::OStringBuffer aStr(rtl::OUStringToOString(pResMgr->GetFileName(),
+ RTL_TEXTENCODING_UTF8));
- aStr.Append( "Class: " );
- aStr.Append( ByteString( GetTypeRes_Impl( ResId( nRT, *pNewResMgr ) ), RTL_TEXTENCODING_UTF8 ) );
- aStr.Append( ", Id: " );
- aStr.Append( ByteString::CreateFromInt32( (long)nId ) );
- aStr.Append( ". " );
- aStr.Append( pMessage );
+ if (aStr.getLength())
+ aStr.append('\n');
- aStr.Append( "\nResource Stack\n" );
+ aStr.append(RTL_CONSTASCII_STRINGPARAM("Class: "));
+ aStr.append(rtl::OUStringToOString(GetTypeRes_Impl(ResId(nRT, *pNewResMgr)),
+ RTL_TEXTENCODING_UTF8));
+ aStr.append(RTL_CONSTASCII_STRINGPARAM(", Id: "));
+ aStr.append(static_cast<sal_Int32>(nId));
+ aStr.append(RTL_CONSTASCII_STRINGPARAM(". "));
+ aStr.append(pMessage);
+
+ aStr.append(RTL_CONSTASCII_STRINGPARAM("\nResource Stack\n"));
while( nDepth > 0 )
{
- aStr.Append( "Class: " );
- aStr.Append( ByteString( GetTypeRes_Impl( ResId( rResStack[nDepth].pResource->GetRT(), *pNewResMgr ) ), RTL_TEXTENCODING_UTF8 ) );
- aStr.Append( ", Id: " );
- aStr.Append( ByteString::CreateFromInt32( (long)rResStack[nDepth].pResource->GetId() ) );
+ aStr.append(RTL_CONSTASCII_STRINGPARAM("Class: "));
+ aStr.append(rtl::OUStringToOString(GetTypeRes_Impl(
+ ResId(rResStack[nDepth].pResource->GetRT(), *pNewResMgr)),
+ RTL_TEXTENCODING_UTF8));
+ aStr.append(RTL_CONSTASCII_STRINGPARAM(", Id: "));
+ aStr.append(static_cast<sal_Int32>(
+ rResStack[nDepth].pResource->GetId()));
nDepth--;
}
// clean up
delete pNewResMgr;
- OSL_FAIL( aStr.GetBuffer() );
+ OSL_FAIL(aStr.getStr());
}
#endif
@@ -1207,15 +1214,18 @@ sal_Bool ResMgr::GetResource( const ResId& rId, const Resource* pResObj )
if( pFallbackResMgr )
{
pTop->Flags |= RC_FALLBACK_DOWN;
- #ifdef DBG_UTIL
- ByteString aMess( "found resource " );
- aMess.Append( ByteString::CreateFromInt32( nId ) );
- aMess.Append( " in fallback " );
- aMess.Append( ByteString( OUStringToOString( pFallbackResMgr->GetFileName(), osl_getThreadTextEncoding() ) ) );
- aMess.Append( "\n" );
- RscError_Impl( aMess.GetBuffer(),
- this, nRT, nId, aStack, nCurStack-1 );
- #endif
+#ifdef DBG_UTIL
+ rtl::OStringBuffer aMess(
+ RTL_CONSTASCII_STRINGPARAM("found resource "));
+ aMess.append(static_cast<sal_Int32>(nId));
+ aMess.append(RTL_CONSTASCII_STRINGPARAM(" in fallback "));
+ aMess.append(rtl::OUStringToOString(
+ pFallbackResMgr->GetFileName(),
+ osl_getThreadTextEncoding()));
+ aMess.append('\n');
+ RscError_Impl(aMess.getStr(),
+ this, nRT, nId, aStack, nCurStack-1);
+#endif
}
else
{
diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx
index cdd708b..e010128 100644
--- a/tools/source/ref/errinf.cxx
+++ b/tools/source/ref/errinf.cxx
@@ -34,6 +34,7 @@
#include <tools/debug.hxx>
#include <tools/errinf.hxx>
#include <tools/string.hxx>
+#include <rtl/strbuf.hxx>
class ErrorHandler;
@@ -429,30 +430,33 @@ sal_Bool SimpleErrorHandler::CreateString(
const ErrorInfo *pInfo, String &rStr, sal_uInt16 &) const
{
sal_uIntPtr nId = pInfo->GetErrorCode();
- ByteString aStr;
- aStr="Id ";
- aStr+=ByteString::CreateFromInt32(nId);
- aStr+=" only handled by SimpleErrorHandler";
- aStr+="\nErrorCode: ";
- aStr+=ByteString::CreateFromInt32(nId & ((1L << ERRCODE_CLASS_SHIFT) - 1 ));
- aStr+="\nErrorClass: ";
- aStr+=ByteString::CreateFromInt32((nId & ERRCODE_CLASS_MASK) >> ERRCODE_CLASS_SHIFT);
- aStr+="\nErrorArea: ";
- aStr+=ByteString::CreateFromInt32((nId & ERRCODE_ERROR_MASK &
- ~((1 << ERRCODE_AREA_SHIFT ) -1 ) ) >> ERRCODE_AREA_SHIFT);
+ rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Id "));
+ aStr.append(static_cast<sal_Int32>(nId));
+ aStr.append(RTL_CONSTASCII_STRINGPARAM(
+ " only handled by SimpleErrorHandler"));
+ aStr.append(RTL_CONSTASCII_STRINGPARAM("\nErrorCode: "));
+ aStr.append(static_cast<sal_Int32>(
+ nId & ((1L << ERRCODE_CLASS_SHIFT) - 1 )));
+ aStr.append(RTL_CONSTASCII_STRINGPARAM("\nErrorClass: "));
+ aStr.append(static_cast<sal_Int32>(
+ (nId & ERRCODE_CLASS_MASK) >> ERRCODE_CLASS_SHIFT));
+ aStr.append(RTL_CONSTASCII_STRINGPARAM("\nErrorArea: "));
+ aStr.append(static_cast<sal_Int32>((nId & ERRCODE_ERROR_MASK &
+ ~((1 << ERRCODE_AREA_SHIFT ) -1 ) ) >> ERRCODE_AREA_SHIFT));
DynamicErrorInfo *pDyn=PTR_CAST(DynamicErrorInfo,pInfo);
if(pDyn)
{
- aStr+="\nDId ";
- aStr+=ByteString::CreateFromInt32((sal_uIntPtr)*pDyn);
+ aStr.append(RTL_CONSTASCII_STRINGPARAM("\nDId "));
+ aStr.append(static_cast<sal_Int32>(*pDyn));
}
StandardErrorInfo *pStd=PTR_CAST(StandardErrorInfo,pInfo);
if(pStd)
{
- aStr+="\nXId ";
- aStr+=ByteString::CreateFromInt32(pStd->GetExtendedErrorCode());
+ aStr.append(RTL_CONSTASCII_STRINGPARAM("\nXId "));
+ aStr.append(static_cast<sal_Int32>(pStd->GetExtendedErrorCode()));
}
- rStr = String( aStr, RTL_TEXTENCODING_ASCII_US );
+ rStr = rtl::OStringToOUString(aStr.makeStringAndClear(),
+ RTL_TEXTENCODING_ASCII_US);
return sal_True;
}
diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx
index 74a16a4..797a269 100644
--- a/tools/source/ref/pstm.cxx
+++ b/tools/source/ref/pstm.cxx
@@ -762,10 +762,11 @@ sal_uInt32 SvPersistStream::ReadObj
if( !pFunc )
{
#ifdef DBG_UTIL
- ByteString aStr( "no class with id: " );
- aStr += ByteString::CreateFromInt32( nClassId );
- aStr += " registered";
- DBG_WARNING( aStr.GetBuffer() );
+ rtl::OStringBuffer aStr(
+ RTL_CONSTASCII_STRINGPARAM("no class with id: " ));
+ aStr.append(static_cast<sal_Int32>(nClassId));
+ aStr.append(RTL_CONSTASCII_STRINGPARAM(" registered"));
+ DBG_WARNING(aStr.getStr());
#else
(void)nObjLen;
#endif
@@ -790,11 +791,12 @@ sal_uInt32 SvPersistStream::ReadObj
#ifdef DBG_UTIL
if( nObjLen + nObjPos != Tell() )
{
- ByteString aStr( "false object len: read = " );
- aStr += ByteString::CreateFromInt32( (long)(Tell() - nObjPos) );
- aStr += ", should = ";
- aStr += ByteString::CreateFromInt32( nObjLen );
- OSL_FAIL( aStr.GetBuffer() );
+ rtl::OStringBuffer aStr(
+ RTL_CONSTASCII_STRINGPARAM("false object len: read = "));
+ aStr.append(static_cast<sal_Int64>((long)(Tell() - nObjPos)));
+ aStr.append(RTL_CONSTASCII_STRINGPARAM(", should = "));
+ aStr.append(static_cast<sal_Int32>(nObjLen));
+ OSL_FAIL(aStr.getStr());
}
#endif
rpObj->RestoreNoDelete();
More information about the Libreoffice-commits
mailing list