Ejemplo n.º 1
0
void MarkupAccumulator::appendStartMarkup(StringBuilder& result, Node& node, Namespaces* namespaces)
{
    switch (node.nodeType()) {
    case Node::TEXT_NODE:
        appendText(result, toText(node));
        break;
    case Node::COMMENT_NODE:
        appendComment(result, toComment(node).data());
        break;
    case Node::DOCUMENT_NODE:
        appendXMLDeclaration(result, toDocument(node));
        break;
    case Node::DOCUMENT_FRAGMENT_NODE:
        break;
    case Node::DOCUMENT_TYPE_NODE:
        appendDocumentType(result, toDocumentType(node));
        break;
    case Node::PROCESSING_INSTRUCTION_NODE:
        appendProcessingInstruction(result, toProcessingInstruction(node).target(), toProcessingInstruction(node).data());
        break;
    case Node::ELEMENT_NODE:
        appendElement(result, toElement(node), namespaces);
        break;
    case Node::CDATA_SECTION_NODE:
        appendCDATASection(result, toCDATASection(node).data());
        break;
    case Node::ATTRIBUTE_NODE:
        ASSERT_NOT_REACHED();
        break;
    }
}
Ejemplo n.º 2
0
void DisplayWindow::BuildConnections()
{
	connect(m_qpbLike, SIGNAL(clicked()), this, SLOT(likeIt()));
	connect(m_qpbComment, SIGNAL(clicked()), this, SLOT(toComment()));
	connect(m_qpbForward, SIGNAL(clicked()), this, SLOT(forwardIt()));
	connect(m_qpbUser, SIGNAL(clicked()), this, SLOT(toProfile()));
}
Ejemplo n.º 3
0
static bool findNodesSurroundingContext(DocumentFragment* fragment,
                                        Comment*& nodeBeforeContext,
                                        Comment*& nodeAfterContext) {
  if (!fragment->firstChild())
    return false;
  for (Node& node : NodeTraversal::startsAt(*fragment->firstChild())) {
    if (node.getNodeType() == Node::kCommentNode &&
        toComment(node).data() == fragmentMarkerTag) {
      if (!nodeBeforeContext) {
        nodeBeforeContext = &toComment(node);
      } else {
        nodeAfterContext = &toComment(node);
        return true;
      }
    }
  }
  return false;
}
Ejemplo n.º 4
0
 CommentPtr Node::toCommentChecked() const throw(Exceptions::CheckFailed)
 {
   CommentPtr result = toComment();
   ZS_THROW_CUSTOM_IF(Exceptions::CheckFailed, !result)
   return result;
 }