mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-24 18:35:37 +00:00
Bug 262265 chmlib should not send qFatal if encoding could not be guessed
Okular sends a 'qFatal()', if no encoding could be guessed. This will also create a core dump crashing Okular and all open document in this instance. Bugs closed: 262265 Reviewed at https://git.reviewboard.kde.org/r/130106/
This commit is contained in:
parent
357f198c1e
commit
e876640c21
|
@ -101,7 +101,8 @@ bool LCHMFileImpl::loadFile( const QString & archiveName )
|
|||
// and guess the encoding
|
||||
getInfoFromWindows();
|
||||
getInfoFromSystem();
|
||||
guessTextEncoding();
|
||||
if ( !guessTextEncoding() )
|
||||
return false;
|
||||
|
||||
// Check whether the search tables are present
|
||||
if ( ResolveObject(QStringLiteral("/#TOPICS"), &m_chmTOPICS)
|
||||
|
@ -1192,8 +1193,11 @@ bool LCHMFileImpl::guessTextEncoding( )
|
|||
const LCHMTextEncoding * enc = 0;
|
||||
|
||||
if ( !m_detectedLCID || (enc = lookupByLCID (m_detectedLCID)) == 0 )
|
||||
qFatal ("Could not detect text encoding by LCID");
|
||||
|
||||
{
|
||||
qWarning ("Could not detect text encoding by LCID");
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( changeFileEncoding (enc->qtcodec) )
|
||||
{
|
||||
m_currentEncoding = enc;
|
||||
|
|
Loading…
Reference in a new issue