diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-13 13:39:32 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-13 13:40:31 +0000 |
commit | 2eb035adf756136e7a2eb49b2cfef2bd9b5d21af (patch) | |
tree | 5598925725eaa2867e99496b6f5f00a74eac9077 /editeng/source | |
parent | 24dd5bce3ed645678410ff961c8259ab8a8ea031 (diff) |
coverity#1371287 don't need to copy and then overwrite
Change-Id: Ica30e4bed463e8e42cbf54f4b81491149a8de8ab
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/editeng/editobj.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 5a370837d350..3f1f70f5c681 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(); |