Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

void Inkscape::XML::SimpleNode::setContent ( gchar const *  value  )  [virtual, inherited]

Set the content of a text or comment node.

This method doesn't make sense for element nodes.

Parameters:
value The node's new content

Implements Inkscape::XML::Node.

Definition at line 290 of file simple-node.cpp.

References Inkscape::XML::Document::logger(), Inkscape::XML::CompositeNodeObserver::notifyContentChanged(), and Inkscape::XML::NodeObserver::notifyContentChanged().

Referenced by Inkscape::XML::SimpleNode::mergeFrom().

                                                {
    ptr_shared<char> old_content=_content;
    ptr_shared<char> new_content = ( content ? share_string(content) : ptr_shared<char>() );

    Debug::EventTracker<> tracker;
    if (new_content) {
        tracker.set<DebugSetContent>(*this, new_content);
    } else {
        tracker.set<DebugClearContent>(*this);
    }

    _content = new_content;

    if ( _content != old_content ) {
        _document->logger()->notifyContentChanged(*this, old_content, _content);
        _observers.notifyContentChanged(*this, old_content, _content);
    }
}


Generated by  Doxygen 1.6.0   Back to index