|
a/src/qtgui/plaintorich.cpp |
|
b/src/qtgui/plaintorich.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: plaintorich.cpp,v 1.24 2007-06-12 13:31:38 dockes Exp $ (C) 2005 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: plaintorich.cpp,v 1.25 2007-06-25 10:13:39 dockes Exp $ (C) 2005 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
/*
|
4 |
/*
|
5 |
* This program is free software; you can redistribute it and/or modify
|
5 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* it under the terms of the GNU General Public License as published by
|
6 |
* it under the terms of the GNU General Public License as published by
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
|
... |
|
... |
340 |
// don't know the term par/car positions in the editor text. Instead,
|
340 |
// don't know the term par/car positions in the editor text. Instead,
|
341 |
// we return the first term encountered, and the caller will use the
|
341 |
// we return the first term encountered, and the caller will use the
|
342 |
// editor's find() function to position on it
|
342 |
// editor's find() function to position on it
|
343 |
bool plaintorich(const string& in, string& out,
|
343 |
bool plaintorich(const string& in, string& out,
|
344 |
const HiliteData& hdata,
|
344 |
const HiliteData& hdata,
|
345 |
bool noHeader, bool)
|
345 |
bool noHeader, bool needBeacons)
|
346 |
{
|
346 |
{
|
347 |
Chrono chron;
|
347 |
Chrono chron;
|
348 |
out.erase();
|
348 |
out.erase();
|
349 |
const vector<string>& terms(hdata.terms);
|
349 |
const vector<string>& terms(hdata.terms);
|
350 |
const vector<vector<string> >& groups(hdata.groups);
|
350 |
const vector<vector<string> >& groups(hdata.groups);
|
|
... |
|
... |
411 |
// If we still have terms positions, check (byte) position. If
|
411 |
// If we still have terms positions, check (byte) position. If
|
412 |
// we are at or after a term match, mark.
|
412 |
// we are at or after a term match, mark.
|
413 |
if (tPosIt != tboffsend) {
|
413 |
if (tPosIt != tboffsend) {
|
414 |
int ibyteidx = chariter.getBpos();
|
414 |
int ibyteidx = chariter.getBpos();
|
415 |
if (ibyteidx == tPosIt->first) {
|
415 |
if (ibyteidx == tPosIt->first) {
|
|
|
416 |
if (needBeacons)
|
416 |
out += termBeacon(anchoridx++);
|
417 |
out += termBeacon(anchoridx++);
|
417 |
out += "<termtag>";
|
418 |
out += "<termtag>";
|
418 |
} else if (ibyteidx == tPosIt->second) {
|
419 |
} else if (ibyteidx == tPosIt->second) {
|
419 |
// Output end tag, then skip all highlight areas that
|
420 |
// Output end tag, then skip all highlight areas that
|
420 |
// would overlap this one
|
421 |
// would overlap this one
|
421 |
out += "</termtag>";
|
422 |
out += "</termtag>";
|