FbTextElement FbTextElement::insertInside(const QString &style, const QString &html) { const TypeList * types = subtypes(); if (!types) return FbTextElement(); Sublist sublist(*types, style); if (!sublist) return FbTextElement(); FbTextElement child = firstChild(); if (sublist < child) { prependInside(html); return firstChild(); } while (!child.isNull()) { FbTextElement subling = child.nextSibling(); if (sublist >= child && sublist != subling) { child.appendOutside(html); return child.nextSibling(); } child = subling; } return FbTextElement(); }
bool FbTextElement::hasSubtype(const QString &style) const { if (const TypeList * list = subtypes()) { for (TypeList::const_iterator item = list->begin(); item != list->end(); item++) { if (item->name() == style) return true; } } return false; }
void typet::move_to_subtypes(typet &type) { subtypest &sub=subtypes(); sub.push_back(static_cast<const typet &>(get_nil_irep())); sub.back().swap(type); }
void typet::copy_to_subtypes(const typet &type) { subtypes().push_back(type); }
bool FbTextElement::hasScheme() const { return subtypes(); }