Changeset 1257


Ignore:
Timestamp:
2000-06-30T12:40:39+12:00 (24 years ago)
Author:
sjboddie
Message:

Tidied up a bit. Fixed bug in formattools. Nested If/Or's should now
work within formatstrings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/formattools.cpp

    r1079 r1257  
    2828/*
    2929   $Log$
     30   Revision 1.21  2000/06/30 00:40:39  sjboddie
     31   Tidied up a bit. Fixed bug in formattools. Nested If/Or's should now
     32   work within formatstrings.
     33
    3034   Revision 1.20  2000/04/07 04:40:44  sjboddie
    3135   Reverted back to old DocumentHeader, DocumentTitles, DocumentImages etc.
     
    98102#include "formattools.h"
    99103#include "cgiutils.h"
     104#include <assert.h>
    100105
    101106// a few function prototypes
     
    153158  while (here != end) {
    154159    if (*here != ' ') {
    155       if (*here == '<') {
     160      if ((*here == '<') && ((here+3) < end)) {
    156161    if ((*(here+1) == 't' || *(here+1) == 'T') &&
    157162        (*(here+2) == 'd' || *(here+2) == 'D') &&
     
    239244
    240245static void get_parent_options (text_t &instring, metadata_t &metaoption) {
     246
     247  assert (instring.size() > 7);
     248  if (instring.size() <= 7) return;
    241249
    242250  text_t meta, com, op;
     
    323331  while (here != end) {
    324332
    325     if (*here == '\\')
    326       text.push_back (*(++here));
    327 
    328     else if (*here == '{') {
     333    if (*here == '\\') {
     334      here ++;
     335      if (here != end) text.push_back (*here);
     336
     337    } else if (*here == '{') {
    329338      if (!text.empty()) {
    330339    formatlistptr->command = comText;
     
    433442
    434443    } else {
    435       // assume it's plain text
    436       or_ptr->command = comText;
    437       or_ptr->text = text;
     444      parse_string (text, or_ptr, metadata, getParents);
    438445    }
    439446    text.clear();
Note: See TracChangeset for help on using the changeset viewer.