Changeset 11259


Ignore:
Timestamp:
2006-02-15T16:38:22+13:00 (18 years ago)
Author:
mdewsnip
Message:

Various little bug fixes and improvements (many to get things working with Visual Studio 2005), by Emanuel Dejanu.

Location:
trunk/gsdl/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/colservr/browsefilter.cpp

    r9937 r11259  
    5757  filtopt.type = FilterOption_t::stringt;
    5858  filtopt.repeatable = FilterOption_t::onePerQuery;
    59   filtopt.defaultValue = "";
     59  filtopt.defaultValue = g_EmptyText;
    6060  filterOptions["ParentNode"] = filtopt;
    6161}
  • trunk/gsdl/src/mgpp/text/GSDLQueryLex.cpp

    r8691 r11259  
    4343  // this version of end is used in unitool
    4444  //  UCArray::const_iterator endMinus1 = end-1;
    45   const unsigned char* endMinus1 = &(*end)-1;
     45  const unsigned char* endMinus1 = &*(end - 1);
    4646
    4747  int charLen;
     
    8383  // this version of end is used in unitool
    8484  //UCArray::const_iterator endMinus1 = end-1;
    85   const unsigned char* endMinus1 = &(*end)-1;
     85  const unsigned char* endMinus1 = &*(end - 1);
    8686
    8787  int charLen=0;
     
    123123               UCArray::const_iterator end,
    124124               UCArray &text) {
     125  if (here == end)
     126    return false;
     127
    125128  //UCArray::const_iterator endMinus1 = end-1;
    126   const unsigned char* endMinus1 = &(*end)-1;
     129  const unsigned char* endMinus1 = &*(end - 1);
    127130  const unsigned char* new_here = ParseIndexWord (&*here, endMinus1, text);
    128131  here += (new_here - &*here); // advance iterator by number of chars advanced
     
    137140
    138141  // strange things can happen if here == end == 0
    139   if (here == end) return false;
     142  if (here == end)
     143    return false;
    140144 
    141145  // this version of end is used in unitool
    142146  //UCArray::const_iterator endMinus1 = end-1;
    143   const unsigned char* endMinus1 = &(*end)-1;
     147  const unsigned char* endMinus1 = &*(end - 1);
    144148
    145149  // ignore all white space
  • trunk/gsdl/src/recpt/OIDtools.cpp

    r9620 r11259  
    229229// get_parent returns the parent of the document or classification
    230230// specified by OID
    231 text_t get_parent (text_t OID) {
    232 
    233   if (OID.empty() || is_top (OID)) return "";
     231text_t get_parent (const text_t& OID)
     232{
     233  if (OID.empty() || is_top (OID)) return g_EmptyText;
    234234
    235235  text_t::const_iterator begin = OID.begin();
     
    237237
    238238  while (here >= begin) {
    239     OID.pop_back();
    240     if (*here == '.') break;
     239    if (*here == '.')
     240      break;
     241    if (here == begin)
     242      break;
    241243    --here;
    242244  }
    243   return OID;
     245
     246  if (here != begin) {
     247    text_t parentOID;
     248    parentOID.appendrange(begin, here);
     249    return parentOID;
     250  }
     251
     252  return g_EmptyText;
    244253}
    245254
  • trunk/gsdl/src/recpt/OIDtools.h

    r7414 r11259  
    9393// get_parent returns the parent of the document or classification
    9494// specified by OID
    95 text_t get_parent (text_t OID);
     95text_t get_parent (const text_t& OID);
    9696
    9797// takes an OID like ".2.3 and replaces the " with parent
  • trunk/gsdl/src/recpt/cgiutils.cpp

    r9674 r11259  
    374374  text_t::const_iterator saveconfend = saveconf.end();
    375375 
    376   text_t::iterator arg_ehere = arg_e->begin();
     376  text_t::iterator arg_ebegin = arg_e->begin();
    377377  text_t::iterator arg_eend = arg_e->end();
     378  text_t::iterator arg_ehere = arg_ebegin;
    378379  while (saveconfhere != saveconfend && arg_ehere != arg_eend) {
    379380    saveconfhere = get_next_save_arg (saveconfhere, saveconfend, argname);
     
    399400      text_t::const_iterator sav = arg_ehere;
    400401      arg_ehere = getdelimitstr (arg_ehere, arg_eend, '-', argvalue);
    401       // replace any '-' chars escaped with 'Zz'
    402       bool first = true;
    403       while ((*(arg_ehere-3) == 'Z') && (*(arg_ehere-2) == 'z')) {
    404         if (first) argvalue.clear();
    405         arg_ehere = (findchar (arg_ehere, arg_eend, '-')) + 1;
    406         while (sav != (arg_ehere-1)) {
    407           if (!((*sav == 'Z') && (*(sav+1) == 'z') && (*(sav+2) == '-')) &&
    408           !((*(sav-1) == 'Z') && (*sav == 'z') && (*(sav+1) == '-'))) argvalue.push_back (*sav);
    409           ++sav;
     402      if (distance(arg_ebegin, arg_ehere) > 2) {
     403        // replace any '-' chars escaped with 'Zz'
     404        bool first = true;
     405        while ((*(arg_ehere-3) == 'Z') && (*(arg_ehere-2) == 'z')) {
     406          if (first) argvalue.clear();
     407          arg_ehere = (findchar (arg_ehere, arg_eend, '-')) + 1;
     408          while (sav != (arg_ehere-1)) {
     409        if (!((*sav == 'Z') && (*(sav+1) == 'z') && (*(sav+2) == '-')) &&
     410            !((*(sav-1) == 'Z') && (*sav == 'z') && (*(sav+1) == '-'))) argvalue.push_back (*sav);
     411        ++sav;
     412          }
     413          first = false;
    410414        }
    411         first = false;
    412415      }
    413 
    414416      argvalue.setencoding(1); // other encoding
    415417      if (!argvalue.empty()) args.setdefaultarg (argname, argvalue, cgiarg_t::compressed_arg);
  • trunk/gsdl/src/recpt/comtypes.cpp

    r10789 r11259  
    6565  numBytes=0;
    6666  format.erase(format.begin(), format.end());
    67   building.erase(format.begin(), format.end());
     67  building.erase(building.begin(), building.end());
    6868  httpdomain.clear();
    6969  httpprefix.clear();
  • trunk/gsdl/src/recpt/infodbclass.cpp

    r9620 r11259  
    384384  }
    385385
    386   if (!tailarray.size()) return inOID;
     386  if (tailarray.empty()) return inOID;
    387387  text_tarray::const_iterator begin = tailarray.begin();
    388388  text_tarray::const_iterator here = tailarray.end() - 1;
     
    401401      get_previous_sibling (OID, info);
    402402   
     403    if (here == begin)
     404      break;
    403405    --here;
    404406  }
  • trunk/gsdl/src/w32server/httpreq.cpp

    r9636 r11259  
    299299          RequestInfo.ThreadNum) != 0)
    300300    return GH_ERROR;
     301      if (NextLine.empty())
     302    break;
    301303      if ((*(NextLine.begin()) == ' ') || (*(NextLine.begin()) == '\t')) {
    302304    CurLine += NextLine;
Note: See TracChangeset for help on using the changeset viewer.