diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-02-23 16:35:56 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-02-23 20:45:03 +0000 |
commit | cfcfd8848e2354dd942eb54e1da13b7b5027cb6c (patch) | |
tree | e72b28d664d2d1a64da6a409029b643850dfa22e /editeng | |
parent | 12310746edc0f43e4b1be84e311dd0dee12701cd (diff) |
make editeng ByteString free
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editobj.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index e06f8101899d..af116b1884bb 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... |