[Libreoffice-commits] .: 3 commits - desktop/source editeng/source tools/inc
Caolán McNamara
caolan at kemper.freedesktop.org
Thu Feb 23 12:45:45 PST 2012
desktop/source/app/officeipcthread.cxx | 6 ++++--
editeng/source/editeng/editobj.cxx | 15 ++++++++-------
tools/inc/tools/string.hxx | 3 +--
3 files changed, 13 insertions(+), 11 deletions(-)
New commits:
commit 0a45b102953a86ea3f26ffd5740f791b3f752f08
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Feb 23 20:43:33 2012 +0000
don't point inline at non-existing method
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx
index 7fe2c10..ecd48c6 100644
--- a/tools/inc/tools/string.hxx
+++ b/tools/inc/tools/string.hxx
@@ -157,6 +157,7 @@ private:
// Assign(sal_Char)
ByteString& Assign( const sal_Char* pCharStr, xub_StrLen nLen ); //not implemented, to detect use of removed methods without compiler making something to fit
ByteString& Assign( const sal_Char* pCharStr ); //not implemented, to detect use of removed methods without compiler making something to fit
+ ByteString& operator =( const sal_Char* ); //not implemented, to detect use of removed methods without compiler making something to fit
ByteString& operator =(const sal_Char); //not implemented, to detect use of removed methods without compiler making something to fit
ByteString& Assign(sal_Char); //not implemented, to detect use of removed methods without compiler making something to fit
@@ -192,8 +193,6 @@ public:
{ return Assign( rStr ); }
ByteString& operator =( const rtl::OString& rStr )
{ return Assign( rStr ); }
- ByteString& operator =( const sal_Char* pCharStr )
- { return Assign( pCharStr ); }
ByteString& Append( const ByteString& rStr );
ByteString& Append( const sal_Char* pCharStr );
commit cfcfd8848e2354dd942eb54e1da13b7b5027cb6c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Feb 23 16:35:56 2012 +0000
make editeng ByteString free
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index e06f810..af116b1 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -27,6 +27,7 @@
************************************************************************/
+#include <rtl/strbuf.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/dialog.hxx>
#include <vcl/msgbox.hxx>
@@ -1054,7 +1055,7 @@ void BinTextObject::StoreData( SvStream& rOStream ) const
ContentInfo* pC = GetContents().GetObject( nPara );
// Text...
- ByteString aText(rtl::OUStringToOString(pC->GetText(), eEncoding));
+ rtl::OStringBuffer aBuffer(rtl::OUStringToOString(pC->GetText(), eEncoding));
// Symbols?
sal_Bool bSymbolPara = sal_False;
@@ -1063,7 +1064,7 @@ void BinTextObject::StoreData( SvStream& rOStream ) const
const SvxFontItem& rFontItem = (const SvxFontItem&)pC->GetParaAttribs().Get( EE_CHAR_FONTINFO );
if ( rFontItem.GetCharSet() == RTL_TEXTENCODING_SYMBOL )
{
- aText = rtl::OUStringToOString(pC->GetText(), RTL_TEXTENCODING_SYMBOL);
+ aBuffer = rtl::OStringBuffer(rtl::OUStringToOString(pC->GetText(), RTL_TEXTENCODING_SYMBOL));
bSymbolPara = sal_True;
}
}
@@ -1080,8 +1081,8 @@ void BinTextObject::StoreData( SvStream& rOStream ) const
// Not correctly converted
String aPart( pC->GetText(), pAttr->GetStart(), pAttr->GetEnd() - pAttr->GetStart() );
rtl::OString aNew(rtl::OUStringToOString(aPart, rFontItem.GetCharSet()));
- aText.Erase( pAttr->GetStart(), pAttr->GetEnd() - pAttr->GetStart() );
- aText.Insert( aNew, pAttr->GetStart() );
+ aBuffer.remove(pAttr->GetStart(), pAttr->GetEnd() - pAttr->GetStart());
+ aBuffer.insert(pAttr->GetStart(), aNew);
}
// Convert StarSymbol back to StarBats
@@ -1095,7 +1096,7 @@ void BinTextObject::StoreData( SvStream& rOStream ) const
sal_Unicode cOld = pC->GetText().GetChar( nChar );
char cConv = rtl::OUStringToOString(rtl::OUString(ConvertFontToSubsFontChar(hConv, cOld)), RTL_TEXTENCODING_SYMBOL).toChar();
if ( cConv )
- aText.SetChar( nChar, cConv );
+ aBuffer[nChar] = cConv;
}
DestroyFontToSubsFontConverter( hConv );
@@ -1120,7 +1121,7 @@ void BinTextObject::StoreData( SvStream& rOStream ) const
sal_Unicode cOld = pC->GetText().GetChar( nChar );
char cConv = rtl::OUStringToOString(rtl::OUString(ConvertFontToSubsFontChar(hConv, cOld)), RTL_TEXTENCODING_SYMBOL).toChar();
if ( cConv )
- aText.SetChar( nChar, cConv );
+ aBuffer[nChar] = cConv;
}
}
@@ -1130,7 +1131,7 @@ void BinTextObject::StoreData( SvStream& rOStream ) const
// Convert CH_FEATURE to CH_FEATURE_OLD
- aText.SearchAndReplaceAll( cFeatureConverted, CH_FEATURE_OLD );
+ rtl::OString aText = aBuffer.makeStringAndClear().replace(cFeatureConverted, CH_FEATURE_OLD);
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rOStream, aText);
// StyleName and Family...
commit 12310746edc0f43e4b1be84e311dd0dee12701cd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Feb 23 16:12:18 2012 +0000
accumulate into an OStringBuffer
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index a0d2f3f..38babd8 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -669,22 +669,24 @@ void OfficeIPCThread::execute()
// down during wait
osl::ClearableMutexGuard aGuard( GetMutex() );
- ByteString aArguments;
// test byte by byte
const int nBufSz = 2048;
char pBuf[nBufSz];
int nBytes = 0;
int nResult = 0;
+ rtl::OStringBuffer aBuf;
// read into pBuf until '\0' is read or read-error
while ((nResult=maStreamPipe.recv( pBuf+nBytes, nBufSz-nBytes))>0) {
nBytes += nResult;
if (pBuf[nBytes-1]=='\0') {
- aArguments += pBuf;
+ aBuf.append(pBuf);
break;
}
}
// don't close pipe ...
+ ByteString aArguments = aBuf.makeStringAndClear();
+
// Is this a lookup message from another application? if so, ignore
if ( aArguments.Len() == 0 )
continue;
More information about the Libreoffice-commits
mailing list