add functions and interface to display the duplicates of a result document

This commit is contained in:
Jean-Francois Dockes
2013-04-17 09:36:46 +02:00
parent 14bab449cb
commit de82f13ddc
11 changed files with 217 additions and 9 deletions
+12
View File
@@ -108,6 +108,11 @@ class DocSequence {
{
return -1;
}
/** Get duplicates. */
virtual bool docDups(const Rcl::Doc&, std::vector<Rcl::Doc>&)
{
return false;
}
virtual bool getEnclosing(Rcl::Doc&, Rcl::Doc&) = 0;
@@ -185,6 +190,13 @@ public:
return false;
return m_seq->getAbstract(doc, abs);
}
/** Get duplicates. */
virtual bool docDups(const Rcl::Doc& doc, std::vector<Rcl::Doc>& dups)
{
if (m_seq.isNull())
return false;
return m_seq->docDups(doc, dups);
}
virtual bool snippetsCapable()
{
+9
View File
@@ -239,3 +239,12 @@ bool DocSequenceDb::setQuery()
}
return m_lastSQStatus;
}
bool DocSequenceDb::docDups(const Rcl::Doc& doc, std::vector<Rcl::Doc>& dups)
{
if (m_q->whatDb()) {
return m_q->whatDb()->docDups(doc, dups);
} else {
return false;
}
}
+1
View File
@@ -39,6 +39,7 @@ class DocSequenceDb : public DocSequence {
virtual bool getAbstract(Rcl::Doc &doc, vector<string>&);
virtual int getFirstMatchPage(Rcl::Doc&, std::string& term);
virtual bool getEnclosing(Rcl::Doc& doc, Rcl::Doc& pdoc);
virtual bool docDups(const Rcl::Doc& doc, std::vector<Rcl::Doc>& dups);
virtual string getDescription();
virtual list<string> expand(Rcl::Doc &doc);
virtual bool canFilter() {return true;}
+9
View File
@@ -255,6 +255,15 @@ void ResListPager::displayDoc(RclConfig *config, int i, Rcl::Doc& doc,
linksbuf << "&nbsp;&nbsp;" << snipsbuf.str();
}
string collapscnt;
if (doc.getmeta(Rcl::Doc::keycc, &collapscnt) && !collapscnt.empty()) {
ostringstream collpsbuf;
int clc = atoi(collapscnt.c_str()) + 1;
collpsbuf << "<a href=\"D" << docnumforlinks << "\">"
<< trans("Dups") << "(" << clc << ")" << "</a>&nbsp;&nbsp;";
linksbuf << "&nbsp;&nbsp;" << collpsbuf.str();
}
// Build the result list paragraph:
// Subheader: this is used by history