Changeset 5140
- Timestamp:
- 2003-08-15T16:53:41+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/highlighttext.cpp
r3323 r5140 37 37 38 38 static void get_phrase_terms (const text_t &querystring, text_tarray &phrase_terms); 39 40 static void remove_space (text_t &qstring); 39 41 40 42 // highlights text string by adding _starthighlight_ and _endhightlight_ … … 65 67 disp.expandstring("Global", "_endhighlight_", ehl); 66 68 } 69 70 // remove leading and trailing whitespace 71 remove_space(querystring); 67 72 68 73 if ((args["hl"] == 2) || ((*(querystring.begin()) == '"') && (*(querystring.end()-1) == '"'))) { … … 255 260 } 256 261 } 262 263 void remove_space (text_t &qstring) { 264 265 text_t altered_string; 266 text_t space; 267 268 text_t::const_iterator here = qstring.begin(); 269 text_t::const_iterator end = qstring.end(); 270 while (here != end) { 271 if (is_unicode_space(*here)) { 272 space.push_back(*here); 273 } else { 274 if (!altered_string.empty()) { 275 altered_string += space; 276 } 277 space.clear(); 278 altered_string.push_back(*here); 279 } 280 here++; 281 } 282 283 qstring = altered_string; 284 }
Note:
See TracChangeset
for help on using the changeset viewer.