Issue #72: Cannot select text

This commit is contained in:
Jakub Melka 2023-09-02 15:51:29 +02:00
parent 7eb2f2a465
commit ae6c6eb76b
1 changed files with 17 additions and 14 deletions

View File

@ -2102,22 +2102,25 @@ PDFFontCMap PDFFontCMap::createFromData(const QByteArray& data)
}
else if (command == "beginbfrange")
{
PDFLexicalAnalyzer::Token token1 = parser.fetch();
if (token1.type == PDFLexicalAnalyzer::TokenType::Command &&
token1.data.toByteArray() == "endbfrange")
while (true)
{
break;
PDFLexicalAnalyzer::Token token1 = parser.fetch();
if (token1.type == PDFLexicalAnalyzer::TokenType::Command &&
token1.data.toByteArray() == "endbfrange")
{
break;
}
PDFLexicalAnalyzer::Token token2 = parser.fetch();
PDFLexicalAnalyzer::Token token3 = parser.fetch();
std::pair<unsigned int, unsigned int> from = fetchCode(token1);
std::pair<unsigned int, unsigned int> to = fetchCode(token2);
CID cid = fetchUnicode(token3);
entries.emplace_back(from.first, to.first, qMax(from.second, to.second), cid);
}
PDFLexicalAnalyzer::Token token2 = parser.fetch();
PDFLexicalAnalyzer::Token token3 = parser.fetch();
std::pair<unsigned int, unsigned int> from = fetchCode(token1);
std::pair<unsigned int, unsigned int> to = fetchCode(token2);
CID cid = fetchUnicode(token3);
entries.emplace_back(from.first, to.first, qMax(from.second, to.second), cid);
}
else if (command == "begincidrange")
{