mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
fix:epwing navigation reference to invalid position
This commit is contained in:
parent
209b5e79da
commit
bbec4685f8
|
@ -361,9 +361,7 @@ void EpwingDictionary::loadArticleNextPage(string & articleHeadword, string & ar
|
|||
}
|
||||
catch( std::exception & e )
|
||||
{
|
||||
text = QString( "Article reading error: %1")
|
||||
.arg( QString::fromUtf8( e.what() ) );
|
||||
articleText = string( text.toUtf8().data() );
|
||||
qWarning() << QString( "Article reading error: %1" ).arg( QString::fromUtf8( e.what() ) );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -399,8 +397,7 @@ void EpwingDictionary::loadArticlePreviousPage(
|
|||
pos = eBook.getArticlePreviousPage( headword, text, articlePage, articleOffset, false );
|
||||
}
|
||||
catch( std::exception & e ) {
|
||||
text = QString( "Article reading error: %1" ).arg( QString::fromUtf8( e.what() ) );
|
||||
articleText = string( text.toUtf8().data() );
|
||||
qDebug() << QString( "Article reading error: %1" ).arg( QString::fromUtf8( e.what() ) );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -778,6 +775,15 @@ void EpwingArticleRequest::run()
|
|||
dict.loadArticlePreviousPage( headword, articleText, articlePage, articleOffset );
|
||||
}
|
||||
|
||||
//the reference may not contain valid text. at this point ,should return directly.
|
||||
if ( articleText.empty() ) {
|
||||
//clear result.
|
||||
result.clear();
|
||||
// No such word
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
result += articleText;
|
||||
}
|
||||
|
||||
|
|
2
thirdparty/eb
vendored
2
thirdparty/eb
vendored
|
@ -1 +1 @@
|
|||
Subproject commit ec8904dc8b390b746573492806790cd11b164927
|
||||
Subproject commit f45db88f160a9e597c3e050d37c011934fa5e773
|
Loading…
Reference in a new issue