Changeset 10947 for trunk/gsdl/src/recpt/hlistbrowserclass.cpp
- Timestamp:
- 2005-11-25T13:12:03+13:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/hlistbrowserclass.cpp
r10873 r10947 102 102 collectproto, response, logout); 103 103 104 104 /* use_table is set to true if the format string starts with <td> */ 105 105 if (use_table || colnumber > 0) { 106 106 textout << outconvert << "<table><tr><td>"; … … 115 115 } 116 116 117 textout << outconvert << "<table><tr>\n"; 117 if (use_table) 118 textout << outconvert << "<table class=\"h_list\"><tr>\n"; 119 else 120 textout << outconvert << "<div class=\"h_list\">\n"; 118 121 119 122 ResultDocInfo_tarray::iterator tsibling = response.docInfo.begin(); … … 121 124 122 125 text_t icon, link; 123 int num_chars=0; // see note below - jrm21 126 124 127 while (tsibling != esibling) { 125 128 … … 139 142 if (args["xx"]=="1") { 140 143 // documents should be detached 141 link += "&x=1\" target=\ \_blank>";144 link += "&x=1\" target=\"_blank\">"; 142 145 } else { 143 146 link += "\">"; … … 156 159 options, logout); 157 160 158 /* this is awful. Someone please come up with a better way to prevent 159 the table of contents when browsing metadata from becoming too wide. 160 This is an attempt to add new rows when the number of characters in 161 the current row becomes too high. It doesn't know about macros in the 162 string, though... -- jrm21 */ 163 164 char *tmp_str=fmt_str.getcstr(); 165 char *end_str=tmp_str+strlen(tmp_str); 166 while (tmp_str<end_str) { 167 if (*tmp_str=='<') { // for html tags 168 while (*tmp_str!='>') ++tmp_str; 169 } else if (*tmp_str=='&') { // for html entities 170 while (*tmp_str!=';') ++tmp_str; 171 ++num_chars; 172 } else ++num_chars; 173 ++tmp_str; 174 } 175 176 if (num_chars>100) { // this is fairly arbitrary... 177 textout << outconvert << "</tr>\n<tr>"; 178 num_chars=0; 179 } 180 181 textout << outconvert << "<td>" << disp << fmt_str << "</td>\n"; 161 textout << outconvert << "<span class=\"h_item\">" << disp << fmt_str << "</span>\n"; 182 162 ++tsibling; 183 163 } 184 164 185 textout << outconvert << "</tr></table>\n"; 165 if (use_table) 166 textout << outconvert << "</tr></table>\n"; 167 else 168 textout << outconvert << "</div>\n"; 169 186 170 if (use_table || colnumber > 0) textout << outconvert << "</tr></table>\n"; 171 187 172 return 0; 188 173 }
Note:
See TracChangeset
for help on using the changeset viewer.