void HTMLAnalyzer::DumpList()
{
Tag *pom;
- pom = tags.first();
- while (pom != NULL) {
+ QListIterator<Tag *> tagsIterator(tags);
+
+ while (tagsIterator.hasNext()) {
+ pom = tagsIterator.next();
fprintf(stderr, "%s:%s,%s,%s\n", names[pom->tag_type],
pom->tag_text, pom->tag_link, pom->tag_label);
- pom=tags.takeFirst();
}
}
{
Tag *pom,*pom1;
char s[255];
+ QListIterator<Tag *> tagsIterator(tags);
- pom = tags.first();
- while (pom!=NULL) {
+ while (tagsIterator.hasNext()) {
+ pom = tagsIterator.next();
if ((pom->tag_type == TAG_LINK) ||
(pom->tag_type == TAG_ANCHOR)) {
- pom1 = tags.takeFirst();
+ pom1 = tagsIterator.next();
strcpy(s, "");
while ((pom1 != NULL) &&
(pom1->tag_type != TAG_LINK_END)) {
tags.removeOne(pom1);
pom = tags.current();
} else {
- pom = tags.takeFirst();
+ pom = tagsIterator.next();
}
}
}
Tag *HTMLAnalyzer::CheckTag(int x,int y)
{
Tag *pom;
- pom=tags.first();
- while (pom != NULL) {
+ QListIterator<Tag *> tagsIterator(tags);
+
+ while (tagsIterator.hasNext()) {
+ pom = tagsIterator.next();
if (pom->tag_type==TAG_LINK)
if ((x >= pom->x) && (x <= pom->x + pom->w) &&
(y >= pom->y) && (y <= pom->y + pom->h)) {
return pom;
}
- pom=tags.takeFirst();
}
return NULL;
}
Tag *HTMLAnalyzer::FindAnchor(char *name)
{
Tag *pom;
- pom = tags.first();
- while (pom != NULL) {
+ QListIterator<Tag *> tagsIterator(tags);
+
+ while (tagsIterator.hasNext()) {
+ pom = tagsIterator.next();
if ((pom->tag_type == TAG_ANCHOR) &&
(strcmp(pom->tag_label, name) == 0)) {
return(pom);
}
- pom=tags.takeFirst();
}
return pom;
}
map->fill(backgroundColor());
p.begin(map);
- pom = analyzer->tags.first();
- while (pom != NULL) {
+ QListIterator<Tag *> tagsIterator(tags);
+
+ while (tagsIterator.hasNext()) {
+ pom = tagsIterator.next();
switch(pom->tag_type) {
case TAG_TEXT:
p.setFont(*actual_font);
cy = cy + p.fontMetrics().height();
break;
}
- pom = analyzer->tags.takeFirst();
}
p.end();
repaint();