plaintorich: only setup beacons if needed
This commit is contained in:
parent
e892ca4fa4
commit
d58f028319
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: plaintorich.cpp,v 1.24 2007-06-12 13:31:38 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: plaintorich.cpp,v 1.25 2007-06-25 10:13:39 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -342,7 +342,7 @@ static string termBeacon(int i)
|
|||||||
// editor's find() function to position on it
|
// editor's find() function to position on it
|
||||||
bool plaintorich(const string& in, string& out,
|
bool plaintorich(const string& in, string& out,
|
||||||
const HiliteData& hdata,
|
const HiliteData& hdata,
|
||||||
bool noHeader, bool)
|
bool noHeader, bool needBeacons)
|
||||||
{
|
{
|
||||||
Chrono chron;
|
Chrono chron;
|
||||||
out.erase();
|
out.erase();
|
||||||
@ -413,7 +413,8 @@ bool plaintorich(const string& in, string& out,
|
|||||||
if (tPosIt != tboffsend) {
|
if (tPosIt != tboffsend) {
|
||||||
int ibyteidx = chariter.getBpos();
|
int ibyteidx = chariter.getBpos();
|
||||||
if (ibyteidx == tPosIt->first) {
|
if (ibyteidx == tPosIt->first) {
|
||||||
out += termBeacon(anchoridx++);
|
if (needBeacons)
|
||||||
|
out += termBeacon(anchoridx++);
|
||||||
out += "<termtag>";
|
out += "<termtag>";
|
||||||
} else if (ibyteidx == tPosIt->second) {
|
} else if (ibyteidx == tPosIt->second) {
|
||||||
// Output end tag, then skip all highlight areas that
|
// Output end tag, then skip all highlight areas that
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef _PLAINTORICH_H_INCLUDED_
|
#ifndef _PLAINTORICH_H_INCLUDED_
|
||||||
#define _PLAINTORICH_H_INCLUDED_
|
#define _PLAINTORICH_H_INCLUDED_
|
||||||
/* @(#$Id: plaintorich.h,v 1.13 2007-05-23 09:19:48 dockes Exp $ (C) 2004 J.F.Dockes */
|
/* @(#$Id: plaintorich.h,v 1.14 2007-06-25 10:13:40 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -39,12 +39,12 @@ struct HiliteData {
|
|||||||
* @param hdata terms and groups to be highlighted. These are
|
* @param hdata terms and groups to be highlighted. These are
|
||||||
* lowercase and unaccented.
|
* lowercase and unaccented.
|
||||||
* @param noHeader if true don't output header (<qt><title>...)
|
* @param noHeader if true don't output header (<qt><title>...)
|
||||||
* @param fft If true mark the first term position in the text
|
* @param needBeacons Need to navigate highlighted terms, mark them.
|
||||||
*/
|
*/
|
||||||
extern bool plaintorich(const string &in, string &out,
|
extern bool plaintorich(const string &in, string &out,
|
||||||
const HiliteData& hdata,
|
const HiliteData& hdata,
|
||||||
bool noHeader = false,
|
bool noHeader = false,
|
||||||
bool fft = false);
|
bool needBeacons = true);
|
||||||
|
|
||||||
extern string termAnchorName(int i);
|
extern string termAnchorName(int i);
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.27 2007-06-19 08:36:24 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.28 2007-06-25 10:13:40 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@ -473,7 +473,7 @@ void ResList::resultPageNext()
|
|||||||
}
|
}
|
||||||
// No need to call escapeHtml(), plaintorich handles it
|
// No need to call escapeHtml(), plaintorich handles it
|
||||||
string richabst;
|
string richabst;
|
||||||
plaintorich(abstract, richabst, hdata, true);
|
plaintorich(abstract, richabst, hdata, true, false);
|
||||||
|
|
||||||
// Links;
|
// Links;
|
||||||
string linksbuf;
|
string linksbuf;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user