mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Bugfix: Invalid parsing of postscript function
This commit is contained in:
@@ -32,7 +32,8 @@ namespace pdf
|
||||
PDFLexicalAnalyzer::PDFLexicalAnalyzer(const char* begin, const char* end) :
|
||||
m_begin(begin),
|
||||
m_current(begin),
|
||||
m_end(end)
|
||||
m_end(end),
|
||||
m_tokenizingPostScriptFunction(false)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -454,6 +455,16 @@ PDFLexicalAnalyzer::Token PDFLexicalAnalyzer::fetch()
|
||||
return Token(TokenType::Command, std::move(command));
|
||||
}
|
||||
}
|
||||
else if (m_tokenizingPostScriptFunction)
|
||||
{
|
||||
const char currentChar = lookChar();
|
||||
if (currentChar == CHAR_LEFT_CURLY_BRACKET || currentChar == CHAR_RIGHT_CURLY_BRACKET)
|
||||
{
|
||||
return Token(TokenType::Command, QByteArray(1, fetchChar()));
|
||||
}
|
||||
|
||||
error(tr("Unexpected character '%1' in the stream.").arg(currentChar));
|
||||
}
|
||||
else
|
||||
{
|
||||
error(tr("Unexpected character '%1' in the stream.").arg(lookChar()));
|
||||
|
Reference in New Issue
Block a user