Commit 6cea4372 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Don't crash with files that have fonts with no name

parent 1323c744
2005-07-05 Albert Astals Cid <aacid@kde.org>
* qt4/src/poppler-document.cc (Poppler):
* qt4/src/poppler-qt4.h: Don't crash with files that have fonts with
no name, for example the one found at
http://bugs.kde.org/show_bug.cgi?id=101520.
2005-07-05 Brad Hards <bradh@frogmouth.net>
* qt4/src/poppler-document.cc (Poppler):
......
......@@ -130,13 +130,20 @@ namespace Poppler {
return false;
for ( int i = 0; i < items->getLength(); ++i ) {
FontInfo thisFont(((::FontInfo*)items->get(i))->getName()->getCString(),
if (((::FontInfo*)items->get(i))->getName())
fontList->append(FontInfo(((::FontInfo*)items->get(i))->getName()->getCString(),
((::FontInfo*)items->get(i))->getEmbedded(),
((::FontInfo*)items->get(i))->getSubset(),
((::FontInfo*)items->get(i))->getToUnicode(),
(Poppler::FontInfo::Type)((::FontInfo*)items->get(i))->getType()
);
fontList->append(thisFont);
));
else
fontList->append(FontInfo(QString::null,
((::FontInfo*)items->get(i))->getEmbedded(),
((::FontInfo*)items->get(i))->getSubset(),
((::FontInfo*)items->get(i))->getToUnicode(),
(Poppler::FontInfo::Type)((::FontInfo*)items->get(i))->getType()
));
}
return true;
}
......
......@@ -67,7 +67,7 @@ namespace Poppler {
{};
/**
The name of the font
The name of the font. Can be QString::null if the font has no name
*/
QString name() const
{ return m_fontName; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment