[Libreoffice-commits] core.git: editeng/source
Caolán McNamara
caolanm at redhat.com
Fri Jan 13 13:40:57 UTC 2017
editeng/source/editeng/editobj.cxx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 2eb035adf756136e7a2eb49b2cfef2bd9b5d21af
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 13 13:39:32 2017 +0000
coverity#1371287 don't need to copy and then overwrite
Change-Id: Ica30e4bed463e8e42cbf54f4b81491149a8de8ab
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index 5a37083..3f1f70f 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -1121,9 +1121,6 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const
{
const ContentInfo& rC = *aContents[nPara].get();
- // Text...
- OStringBuffer aBuffer(OUStringToOString(rC.GetText(), eEncoding));
-
// Symbols?
bool bSymbolPara = false;
if (rC.GetParaAttribs().GetItemState( EE_CHAR_FONTINFO ) == SfxItemState::SET)
@@ -1131,10 +1128,13 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const
const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(rC.GetParaAttribs().Get(EE_CHAR_FONTINFO));
if ( rFontItem.GetCharSet() == RTL_TEXTENCODING_SYMBOL )
{
- aBuffer = OStringBuffer(OUStringToOString(rC.GetText(), RTL_TEXTENCODING_SYMBOL));
bSymbolPara = true;
}
}
+
+ // eEncoding for Text, RTL_TEXTENCODING_SYMBOL for Symbols
+ OStringBuffer aBuffer(OUStringToOString(rC.GetText(), bSymbolPara ? RTL_TEXTENCODING_SYMBOL : eEncoding));
+
for (size_t nA = 0; nA < rC.maCharAttribs.size(); ++nA)
{
const XEditAttribute& rAttr = *rC.maCharAttribs[nA].get();
More information about the Libreoffice-commits
mailing list