Only create the snippets menu entry if doc has pages. Add code for a snippets window link inside the result list

This commit is contained in:
Jean-Francois Dockes
2012-10-02 10:56:23 +02:00
parent 71d23639bb
commit 133d3b2a10
7 changed files with 117 additions and 29 deletions
+12 -1
View File
@@ -112,10 +112,17 @@ class Doc {
// and indexed
string text;
/////////////////////////////////////////////////
// Misc stuff
int pc; // relevancy percentage, used by sortseq, convenience
unsigned long xdocid; // Opaque: rcldb doc identifier.
// Page breaks were stored during indexing.
bool haspages;
///////////////////////////////////////////////////////////////////
void erase() {
url.erase();
ipath.erase();
@@ -133,8 +140,12 @@ class Doc {
text.erase();
pc = 0;
xdocid = 0;
haspages = false;
}
Doc()
: syntabs(false), pc(0), xdocid(0), haspages(false)
{
}
/** Get value for named field. If value pointer is 0, just test existence */
bool getmeta(const string& nm, string *value = 0) const
{
+1
View File
@@ -325,6 +325,7 @@ bool Query::makeDocAbstract(Doc &doc, vector<string>& abstract)
it != vpabs.end(); it++) {
string chunk;
if (it->first > 0) {
doc.haspages = true;
ostringstream ss;
ss << it->first;
chunk += string(" [p ") + ss.str() + "] ";