Switch to side-by-side view

--- a/src/qtgui/plaintorich.h
+++ b/src/qtgui/plaintorich.h
@@ -16,9 +16,12 @@
  */
 #ifndef _PLAINTORICH_H_INCLUDED_
 #define _PLAINTORICH_H_INCLUDED_
-/* @(#$Id: plaintorich.h,v 1.14 2007-06-25 10:13:40 dockes Exp $  (C) 2004 J.F.Dockes */
+/* @(#$Id: plaintorich.h,v 1.15 2007-10-18 10:39:41 dockes Exp $  (C) 2004 J.F.Dockes */
 
 #include <string>
+#include <list>
+using std::list;
+using std::string;
 
 // A data struct to hold words and groups of words to be highlighted
 struct HiliteData {
@@ -35,23 +38,26 @@
  * of phrase/near searches. We treat all such searches as "near", not "phrase"
  * 
  * @param in          raw text out of internfile.
- * @param out         rich text output
+ * @param out         rich text output, divided in chunks (to help our caller
+ *          avoid inserting half tags into textedit which doesnt like it)
  * @param hdata       terms and groups to be highlighted. These are
  *                     lowercase and unaccented.
  * @param noHeader    if true don't output header (<qt><title>...)
  * @param needBeacons Need to navigate highlighted terms, mark them.
  */
-extern bool plaintorich(const string &in, string &out,
+extern bool plaintorich(const string &in, list<string> &out,
 			const HiliteData& hdata,
-			bool noHeader = false,
-			bool needBeacons = true);
+			bool noHeader,
+			bool needBeacons,
+			int chunksize = 50000
+			);
 
 extern string termAnchorName(int i);
 
 #define QT_SCROLL_TO_ANCHOR_BUG
 #ifdef QT_SCROLL_TO_ANCHOR_BUG
-// For some reason, can't get scrollToAnchor() to work. We use a string made
-// of a few rare utf8 chars as a beacon for the match area.
+// For some reason, can't get scrollToAnchor() to work. We use a special 
+// string as a beacon for the match area.
 extern const char *firstTermBeacon;
 #endif