Exemplo n.º 1
0
void ClassData::get_actuals(QList<ActualParamData> & l, BrowserClass * parent) {
  if (((BrowserNode *) parent->parent())->get_type() == UmlClass)
    get_actuals(l, (BrowserClass * ) parent->parent());
  
  ActualParamData * actual;
  int n = ((ClassData *) parent->get_data())->nformals;
  
  if (n != 0) {
    // search the first associated actual
    for (actual = actuals.first(); actual != 0; actual = actuals.next()) {
      if ((actual->get_class() == parent) &&
	  (l.findRef(actual) == -1))
	// find;
	break;
    }
    
    int nth = 0;
    
    // progress on still present formals
    while (actual && (nth < n) && (actual->get_class() == parent)) {
      // actual ok
      l.append(actual);
      
      actual = actuals.next();
      nth += 1;
    }
  }
}
Exemplo n.º 2
0
bool isSeparatedParagraph(DocSimpleSect *parent,DocPara *par)
{
  QList<DocNode> nodes = parent->children();
  int i = nodes.findRef(par);
  if (i==-1) return FALSE;
  int count = parent->children().count();
  if (count>1 && i==0)
  {
    if (nodes.at(i+1)->kind()==DocNode::Kind_SimpleSectSep)
    {
      return TRUE;
    }
  }
  else if (count>1 && i==count-1)
  {
    if (nodes.at(i-1)->kind()==DocNode::Kind_SimpleSectSep)
    {
      return TRUE;
    }
  }
  else if (count>2 && i>0 && i<count-1)
  {
    if (nodes.at(i-1)->kind()==DocNode::Kind_SimpleSectSep &&
        nodes.at(i+1)->kind()==DocNode::Kind_SimpleSectSep)
    {
      return TRUE;
    }
  }
  return FALSE;
}
Exemplo n.º 3
0
void ClassData::update_actuals(BrowserClass * parent,
			       QList<ActualParamData> & new_actuals,
			       QList<ActualParamData> & managed) {
  if (((BrowserNode *) parent->parent())->get_type() == UmlClass)
    update_actuals((BrowserClass * ) parent->parent(), new_actuals, managed);
  
  ActualParamData * actual;
  int n = ((ClassData *) parent->get_data())->nformals;
  
  if (n != 0) {
    // search the first associated actual
    for (actual = actuals.first(); actual != 0; actual = actuals.next()) {
      if ((actual->get_class() == parent) &&
	  (managed.findRef(actual) == -1))
	// find;
	break;
    }
    
    int nth = 0;
    
    // progress on still present formals
    while (actual && (nth < n) && (actual->get_class() == parent)) {
      // actual ok
      new_actuals.append(actual);
      managed.append(actual);
      
      actual = actuals.next();
      nth += 1;
    }
    
    if (nth < n) {
      // adds necessary actuals
      if (nth == 0) {
	// new inheritance
	connect(parent->get_data(), SIGNAL(deleted()),
		this, SLOT(update_actuals()));
	connect(parent->get_data(), SIGNAL(changed()),
		this, SLOT(update_actuals()));
      }
      do {
	new_actuals.append(new ActualParamData(parent, nth));
	nth += 1;
      } while (nth != n);
    }
  }
}