Changeset 8485
- Timestamp:
- 2004-11-08T16:58:26+13:00 (19 years ago)
- Location:
- trunk/gsdl/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/lib/display.cpp
r8451 r8485 23 23 * 24 24 *********************************************************************/ 25 #include <ostream> 25 26 26 27 #include "display.h" … … 578 579 579 580 logout = NULL; 581 582 /* this is a bit of a hack, but if the displayclass has never seen this 583 parameter before when it does openpage() then macros with this set will 584 always be ignored. And we set collection-specific macros after doing 585 openpage() - jrm */ 586 allparams.insert("l=en"); 580 587 } 581 588 … … 598 605 // -4 if no macroname was supplied 599 606 int displayclass::setdefaultmacro (text_t package, const text_t ¯oname, 600 text_t params, const text_t ¯ovalue)601 { 602 return setdefaultmacro (package, macroname, params, "memory", macrovalue);607 text_t mparams, const text_t ¯ovalue) 608 { 609 return setdefaultmacro (package, macroname, mparams, "memory", macrovalue); 603 610 } 604 611 … … 982 989 sort(orderparamlist->begin(), orderparamlist->end()); 983 990 984 // paramspeclist::iterator pshere = orderparamlist->begin(); 985 // paramspeclist::iterator psend = orderparamlist->end(); 986 // while (pshere != psend) 987 // { 988 // cerr << text_t2ascii << "param=" << (*pshere).param; 989 // cerr << " spec=" << (int)((*pshere).spec) << "\n"; 990 // pshere++; 991 // } 991 #if 0 // debugging 992 outconvertclass text_t2ascii; 993 994 paramspeclist::iterator pshere = orderparamlist->begin(); 995 paramspeclist::iterator psend = orderparamlist->end(); 996 while (pshere != psend) 997 { 998 cerr << text_t2ascii << "param=" << (*pshere).param; 999 cerr << " spec=" << (int)((*pshere).spec) << "\n"; 1000 pshere++; 1001 } 1002 #endif 992 1003 } 993 1004 … … 1245 1256 int displayclass::setparammacro (parammacros_t* macrotable, 1246 1257 text_t package, const text_t ¯oname, 1247 text_t params, const text_t &filename,1258 text_t macroparams, const text_t &filename, 1248 1259 const text_t ¯ovalue) 1249 1260 { … … 1253 1264 // put the parameters in a standard form 1254 1265 paramhashtype paramhash; 1255 if ( params.empty())params = "ignore=yes";1256 splitparams ( params, paramhash);1257 joinparams (paramhash, params);1266 if (macroparams.empty()) macroparams = "ignore=yes"; 1267 splitparams (macroparams, paramhash); 1268 joinparams (paramhash, macroparams); 1258 1269 1259 1270 // make package "Global" if it doesn't point to anything yet … … 1261 1272 1262 1273 // remember these parameters 1263 allparams.insert ( params);1274 allparams.insert (macroparams); 1264 1275 1265 1276 // remember this filename (this part isn't finished yet -- Rodger). 1266 1277 1267 1278 // set the macro 1268 return macrotable->setmacro(package, macroname, params, filename, macrovalue); 1279 return macrotable->setmacro(package, macroname, macroparams, filename, 1280 macrovalue); 1269 1281 } 1270 1282 … … 1276 1288 // -4 if no macroname was supplied 1277 1289 int displayclass::setdefaultmacro (text_t package, const text_t ¯oname, 1278 text_t params, const text_t &filename,1290 text_t macroparams, const text_t &filename, 1279 1291 const text_t ¯ovalue) 1280 1292 { 1281 return setparammacro(defaultmacros,package,macroname,params,filename,macrovalue); 1282 } 1283 1293 return setparammacro(defaultmacros,package,macroname,macroparams, 1294 filename,macrovalue); 1295 } 1296 1297 // public function 1298 int displayclass::setcollectionmacro(text_t package, const text_t ¯oname, 1299 text_t mparams, const text_t ¯ovalue) 1300 { 1301 return setcollectionmacro(package, macroname, mparams, "memory", macrovalue); 1302 } 1284 1303 1285 1304 // setcollectionmacro adds an entry to the list of collection specific macros … … 1290 1309 // -4 if no macroname was supplied 1291 1310 int displayclass::setcollectionmacro (text_t package, const text_t ¯oname, 1292 text_t params, const text_t &filename,1311 text_t mparams, const text_t &filename, 1293 1312 const text_t ¯ovalue) 1294 1313 { 1295 return setparammacro(collectionmacros,package,macroname,params,filename,macrovalue); 1314 return setparammacro(collectionmacros,package,macroname,mparams, 1315 filename,macrovalue); 1296 1316 } 1297 1317 -
trunk/gsdl/lib/display.h
r7397 r8485 195 195 int loaddefaultmacros (text_t thisfilename); 196 196 197 198 // overrides (or sets) a macro for the current page. 199 // returns 0 if there was no error, 200 // -1 if it redefined a macro 201 // -4 if no macroname was supplied 202 int setcollectionmacro (text_t package, const text_t ¯oname, 203 text_t params, const text_t ¯ovalue); 204 197 205 // loads a collection specific macro file 198 206 // returns 0 if didn't need to load the file (it was already loaded)
Note:
See TracChangeset
for help on using the changeset viewer.