diff options
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 88 |
1 files changed, 48 insertions, 40 deletions
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index d89f4c3031f5..545afd68514d 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -4768,58 +4768,66 @@ bool PPTTextSpecInfoAtomInterpreter::Read( SvStream& rIn, const DffRecordHeader& rRecHd.SeekToContent( rIn ); auto nEndRecPos = DffPropSet::SanitizeEndPos(rIn, rRecHd.GetRecEndFilePos()); - while (rIn.Tell() < nEndRecPos && rIn.good()) + try { - if ( nRecordType == PPT_PST_TextSpecInfoAtom ) + while (rIn.Tell() < nEndRecPos && rIn.good()) { - sal_uInt32 nCharCount(0); - rIn.ReadUInt32( nCharCount ); - nCharIdx += nCharCount; - } + if ( nRecordType == PPT_PST_TextSpecInfoAtom ) + { + sal_uInt32 nCharCount(0); + rIn.ReadUInt32( nCharCount ); + nCharIdx += nCharCount; + } - sal_uInt32 nFlags(0); - rIn.ReadUInt32(nFlags); + sal_uInt32 nFlags(0); + rIn.ReadUInt32(nFlags); - PPTTextSpecInfo aEntry( nCharIdx ); - if ( pTextSpecDefault ) - { - aEntry.nDontKnow = pTextSpecDefault->nDontKnow; - aEntry.nLanguage[ 0 ] = pTextSpecDefault->nLanguage[ 0 ]; - aEntry.nLanguage[ 1 ] = pTextSpecDefault->nLanguage[ 1 ]; - aEntry.nLanguage[ 2 ] = pTextSpecDefault->nLanguage[ 2 ]; - } - for (sal_uInt32 i = 1; nFlags && i ; i <<= 1) - { - sal_uInt16 nLang = 0; - switch( nFlags & i ) + PPTTextSpecInfo aEntry( nCharIdx ); + if ( pTextSpecDefault ) { - case 0 : break; - case 1 : rIn.ReadUInt16( aEntry.nDontKnow ); break; - case 2 : rIn.ReadUInt16( nLang ); break; - case 4 : rIn.ReadUInt16( nLang ); break; - default : - { - rIn.SeekRel( 2 ); - } + aEntry.nDontKnow = pTextSpecDefault->nDontKnow; + aEntry.nLanguage[ 0 ] = pTextSpecDefault->nLanguage[ 0 ]; + aEntry.nLanguage[ 1 ] = pTextSpecDefault->nLanguage[ 1 ]; + aEntry.nLanguage[ 2 ] = pTextSpecDefault->nLanguage[ 2 ]; } - if ( nLang ) + for (sal_uInt32 i = 1; nFlags && i ; i <<= 1) { - // #i119985#, we could probably handle this better if we have a - // place to override the final language for weak - // characters/fields to fallback to, rather than the current - // application locale. Assuming that we can determine what the - // default fallback language for a given .ppt, etc is during - // load time. - if (i == 2) + sal_uInt16 nLang = 0; + switch( nFlags & i ) { - aEntry.nLanguage[ 0 ] = aEntry.nLanguage[ 1 ] = aEntry.nLanguage[ 2 ] = LanguageType(nLang); + case 0 : break; + case 1 : rIn.ReadUInt16( aEntry.nDontKnow ); break; + case 2 : rIn.ReadUInt16( nLang ); break; + case 4 : rIn.ReadUInt16( nLang ); break; + default : + { + rIn.SeekRel( 2 ); + } } + if ( nLang ) + { + // #i119985#, we could probably handle this better if we have a + // place to override the final language for weak + // characters/fields to fallback to, rather than the current + // application locale. Assuming that we can determine what the + // default fallback language for a given .ppt, etc is during + // load time. + if (i == 2) + { + aEntry.nLanguage[ 0 ] = aEntry.nLanguage[ 1 ] = aEntry.nLanguage[ 2 ] = LanguageType(nLang); + } + } + nFlags &= ~i; } - nFlags &= ~i; + aList.push_back( aEntry ); } - aList.push_back( aEntry ); + bValid = rIn.Tell() == rRecHd.GetRecEndFilePos(); + } + catch (const SvStreamEOFException&) + { + SAL_WARN("filter.ms", "EOF"); + bValid = false; } - bValid = rIn.Tell() == rRecHd.GetRecEndFilePos(); return bValid; } |