예제 #1
0
파일: UmlItem.cpp 프로젝트: javrillon/douml
void UmlItem::manage_alias(const char *& p, QTextStream & ts)
{
    // p starts by '@'
    const char * pclosed;

    if ((p[1] == '{') && ((pclosed = strchr(p + 2, '}')) != 0)) {
        QByteArray key_(p + 2, pclosed - p - 1);
        WrapperStr key = key_;
        WrapperStr value;
        UmlItem * node = this;

        do {
            if (node->propertyValue(key, value))
                break;

            node = node->parent();
        }
        while (node != 0);

        if (node != 0)
            // find, insert the value
            ts << value;
        else
            // not find, insert the key
            ts << "@{" << key << '}';

        // bypass the key
        p += strlen(key) + 3;
    }
    else
        // bypass '$'
        ts << toLocale(p);
}
예제 #2
0
파일: UmlItem.cpp 프로젝트: SciBoy/douml
void UmlItem::manage_alias(const char *& p, QTextOStream & ts,
			   Q3CString indent, BooL & indent_needed) {
  if (indent_needed) {
    indent_needed = FALSE;
    ts << indent;
  }
  
  // p starts by '@'
  const char * pclosed;
  
  if ((p[1] == '{') && ((pclosed = strchr(p + 2, '}')) != 0)) {
    Q3CString key(p + 2, pclosed - p - 1);
    Q3CString value;
    UmlItem * node = this;

    do {
      if (node->propertyValue(key, value))
	break;
      node = node->parent();
    } while (node != 0);
    
    if (node != 0)
      // find, insert the value
      ts << value;
    else
      // not find, insert the key
      ts << "@{" << key << '}';

    // bypass the key
    p += strlen(key) + 3;
  }
  else
    // bypass '$'
    ts << *p++;
}