use getmatchingterms instead of getqueryterms for highlighting etc. in preview

This commit is contained in:
dockes
2006-04-27 06:12:10 +00:00
parent 1bcdf8515e
commit 72dec21fe5
4 changed files with 43 additions and 10 deletions
+1 -1
View File
@@ -502,7 +502,7 @@ bool Preview::loadFileInCurrentTab(string fn, size_t sz, const Rcl::Doc &idoc)
bool highlightTerms = fdoc.text.length() < 1000 *1024;
string firstTerm;
list<string> terms;
rcldb->getQueryTerms(terms);
rcldb->getMatchTerms(idoc, terms);
if (highlightTerms) {
progress.setLabelText(tr("Creating preview text"));
ToRichThread rthr(fdoc.text, terms, firstTerm, richTxt);
+4 -3
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: rclmain.cpp,v 1.25 2006-04-26 11:29:10 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: rclmain.cpp,v 1.26 2006-04-27 06:12:10 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -442,7 +442,7 @@ void RclMain::startPreview(int docnum)
// (which is different because it's format is explicit richtext
// instead of auto as for preview, needed because it's built by
// fragments?).
static const char* punct = " \t()<>\"'[]{}!^*,";
static const char* punct = " \t()<>\"'[]{}!^*,\n\r";
void RclMain::ssearchAddTerm(QString term)
{
string t = (const char *)term.utf8();
@@ -542,7 +542,8 @@ void RclMain::docExpand(int docnum)
return;
list<string> terms;
terms = rcldb->expand(doc);
QString text = sSearch->queryText->text();
// Do we keep the original query. I think we'd better not.
QString text;// = sSearch->queryText->text();
for (list<string>::iterator it = terms.begin(); it != terms.end(); it++) {
text += QString::fromLatin1(" \"") +
QString::fromUtf8((*it).c_str()) + QString::fromLatin1("\"");