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

void Inkscape::Whiteboard::Deserializer::deserializeEventChgContent ( Glib::ustring const &  msg  ) 

Deserialize a node content change event.

See also:
XML::EventChgContent
Parameters:
msg The message that describes the event.

Definition at line 283 of file deserializer.cpp.

Referenced by Inkscape::Whiteboard::SessionManager::receiveChange().

{
      // 1.  Extract required attributes: node ID.  If we do not know these, return.
      std::string id;
      Util::SharedCStringPtr oldval, newval;
      Node buf;

      buf.tag = MESSAGE_ID;
      if (!MessageUtilities::findTag(buf, msg)) {
            return;
      } else {
            id = buf.data.raw();
      }

      // 2.  Extract optional attributes: old value, new value.
      buf.tag = MESSAGE_OLDVAL;
      if (MessageUtilities::findTag(buf, msg)) {
            oldval = Util::SharedCStringPtr::copy(buf.data.c_str());
      } else {
            oldval = Util::SharedCStringPtr::copy("");
      }

      buf.tag = MESSAGE_NEWVAL;
      if (MessageUtilities::findTag(buf, msg)) {
            newval = Util::SharedCStringPtr::copy(buf.data.c_str());
      } else {
            newval = Util::SharedCStringPtr::copy("");
      }

      // 3.  Find the node identified by the ID.  If we cannot find it, return.
      XML::Node* node = this->_getNodeByID(id);
      if (node == NULL) {
            return;
      }

      // 4.  Deserialize the event.
      this->_builder.setContent(*node, oldval, newval);
      this->_addOneEvent(this->_builder.detach());
}


Generated by  Doxygen 1.6.0   Back to index