diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2009-12-15 11:53:06 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2009-12-15 11:53:06 +0100 |
commit | 1c0ea39cacdd551310d1f263b652d0e0aefa68b6 (patch) | |
tree | bad155dc253f6a9e76664daac0ca4955d5824172 /vcl/unx | |
parent | 5f6d2c4a5c2210efa12a8009bdaedf408197b06f (diff) |
vcl108: #i100644# be prepared for empty invocation values
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/source/printer/ppdparser.cxx | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/vcl/unx/source/printer/ppdparser.cxx b/vcl/unx/source/printer/ppdparser.cxx index 95bc7bca41ca..705dcf8ccad7 100644 --- a/vcl/unx/source/printer/ppdparser.cxx +++ b/vcl/unx/source/printer/ppdparser.cxx @@ -806,20 +806,34 @@ void PPDParser::parse( ::std::list< ByteString >& rLines ) // read in more lines if necessary for multiline values aLine = aCurrentLine.Copy( nPos+1 ); - while( ! ( aLine.GetTokenCount( '"' ) & 1 ) && - line != rLines.end() ) - // while there is an even number of tokens; that m_eans - // an odd number of doubleqoutes + if( aLine.Len() ) { - // copy the newlines also - aLine += '\n'; - aLine += *line; - ++line; + while( ! ( aLine.GetTokenCount( '"' ) & 1 ) && + line != rLines.end() ) + // while there is an even number of tokens; that means + // an odd number of doubleqoutes + { + // copy the newlines also + aLine += '\n'; + aLine += *line; + ++line; + } } aLine = WhitespaceToSpace( aLine ); + // #i100644# handle a missing value (actually a broken PPD) + if( ! aLine.Len() ) + { + pValue->m_aValue = String(); + pValue->m_aValueTranslation = String(); + if( pValue->m_aOption.Len() && + aKey.CompareTo( "JCL", 3 ) != COMPARE_EQUAL ) + pValue->m_eType = eInvocation; + else + pValue->m_eType = eQuoted; + } // check for invocation or quoted value - if( aLine.GetChar(0) == '"' ) + else if( aLine.GetChar(0) == '"' ) { aLine.Erase( 0, 1 ); nTransPos = aLine.Search( '"' ); |