ensure ppd translation indexes are valid
This commit is contained in:
parent
84cc2688f4
commit
825d31d5f1
1 changed files with 9 additions and 3 deletions
|
@ -1097,9 +1097,14 @@ void PPDParser::parse( ::std::list< rtl::OString >& rLines )
|
|||
{
|
||||
aLine = aLine.copy(1);
|
||||
nTransPos = aLine.indexOf('"');
|
||||
if (nTransPos == -1)
|
||||
nTransPos = aLine.getLength();
|
||||
aValue = String( aLine.copy( 0, nTransPos ), RTL_TEXTENCODING_MS_1252 );
|
||||
// after the second doublequote can follow a / and a translation
|
||||
aValueTranslation = handleTranslation( aLine.copy( nTransPos+2 ), bIsGlobalizedLine );
|
||||
if (nTransPos+2 < aLine.getLength())
|
||||
{
|
||||
// after the second doublequote can follow a / and a translation
|
||||
aValueTranslation = handleTranslation( aLine.copy( nTransPos+2 ), bIsGlobalizedLine );
|
||||
}
|
||||
// check for quoted value
|
||||
if( aOption.Len() &&
|
||||
aUniKey.CompareToAscii( "JCL", 3 ) != COMPARE_EQUAL )
|
||||
|
@ -1125,7 +1130,8 @@ void PPDParser::parse( ::std::list< rtl::OString >& rLines )
|
|||
if (nTransPos == -1)
|
||||
nTransPos = aLine.getLength();
|
||||
aValue = String( aLine.copy( 0, nTransPos ), RTL_TEXTENCODING_MS_1252 );
|
||||
aValueTranslation = handleTranslation( aLine.copy( nTransPos+1 ), bIsGlobalizedLine );
|
||||
if (nTransPos+1 < aLine.getLength())
|
||||
aValueTranslation = handleTranslation( aLine.copy( nTransPos+1 ), bIsGlobalizedLine );
|
||||
eType = eString;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue