diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-11 15:09:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-11 15:22:09 +0000 |
commit | 9bf4b8c51d2dc2be892121349a63ab029a627fe8 (patch) | |
tree | 270fd5f709531ae563be767340a5e996f7d6c50f /oox | |
parent | coverity#1209861 untaint image data (diff) | |
download | core-9bf4b8c51d2dc2be892121349a63ab029a627fe8.tar.gz core-9bf4b8c51d2dc2be892121349a63ab029a627fe8.zip |
coverity#1187643 Unchecked return value
Change-Id: I2ba56fbff1ae05d1185d08d4fbd0285954fed38b
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/textrun.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/oox/source/drawingml/textrun.cxx b/oox/source/drawingml/textrun.cxx index b988522882dd..1485f020c917 100644 --- a/oox/source/drawingml/textrun.cxx +++ b/oox/source/drawingml/textrun.cxx @@ -76,15 +76,16 @@ sal_Int32 TextRun::insertAt( } else { - OUString aLatinFontName, aSymbolFontName; sal_Int16 nSymbolFontFamily = 0, nSymbolFontPitch = 0; if ( !aTextCharacterProps.maSymbolFont.getFontData( aSymbolFontName, nSymbolFontPitch, nSymbolFontFamily, rFilterBase ) ) xText->insertString( xStart, getText(), sal_False ); else if ( !getText().isEmpty() ) - { // !!#i113673<<< + { + // #i113673 + OUString aLatinFontName, aSymbolFontName; sal_Int16 nLatinFontPitch = 0, nLatinFontFamily = 0; - aTextCharacterProps.maLatinFont.getFontData( aLatinFontName, nLatinFontPitch, nLatinFontFamily, rFilterBase ); + bool bLatinOk = aTextCharacterProps.maLatinFont.getFontData( aLatinFontName, nLatinFontPitch, nLatinFontFamily, rFilterBase ); sal_Int32 nIndex = 0; while ( true ) @@ -109,9 +110,12 @@ sal_Int32 TextRun::insertAt( nCount++; } while( ( ( nCount + nIndex ) < getText().getLength() ) && ( ( getText()[ nCount + nIndex ] & 0xff00 ) != 0xf000 ) ); - aPropSet.setAnyProperty( PROP_CharFontName, Any( aLatinFontName ) ); - aPropSet.setAnyProperty( PROP_CharFontPitch, Any( nLatinFontPitch ) ); - aPropSet.setAnyProperty( PROP_CharFontFamily, Any( nLatinFontFamily ) ); + if (bLatinOk) + { + aPropSet.setAnyProperty( PROP_CharFontName, Any( aLatinFontName ) ); + aPropSet.setAnyProperty( PROP_CharFontPitch, Any( nLatinFontPitch ) ); + aPropSet.setAnyProperty( PROP_CharFontFamily, Any( nLatinFontFamily ) ); + } } OUString aSubString( getText().copy( nIndex, nCount ) ); xText->insertString( xStart, aSubString, sal_False ); |