Index: /trunk/gsdl/src/recpt/pagedbrowserclass.cpp
===================================================================
--- /trunk/gsdl/src/recpt/pagedbrowserclass.cpp	(revision 911)
+++ /trunk/gsdl/src/recpt/pagedbrowserclass.cpp	(revision 912)
@@ -28,4 +28,7 @@
 /*
    $Log$
+   Revision 1.5  2000/02/06 21:29:11  sjboddie
+   fixed a bug - made some functions virtual for use with cstr collection
+
    Revision 1.4  1999/10/30 23:06:25  sjboddie
    tidied up a bit
@@ -67,19 +70,19 @@
 }
 
-// if the "gp" (go to page) argument is set we need to set 
+// if the "gp" (go to page) argument is set we need to set
 // the "d" argument to the corresponding page
 void pagedbrowserclass::processOID (cgiargsclass &args, recptproto *collectproto,
-				    ostream &logout) {
+                                    ostream &logout) {
 
   text_t &arg_d = args["d"];
   text_t &arg_gp = args["gp"];
-  
+  text_tset metadata;
+  bool getParents = false;
+  FilterResponse_t response;
+
   if ((!arg_d.empty()) && (!arg_gp.empty()) && (is_number (arg_gp))) {
     text_t top;
     get_top (arg_d, top);
-    text_tset metadata;
     metadata.insert ("Title");
-    bool getParents = false;
-    FilterResponse_t response;
     get_children (top, args["c"], metadata, getParents, collectproto, response, logout);
     ResultDocInfo_tarray::iterator dochere = response.docInfo.begin();
@@ -87,12 +90,20 @@
     while (dochere != docend) {
       if ((*dochere).metadata["Title"].values[0] == arg_gp) {
-	arg_d = (*dochere).OID;
-	break;
+        arg_d = (*dochere).OID;
+        break;
       }
       dochere ++;
     }
-  }
-}
-
+
+  } else if (!arg_d.empty() && is_top(arg_d)) { // if top level doc, check if not invisible
+    metadata.insert("thistype");
+    if(get_info(arg_d, args["c"], metadata, getParents, collectproto, response, logout)) {
+      text_t type = response.docInfo[0].metadata["thistype"].values[0];
+      if (type=="Invisible") { // display first child
+        arg_d = arg_d + ".1";
+      }
+    }
+  }
+}
 
 int pagedbrowserclass::output_section_group (ResultDocInfo_t &section, cgiargsclass &args,
@@ -156,5 +167,5 @@
 	previousarrow = "_document:parentarrow_";
 
-      if (thissection != sections.docInfo.end()) {
+      if ((thissection+1) != endsection) {
 	nextOID = (*(thissection+1)).OID;
 	nexttitle = (*(thissection+1)).metadata["Title"].values[0];
Index: /trunk/gsdl/src/recpt/pagedbrowserclass.h
===================================================================
--- /trunk/gsdl/src/recpt/pagedbrowserclass.h	(revision 911)
+++ /trunk/gsdl/src/recpt/pagedbrowserclass.h	(revision 912)
@@ -47,18 +47,18 @@
   text_t get_default_formatstring ();
 
-  void processOID (cgiargsclass &args, recptproto *collectproto,
-		   ostream &logout);
+  virtual void processOID (cgiargsclass &args, recptproto *collectproto,
+			   ostream &logout);
 
-  int output_section_group (ResultDocInfo_t &section, cgiargsclass &args,
-			    const text_t &collection, int colnumber, format_t *formatlistptr, 
-			    bool use_table, text_tset &metadata, bool &getParents,
-			    recptproto *collectproto, displayclass &disp, 
-			    outconvertclass &outconvert, ostream &textout, ostream &logout);
+  virtual int output_section_group (ResultDocInfo_t &section, cgiargsclass &args,
+				    const text_t &collection, int colnumber, format_t *formatlistptr, 
+				    bool use_table, text_tset &metadata, bool &getParents,
+				    recptproto *collectproto, displayclass &disp, 
+				    outconvertclass &outconvert, ostream &textout, ostream &logout);
 
-  int output_section_group (FilterResponse_t &sections, cgiargsclass &args,
-			    const text_t &collection, int colnumber, format_t *formatlistptr, 
-			    bool use_table, text_tset &metadata, bool &getParents,
-			    recptproto *collectproto, displayclass &disp, 
-			    outconvertclass &outconvert, ostream &textout, ostream &logout);
+  virtual int output_section_group (FilterResponse_t &sections, cgiargsclass &args,
+				    const text_t &collection, int colnumber, format_t *formatlistptr, 
+				    bool use_table, text_tset &metadata, bool &getParents,
+				    recptproto *collectproto, displayclass &disp, 
+				    outconvertclass &outconvert, ostream &textout, ostream &logout);
 
 };
