From 39abe4f1a6c6f52a07a19cfc34a66db6a6062e7c Mon Sep 17 00:00:00 2001 From: Igor Kushnir Date: Thu, 16 Jun 2022 21:13:56 +0300 Subject: [PATCH 1/2] Restart search when case sensitivity changes One issue with the current implementation is that a wrong-cased match remains selected when the user checks the Case Sensitive checkbox. Another issue is that the noResults property of searchText is not updated right away, which means that searchText's background color remains wrong until next search. Handle toggling case sensitivity in the same way as editing the searched text: restart search from the beginning of the page. This improves the Search-in-page UI consistency. --- articleview.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articleview.cc b/articleview.cc index c71cfa86..3d10e37b 100644 --- a/articleview.cc +++ b/articleview.cc @@ -2285,7 +2285,7 @@ void ArticleView::on_searchCloseButton_clicked() void ArticleView::on_searchCaseSensitive_clicked() { - performFindOperation( false, false, true ); + performFindOperation( true, false ); } void ArticleView::on_highlightAllButton_clicked() From 01a8995504f8d2952a8ed4fe237b14c82a97fd61 Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Wed, 22 Jun 2022 07:52:02 +0800 Subject: [PATCH 2/2] the headword length is not correct due to the parse of the headword length , the last headword has incorrect data length ,which has cross over many headwords. the string(constData) will ignore the other headwords coming behind the \0 character. --- mdx.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mdx.cc b/mdx.cc index fb1df58f..f720a3cc 100644 --- a/mdx.cc +++ b/mdx.cc @@ -949,7 +949,8 @@ void MdxDictionary::loadArticle( uint32_t offset, string & articleText, bool noF article = filterResource( articleId, article ); } - articleText = article.toStdString(); + // articleText = article.toStdString(); + articleText = string( article.toUtf8().constData() ); } QString & MdxDictionary::filterResource( QString const & articleId, QString & article )