Logo Search packages:      
Sourcecode: inkscape version File versions

GString * SPObject::textualContent (  )  const [private]

Return the full textual content of an element (typically all the content except the tags). Must not be used on anything except elements.

Definition at line 1744 of file sp-object.cpp.

References Inkscape::XML::ELEMENT_NODE, next, and Inkscape::XML::TEXT_NODE.

Referenced by getTitleOrDesc().

    GString* text = g_string_new("");

    for (const SPObject *child = firstChild(); child; child = child->next)
        Inkscape::XML::NodeType child_type = child->repr->type();
        if (child_type == Inkscape::XML::ELEMENT_NODE) {
            GString * new_text = child->textualContent();
            g_string_append(text, new_text->str);
            g_string_free(new_text, TRUE);
        else if (child_type == Inkscape::XML::TEXT_NODE) {
            g_string_append(text, child->repr->content());
    return text;

Generated by  Doxygen 1.6.0   Back to index