Kaydet (Commit) 9bf4b8c5 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1187643 Unchecked return value

Change-Id: I2ba56fbff1ae05d1185d08d4fbd0285954fed38b
üst 94ef826e
...@@ -76,15 +76,16 @@ sal_Int32 TextRun::insertAt( ...@@ -76,15 +76,16 @@ sal_Int32 TextRun::insertAt(
} }
else else
{ {
OUString aLatinFontName, aSymbolFontName;
sal_Int16 nSymbolFontFamily = 0, nSymbolFontPitch = 0; sal_Int16 nSymbolFontFamily = 0, nSymbolFontPitch = 0;
if ( !aTextCharacterProps.maSymbolFont.getFontData( aSymbolFontName, nSymbolFontPitch, nSymbolFontFamily, rFilterBase ) ) if ( !aTextCharacterProps.maSymbolFont.getFontData( aSymbolFontName, nSymbolFontPitch, nSymbolFontFamily, rFilterBase ) )
xText->insertString( xStart, getText(), sal_False ); xText->insertString( xStart, getText(), sal_False );
else if ( !getText().isEmpty() ) else if ( !getText().isEmpty() )
{ // !!#i113673<<< {
// #i113673
OUString aLatinFontName, aSymbolFontName;
sal_Int16 nLatinFontPitch = 0, nLatinFontFamily = 0; 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; sal_Int32 nIndex = 0;
while ( true ) while ( true )
...@@ -109,10 +110,13 @@ sal_Int32 TextRun::insertAt( ...@@ -109,10 +110,13 @@ sal_Int32 TextRun::insertAt(
nCount++; nCount++;
} }
while( ( ( nCount + nIndex ) < getText().getLength() ) && ( ( getText()[ nCount + nIndex ] & 0xff00 ) != 0xf000 ) ); while( ( ( nCount + nIndex ) < getText().getLength() ) && ( ( getText()[ nCount + nIndex ] & 0xff00 ) != 0xf000 ) );
if (bLatinOk)
{
aPropSet.setAnyProperty( PROP_CharFontName, Any( aLatinFontName ) ); aPropSet.setAnyProperty( PROP_CharFontName, Any( aLatinFontName ) );
aPropSet.setAnyProperty( PROP_CharFontPitch, Any( nLatinFontPitch ) ); aPropSet.setAnyProperty( PROP_CharFontPitch, Any( nLatinFontPitch ) );
aPropSet.setAnyProperty( PROP_CharFontFamily, Any( nLatinFontFamily ) ); aPropSet.setAnyProperty( PROP_CharFontFamily, Any( nLatinFontFamily ) );
} }
}
OUString aSubString( getText().copy( nIndex, nCount ) ); OUString aSubString( getText().copy( nIndex, nCount ) );
xText->insertString( xStart, aSubString, sal_False ); xText->insertString( xStart, aSubString, sal_False );
nIndex += nCount; nIndex += nCount;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment