[Libreoffice-commits] .: 6 commits - l10ntools/source rsc/source sw/source tools/source unotools/source vcl/source vcl/unx
Caolán McNamara
caolan at kemper.freedesktop.org
Tue Sep 20 08:55:37 PDT 2011
l10ntools/source/export2.cxx | 60 ++++++++++++----------
l10ntools/source/xmlparse.cxx | 21 +++----
rsc/source/parser/rscyacc.y | 9 +--
sw/source/core/doc/doc.cxx | 2
tools/source/fsys/dirent.cxx | 22 ++++----
tools/source/inet/inetmime.cxx | 50 +++++++++---------
tools/source/string/debugprint.cxx | 1
unotools/source/i18n/calendarwrapper.cxx | 18 +++---
vcl/source/gdi/bitmapex.cxx | 7 +-
vcl/source/window/window.cxx | 74 ++++++++++++++--------------
vcl/unx/generic/fontmanager/fontmanager.cxx | 21 +++----
11 files changed, 150 insertions(+), 135 deletions(-)
New commits:
commit 53abf4dc1c065fba3ec9e691cacd55aceaf19fc7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Sep 20 15:26:19 2011 +0100
ByteString->rtl::OString[Buffer]
diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx
index 825b8d2..c27de5f 100644
--- a/tools/source/fsys/dirent.cxx
+++ b/tools/source/fsys/dirent.cxx
@@ -942,7 +942,7 @@ String DirEntry::GetFull( FSysPathStyle eStyle, sal_Bool bWithDelimiter,
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
- ByteString aRet;
+ rtl::OStringBuffer aBuf;
eStyle = GetStyle( eStyle );
if ( pParent )
{
@@ -950,31 +950,33 @@ String DirEntry::GetFull( FSysPathStyle eStyle, sal_Bool bWithDelimiter,
pParent->eFlag == FSYS_FLAG_RELROOT ||
pParent->eFlag == FSYS_FLAG_VOLUME ) )
{
- aRet = ByteString(pParent->GetName( eStyle ), osl_getThreadTextEncoding());
- aRet += ByteString(GetName( eStyle ), osl_getThreadTextEncoding());
+ aBuf.append(rtl::OUStringToOString(pParent->GetName( eStyle ), osl_getThreadTextEncoding()));
+ aBuf.append(rtl::OUStringToOString(GetName( eStyle ), osl_getThreadTextEncoding()));
}
else
{
- aRet = ByteString(pParent->GetFull( eStyle ), osl_getThreadTextEncoding());
- aRet += ACCESSDELIM_C(eStyle);
- aRet += ByteString(GetName( eStyle ), osl_getThreadTextEncoding());
+ aBuf.append(rtl::OUStringToOString(pParent->GetFull( eStyle ), osl_getThreadTextEncoding()));
+ aBuf.append(ACCESSDELIM_C(eStyle));
+ aBuf.append(rtl::OUStringToOString(GetName( eStyle ), osl_getThreadTextEncoding()));
}
}
else
{
- aRet = rtl::OUStringToOString(GetName(eStyle), osl_getThreadTextEncoding());
+ aBuf.append(rtl::OUStringToOString(GetName(eStyle), osl_getThreadTextEncoding()));
}
//! Hack
if ( bWithDelimiter )
- if ( aRet.GetChar( aRet.Len()-1 ) != ACCESSDELIM_C(eStyle) )
- aRet += ACCESSDELIM_C(eStyle);
+ if ( aBuf[aBuf.getLength()-1] != ACCESSDELIM_C(eStyle) )
+ aBuf.append(ACCESSDELIM_C(eStyle));
+
+ rtl::OString aRet = aBuf.makeStringAndClear();
//! noch ein Hack
if ( nMaxChars < STRING_MAXLEN )
aRet = ImplCutPath( aRet, nMaxChars, ACCESSDELIM_C(eStyle) );
- return String(aRet, osl_getThreadTextEncoding());
+ return rtl::OStringToOUString(aRet, osl_getThreadTextEncoding());
}
/*************************************************************************
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx
index d8531bf..f54952e 100644
--- a/tools/source/inet/inetmime.cxx
+++ b/tools/source/inet/inetmime.cxx
@@ -32,7 +32,8 @@
#include <cstddef>
#include <limits>
-#include "rtl/tencinfo.h"
+#include <rtl/strbuf.hxx>
+#include <rtl/tencinfo.h>
#include <tools/datetime.hxx>
#include <tools/inetmime.hxx>
@@ -945,7 +946,7 @@ sal_Char const * INetMIME::scanParameters(sal_Char const * pBegin,
ByteString aCharset;
ByteString aLanguage;
- ByteString aValue;
+ rtl::OStringBuffer aValue;
if (bExtended)
{
if (nSection == 0)
@@ -1007,6 +1008,7 @@ sal_Char const * INetMIME::scanParameters(sal_Char const * pBegin,
++p;
}
if (pParameters)
+ {
while (p != pEnd && (isTokenChar(*p) || !isUSASCII(*p)))
{
if (*p == '%')
@@ -1017,19 +1019,21 @@ sal_Char const * INetMIME::scanParameters(sal_Char const * pBegin,
int nWeight2 = getHexWeight(p[2]);
if (nWeight1 >= 0 && nWeight2 >= 0)
{
- aValue += sal_Char(nWeight1 << 4 | nWeight2);
+ aValue.append(sal_Char(nWeight1 << 4 | nWeight2));
p += 3;
continue;
}
}
}
- aValue += *p++;
+ aValue.append(*p++);
}
+ }
else
while (p != pEnd && (isTokenChar(*p) || !isUSASCII(*p)))
++p;
}
else if (p != pEnd && *p == '"')
+ {
if (pParameters)
{
bool bInvalid = false;
@@ -1060,7 +1064,7 @@ sal_Char const * INetMIME::scanParameters(sal_Char const * pBegin,
bInvalid = true;
break;
}
- aValue += *p++;
+ aValue.append(*p++);
}
if (bInvalid)
break;
@@ -1072,6 +1076,7 @@ sal_Char const * INetMIME::scanParameters(sal_Char const * pBegin,
break;
p = pStringEnd;
}
+ }
else
{
sal_Char const * pTokenBegin = p;
@@ -1080,13 +1085,12 @@ sal_Char const * INetMIME::scanParameters(sal_Char const * pBegin,
if (p == pTokenBegin)
break;
if (pParameters)
- aValue = ByteString(
- pTokenBegin, static_cast< xub_StrLen >(p - pTokenBegin));
+ aValue.append(pTokenBegin, static_cast< sal_Int32 >(p - pTokenBegin));
}
if (!bPresent)
- *pPos = new Parameter(*pPos, aAttribute, aCharset, aLanguage, aValue,
- nSection, bExtended);
+ *pPos = new Parameter(*pPos, aAttribute, aCharset, aLanguage,
+ aValue.makeStringAndClear(), nSection, bExtended);
}
return parseParameters(aList, pParameters) ? pParameterBegin : pBegin;
}
@@ -2888,7 +2892,7 @@ UniString INetMIME::decodeHeaderFieldBody(HeaderFieldType eType,
bEncodedWord = bEncodedWord && q != pEnd && *q++ == '?';
- ByteString sText;
+ rtl::OStringBuffer sText;
if (bEncodedWord)
{
if (bEncodingB)
@@ -2933,10 +2937,8 @@ UniString INetMIME::decodeHeaderFieldBody(HeaderFieldType eType,
}
if (bEncodedWord)
{
- for (int nShift = 16; nCount-- > 0;
- nShift -= 8)
- sText += sal_Char(nValue >> nShift
- & 0xFF);
+ for (int nShift = 16; nCount-- > 0; nShift -= 8)
+ sText.append(sal_Char(nValue >> nShift & 0xFF));
if (*q == '?')
{
++q;
@@ -2982,12 +2984,12 @@ UniString INetMIME::decodeHeaderFieldBody(HeaderFieldType eType,
bDone = true;
break;
}
- sText += rBody.Copy(
+ sText.append(rBody.Copy(
static_cast< xub_StrLen >(
pEncodedTextCopyBegin - pBegin),
static_cast< xub_StrLen >(
- q - 1 - pEncodedTextCopyBegin));
- sText += sal_Char(nDigit1 << 4 | nDigit2);
+ q - 1 - pEncodedTextCopyBegin)));
+ sText.append(sal_Char(nDigit1 << 4 | nDigit2));
q += 2;
pEncodedTextCopyBegin = q;
break;
@@ -2995,23 +2997,23 @@ UniString INetMIME::decodeHeaderFieldBody(HeaderFieldType eType,
case '?':
if (q - pEncodedTextBegin > 1)
- sText += rBody.Copy(
+ sText.append(rBody.Copy(
static_cast< xub_StrLen >(
pEncodedTextCopyBegin - pBegin),
static_cast< xub_StrLen >(
- q - 1 - pEncodedTextCopyBegin));
+ q - 1 - pEncodedTextCopyBegin)));
else
bEncodedWord = false;
bDone = true;
break;
case '_':
- sText += rBody.Copy(
+ sText.append(rBody.Copy(
static_cast< xub_StrLen >(
pEncodedTextCopyBegin - pBegin),
static_cast< xub_StrLen >(
- q - 1 - pEncodedTextCopyBegin));
- sText += ' ';
+ q - 1 - pEncodedTextCopyBegin)));
+ sText.append(' ');
pEncodedTextCopyBegin = q;
break;
@@ -3051,8 +3053,8 @@ UniString INetMIME::decodeHeaderFieldBody(HeaderFieldType eType,
if (bEncodedWord)
{
pUnicodeBuffer
- = convertToUnicode(sText.GetBuffer(),
- sText.GetBuffer() + sText.Len(),
+ = convertToUnicode(sText.getStr(),
+ sText.getStr() + sText.getLength(),
eCharsetEncoding, nUnicodeSize);
if (pUnicodeBuffer == 0)
bEncodedWord = false;
diff --git a/tools/source/string/debugprint.cxx b/tools/source/string/debugprint.cxx
index b95e8ce..8513331 100644
--- a/tools/source/string/debugprint.cxx
+++ b/tools/source/string/debugprint.cxx
@@ -37,7 +37,6 @@ const sal_Char *dbg_dump(const ByteString &rStr)
{
static ByteString aStr;
aStr = rStr;
- aStr.Append(static_cast<char>(0));
return aStr.GetBuffer();
}
commit 0344e07dd7b6929e88141a384fd5c46b93c1c61b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Sep 20 15:25:25 2011 +0100
ByteString->rtl::OString[Buffer]
diff --git a/rsc/source/parser/rscyacc.y b/rsc/source/parser/rscyacc.y
index a225b5f..7a7bb32 100644
--- a/rsc/source/parser/rscyacc.y
+++ b/rsc/source/parser/rscyacc.y
@@ -33,6 +33,7 @@
#include <ctype.h>
#include <string.h>
+#include <rtl/strbuf.hxx>
#include <tools/rc.h>
#include <rscerror.h>
#include <rsctools.hxx>
@@ -149,11 +150,11 @@ sal_Bool DoClassHeader( RSCHEADER * pHeader, sal_Bool bMember )
if( !pCopyObj )
{
- ByteString aMsg( pHS->getString( aCopyInst.pClass->GetId() ) );
- aMsg += ' ';
- aMsg += aName2.GetName();
+ rtl::OStringBuffer aMsg( pHS->getString( aCopyInst.pClass->GetId() ) );
+ aMsg.append(' ');
+ aMsg.append(aName2.GetName());
pTC->pEH->Error( ERR_NOCOPYOBJ, pHeader->pClass, aName1,
- aMsg.GetBuffer() );
+ aMsg.getStr() );
}
else
aCopyInst.pData = pCopyObj->GetRscObj();
commit d2dff83fc33da53fb0e49e45dd10d892ae5a3309
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Sep 20 15:25:11 2011 +0100
ByteString->rtl::OString[Buffer]
diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx
index 64379d4..1150d3e 100644
--- a/l10ntools/source/export2.cxx
+++ b/l10ntools/source/export2.cxx
@@ -145,52 +145,52 @@ std::vector<ByteString> Export::aForcedLanguages = std::vector<ByteString>();
void Export::QuotHTML( ByteString &rString )
/*****************************************************************************/
{
- ByteString sReturn;
+ rtl::OStringBuffer sReturn;
for ( sal_uInt16 i = 0; i < rString.Len(); i++ ) {
ByteString sTemp = rString.Copy( i );
if ( sTemp.Search( "<Arg n=" ) == 0 ) {
while ( i < rString.Len() && rString.GetChar( i ) != '>' ) {
- sReturn += rString.GetChar( i );
+ sReturn.append(rString.GetChar(i));
i++;
}
if ( rString.GetChar( i ) == '>' ) {
- sReturn += ">";
+ sReturn.append('>');
i++;
}
}
if ( i < rString.Len()) {
switch ( rString.GetChar( i )) {
case '<':
- sReturn += "<";
+ sReturn.append("<");
break;
case '>':
- sReturn += ">";
+ sReturn.append(">");
break;
case '\"':
- sReturn += """;
+ sReturn.append(""");
break;
case '\'':
- sReturn += "'";
+ sReturn.append("'");
break;
case '&':
if ((( i + 4 ) < rString.Len()) &&
( rString.Copy( i, 5 ) == "&" ))
- sReturn += rString.GetChar( i );
+ sReturn.append(rString.GetChar(i));
else
- sReturn += "&";
+ sReturn.append("&");
break;
default:
- sReturn += rString.GetChar( i );
+ sReturn.append(rString.GetChar(i));
break;
}
}
}
- rString = sReturn;
+ rString = sReturn.makeStringAndClear();
}
void Export::RemoveUTF8ByteOrderMarker( ByteString &rString ){
@@ -298,34 +298,42 @@ bool Export::CopyFile( const ByteString& source , const ByteString& dest )
void Export::UnquotHTML( ByteString &rString )
/*****************************************************************************/
{
- ByteString sReturn;
- while ( rString.Len()) {
- if ( rString.Copy( 0, 5 ) == "&" ) {
- sReturn += "&";
+ rtl::OStringBuffer sReturn;
+
+ while ( rString.Len())
+ {
+ if ( rString.Copy( 0, 5 ) == "&" )
+ {
+ sReturn.append('&');
rString.Erase( 0, 5 );
}
- else if ( rString.Copy( 0, 4 ) == "<" ) {
- sReturn += "<";
+ else if ( rString.Copy( 0, 4 ) == "<" )
+ {
+ sReturn.append('<');
rString.Erase( 0, 4 );
}
- else if ( rString.Copy( 0, 4 ) == ">" ) {
- sReturn += ">";
+ else if ( rString.Copy( 0, 4 ) == ">" )
+ {
+ sReturn.append('>');
rString.Erase( 0, 4 );
}
- else if ( rString.Copy( 0, 6 ) == """ ) {
- sReturn += "\"";
+ else if ( rString.Copy( 0, 6 ) == """ )
+ {
+ sReturn.append('\"');;
rString.Erase( 0, 6 );
}
- else if ( rString.Copy( 0, 6 ) == "'" ) {
- sReturn += "\'";
+ else if ( rString.Copy( 0, 6 ) == "'" )
+ {
+ sReturn.append('\'');
rString.Erase( 0, 6 );
}
- else {
- sReturn += rString.GetChar( 0 );
+ else
+ {
+ sReturn.append(rString.GetChar(0));
rString.Erase( 0, 1 );
}
}
- rString = sReturn;
+ rString = sReturn.makeStringAndClear();
}
bool Export::isSourceLanguage( const ByteString &sLanguage )
{
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index 7b0b118..f7d8018 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -38,6 +38,7 @@
#include <iostream>
#include <osl/mutex.hxx>
#include <osl/thread.hxx>
+#include <rtl/strbuf.hxx>
using namespace std;
using namespace osl;
@@ -1377,41 +1378,39 @@ void XMLUtil::UnQuotHTML( String &rString ){
}
void XMLUtil::UnQuotData( String &rString_in ){
- ByteString sReturn;
+ rtl::OStringBuffer sReturn;
ByteString sString( rString_in , RTL_TEXTENCODING_UTF8 );
while ( sString.Len()) {
if ( sString.Copy( 0, 1 ) == "\\" ) {
- sReturn += "\\\\";
+ sReturn.append("\\\\");
sString.Erase( 0, 1 );
}
else if ( sString.Copy( 0, 5 ) == "&" ) {
- sReturn += "&";
+ sReturn.append('&');
sString.Erase( 0, 5 );
}
else if ( sString.Copy( 0, 4 ) == "<" ) {
- sReturn += "<";
+ sReturn.append('<');
sString.Erase( 0, 4 );
}
else if ( sString.Copy( 0, 4 ) == ">" ) {
- sReturn += ">";
+ sReturn.append('>');
sString.Erase( 0, 4 );
}
else if ( sString.Copy( 0, 6 ) == """ ) {
- sReturn += "\"";
+ sReturn.append('\"');
sString.Erase( 0, 6 );
}
else if ( sString.Copy( 0, 6 ) == "'" ) {
- sReturn += "\'";
+ sReturn.append('\'');
sString.Erase( 0, 6 );
}
else {
- sReturn += sString.GetChar( 0 );
+ sReturn.append(sString.GetChar(0));
sString.Erase( 0, 1 );
}
}
- rString_in = String(sReturn , RTL_TEXTENCODING_UTF8 );
-
-
+ rString_in = rtl::OStringToOUString(sReturn.makeStringAndClear(), RTL_TEXTENCODING_UTF8);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 2c0831ebbf940833c3fecc66abd1ce0f3a29cd10
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Sep 20 15:24:47 2011 +0100
ByteString->rtl::OString[Buffer]
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 584eacf..0db0df7 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -32,6 +32,7 @@
#include <ctype.h>
#include <rtl/crc.h>
+#include <rtl/strbuf.hxx>
#include <tools/stream.hxx>
#include <tools/debug.hxx>
@@ -112,8 +113,10 @@ BitmapEx::BitmapEx( const ResId& rResId ) :
if( !aImageTree->loadImage( aFileName, aCurrentSymbolsStyle, *this, true ) )
{
#ifdef DBG_UTIL
- ByteString aErrorStr( "BitmapEx::BitmapEx( const ResId& rResId ): could not load image <" );
- OSL_FAIL( ( ( aErrorStr += ByteString( aFileName, RTL_TEXTENCODING_ASCII_US ) ) += '>' ).GetBuffer() );
+ rtl::OStringBuffer aErrorStr(RTL_CONSTASCII_STRINGPARAM(
+ "BitmapEx::BitmapEx( const ResId& rResId ): could not load image <"));
+ aErrorStr.append(rtl::OUStringToOString(aFileName, RTL_TEXTENCODING_ASCII_US)).append('>');
+ OSL_FAIL(aErrorStr.getStr());
#endif
}
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index d0646e0..321daba 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -4195,7 +4195,7 @@ Window::Window( Window* pParent, const ResId& rResId )
#if OSL_DEBUG_LEVEL > 0
namespace
{
- void lcl_appendWindowInfo( ByteString& io_rErrorString, const Window& i_rWindow )
+ rtl::OString lcl_createWindowInfo(const Window& i_rWindow)
{
// skip border windows, they don't carry information which helps diagnosing the problem
const Window* pWindow( &i_rWindow );
@@ -4204,11 +4204,13 @@ namespace
if ( !pWindow )
pWindow = &i_rWindow;
- io_rErrorString += char(13);
- io_rErrorString += typeid( *pWindow ).name();
- io_rErrorString += " (window text: '";
- io_rErrorString += ByteString( pWindow->GetText(), RTL_TEXTENCODING_UTF8 );
- io_rErrorString += "')";
+ rtl::OStringBuffer aErrorString;
+ aErrorString.append(char(13));
+ aErrorString.append(typeid( *pWindow ).name());
+ aErrorString.append(" (window text: '");
+ aErrorString.append(rtl::OUStringToOString(pWindow->GetText(), RTL_TEXTENCODING_UTF8));
+ aErrorString.append("')");
+ return aErrorString.makeStringAndClear();
}
}
#endif
@@ -4338,7 +4340,7 @@ Window::~Window()
#if OSL_DEBUG_LEVEL > 0
if ( sal_True ) // always perform these tests in non-pro versions
{
- ByteString aErrorStr;
+ rtl::OStringBuffer aErrorStr;
sal_Bool bError = sal_False;
Window* pTempWin = mpWindowImpl->mpFrameData->mpFirstOverlap;
while ( pTempWin )
@@ -4346,7 +4348,7 @@ Window::~Window()
if ( ImplIsRealParentPath( pTempWin ) )
{
bError = sal_True;
- lcl_appendWindowInfo( aErrorStr, *pTempWin );
+ aErrorStr.append(lcl_createWindowInfo(*pTempWin));
}
pTempWin = pTempWin->mpWindowImpl->mpNextOverlap;
}
@@ -4372,48 +4374,48 @@ Window::~Window()
if ( ImplIsRealParentPath( pTempWin ) )
{
bError = sal_True;
- lcl_appendWindowInfo( aErrorStr, *pTempWin );
+ aErrorStr.append(lcl_createWindowInfo(*pTempWin));
}
pTempWin = pTempWin->mpWindowImpl->mpFrameData->mpNextFrame;
}
if ( bError )
{
- ByteString aTempStr( "Window (" );
- aTempStr += ByteString( GetText(), RTL_TEXTENCODING_UTF8 );
- aTempStr += ") with living SystemWindow(s) destroyed: ";
- aTempStr += aErrorStr;
- OSL_FAIL( aTempStr.GetBuffer() );
- GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed!
+ rtl::OStringBuffer aTempStr( "Window (" );
+ aTempStr.append(rtl::OUStringToOString(GetText(), RTL_TEXTENCODING_UTF8));
+ aTempStr.append(") with living SystemWindow(s) destroyed: ");
+ aTempStr.append(aErrorStr);
+ OSL_FAIL( aTempStr.getStr() );
+ GetpApp()->Abort(rtl::OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in non-pro version, this must be fixed!
}
if ( mpWindowImpl->mpFirstChild )
{
- ByteString aTempStr( "Window (" );
- aTempStr += ByteString( GetText(), RTL_TEXTENCODING_UTF8 );
- aTempStr += ") with living Child(s) destroyed: ";
+ rtl::OStringBuffer aTempStr("Window (");
+ aTempStr.append(rtl::OUStringToOString(GetText(), RTL_TEXTENCODING_UTF8));
+ aTempStr.append(") with living Child(s) destroyed: ");
pTempWin = mpWindowImpl->mpFirstChild;
while ( pTempWin )
{
- lcl_appendWindowInfo( aTempStr, *pTempWin );
+ aTempStr.append(lcl_createWindowInfo(*pTempWin));
pTempWin = pTempWin->mpWindowImpl->mpNext;
}
- OSL_FAIL( aTempStr.GetBuffer() );
- GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed!
+ OSL_FAIL( aTempStr.getStr() );
+ GetpApp()->Abort(rtl::OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in non-pro version, this must be fixed!
}
if ( mpWindowImpl->mpFirstOverlap )
{
- ByteString aTempStr( "Window (" );
- aTempStr += ByteString( GetText(), RTL_TEXTENCODING_UTF8 );
- aTempStr += ") with living SystemWindow(s) destroyed: ";
+ rtl::OStringBuffer aTempStr("Window (");
+ aTempStr.append(rtl::OUStringToOString(GetText(), RTL_TEXTENCODING_UTF8));
+ aTempStr.append(") with living SystemWindow(s) destroyed: ");
pTempWin = mpWindowImpl->mpFirstOverlap;
while ( pTempWin )
{
- lcl_appendWindowInfo( aTempStr, *pTempWin );
+ aTempStr.append(lcl_createWindowInfo(*pTempWin));
pTempWin = pTempWin->mpWindowImpl->mpNext;
}
- OSL_FAIL( aTempStr.GetBuffer() );
- GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed!
+ OSL_FAIL( aTempStr.getStr() );
+ GetpApp()->Abort(rtl::OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in non-pro version, this must be fixed!
}
Window* pMyParent = this;
@@ -4427,11 +4429,11 @@ Window::~Window()
}
if ( pMySysWin && pMySysWin->ImplIsInTaskPaneList( this ) )
{
- ByteString aTempStr( "Window (" );
- aTempStr += ByteString( GetText(), RTL_TEXTENCODING_UTF8 );
- aTempStr += ") still in TaskPanelList!";
- OSL_FAIL( aTempStr.GetBuffer() );
- GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed!
+ rtl::OStringBuffer aTempStr("Window (");
+ aTempStr.append(rtl::OUStringToOString(GetText(), RTL_TEXTENCODING_UTF8));
+ aTempStr.append(") still in TaskPanelList!");
+ OSL_FAIL( aTempStr.getStr() );
+ GetpApp()->Abort(rtl::OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in non-pro version, this must be fixed!
}
}
#endif
@@ -4453,10 +4455,10 @@ Window::~Window()
}
else
{
- ByteString aTempStr( "Window (" );
- aTempStr += ByteString( GetText(), RTL_TEXTENCODING_UTF8 );
- aTempStr += ") not found in TaskPanelList!";
- OSL_FAIL( aTempStr.GetBuffer() );
+ rtl::OStringBuffer aTempStr("Window (");
+ aTempStr.append(rtl::OUStringToOString(GetText(), RTL_TEXTENCODING_UTF8));
+ aTempStr.append(") not found in TaskPanelList!");
+ OSL_FAIL( aTempStr.getStr() );
}
}
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
index dbd73f8..0028f04 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -1020,16 +1020,16 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
continue;
}
- ByteString aTranslate;
+ rtl::OStringBuffer aTranslate;
if( pChar->code & 0xff000000 )
- aTranslate += (char)(pChar->code >> 24 );
+ aTranslate.append((char)(pChar->code >> 24));
if( pChar->code & 0xffff0000 )
- aTranslate += (char)((pChar->code & 0x00ff0000) >> 16 );
+ aTranslate.append((char)((pChar->code & 0x00ff0000) >> 16));
if( pChar->code & 0xffffff00 )
- aTranslate += (char)((pChar->code & 0x0000ff00) >> 8 );
- aTranslate += (char)(pChar->code & 0xff);
- String aUni( aTranslate, m_aEncoding );
- pUnicodes[i] = *aUni.GetBuffer();
+ aTranslate.append((char)((pChar->code & 0x0000ff00) >> 8 ));
+ aTranslate.append((char)(pChar->code & 0xff));
+ rtl::OUString aUni(rtl::OStringToOUString(aTranslate.makeStringAndClear(), m_aEncoding));
+ pUnicodes[i] = aUni.toChar();
}
else
pUnicodes[i] = 0;
@@ -2403,11 +2403,10 @@ void PrintFontManager::initialize()
while( ! readdir_r( pDIR, (struct dirent*)aDirEntBuffer, &pDirEntry ) && pDirEntry )
{
- ByteString aFile( aDir );
- aFile += '/';
- aFile += pDirEntry->d_name;
+ rtl::OStringBuffer aFile(aDir);
+ aFile.append('/').append(pDirEntry->d_name);
struct stat aStat;
- if( ! stat( aFile.GetBuffer(), &aStat )
+ if( ! stat( aFile.getStr(), &aStat )
&& S_ISREG( aStat.st_mode )
)
{
commit 2f33cf5115df156cc17f6218ca42ca367cd32cf4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Sep 20 11:40:33 2011 +0100
ByteString->rtl::OStringBuffer
diff --git a/unotools/source/i18n/calendarwrapper.cxx b/unotools/source/i18n/calendarwrapper.cxx
index bd79ab7..67e6e24 100644
--- a/unotools/source/i18n/calendarwrapper.cxx
+++ b/unotools/source/i18n/calendarwrapper.cxx
@@ -89,17 +89,17 @@ void CalendarWrapper::loadCalendar( const ::rtl::OUString& rUniqueID, const ::co
if ( xC.is() )
xC->loadCalendar( rUniqueID, rLocale );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "loadCalendar: Exception caught\nrequested: " );
- aMsg += ByteString( String( rUniqueID ), RTL_TEXTENCODING_UTF8 );
- aMsg += " Locale: ";
- aMsg += ByteString( String( rLocale.Language ), RTL_TEXTENCODING_UTF8 );
- aMsg += '_';
- aMsg += ByteString( String( rLocale.Country ), RTL_TEXTENCODING_UTF8 );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("loadCalendar: Exception caught\nrequested: "));
+ aMsg.append(rtl::OUStringToOString(rUniqueID, RTL_TEXTENCODING_UTF8));
+ aMsg.append(RTL_CONSTASCII_STRINGPARAM(" Locale: "));
+ aMsg.append(rtl::OUStringToOString(rLocale.Language, RTL_TEXTENCODING_UTF8));
+ aMsg.append('_');
+ aMsg.append(rtl::OUStringToOString(rLocale.Country, RTL_TEXTENCODING_UTF8));
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
commit be0cf0693368642f94a794c64792020e3613e869
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Sep 20 11:02:21 2011 +0100
bah, why did I change it away from size
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index d83ab53..96a1629 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1638,7 +1638,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
StringRangeEnumerator::getRangesFromString(
aPageRange, aPagesToPrint, 1, nDocPageCount, 0 );
- if (!aPagesToPrint.size())
+ if (aPagesToPrint.empty())
return;
// now fill the vector for calculating the page pairs with the start frames
More information about the Libreoffice-commits
mailing list