Code

Export. Fix PS/EPS export (Bug #698340, PS Level Restriction reversed.
[inkscape.git] / src / jabber_whiteboard / inkboard-document.cpp
index dd039ab6fd1b08bbdfa8b062f6da7ee1569c2738..4b27d530a8f9db1402e942499382a8715c68cf39 100644 (file)
@@ -44,7 +44,7 @@ namespace Whiteboard {
 
 InkboardDocument::InkboardDocument(int code, State::SessionType sessionType,
                                    Glib::ustring const& to)
-: XML::SimpleNode(code), sessionType(sessionType), recipient(to),
+: XML::SimpleNode(code, this), sessionType(sessionType), recipient(to),
   _in_transaction(false)
 {
     _initBindings();
@@ -56,7 +56,6 @@ InkboardDocument::_initBindings()
     this->sm = &SessionManager::instance();
     this->state = State::INITIAL;
     this->tracker = new KeyNodeTable();
-    _bindDocument(*this);
 }
 
 void
@@ -348,25 +347,25 @@ InkboardDocument::commitUndoable()
 XML::Node*
 InkboardDocument::createElement(char const* name)
 {
-    return new XML::ElementNode(g_quark_from_string(name));
+    return new XML::ElementNode(g_quark_from_string(name), this);
 }
 
 XML::Node*
 InkboardDocument::createTextNode(char const* content)
 {
-    return new XML::TextNode(Util::share_string(content));
+    return new XML::TextNode(Util::share_string(content), this);
 }
 
 XML::Node*
 InkboardDocument::createComment(char const* content)
 {
-    return new XML::CommentNode(Util::share_string(content));
+    return new XML::CommentNode(Util::share_string(content), this);
 }
 
 XML::Node*
 InkboardDocument::createPI(char const *target, char const* content)
 {
-    return new XML::PINode(g_quark_from_string(target), Util::share_string(content));
+    return new XML::PINode(g_quark_from_string(target), Util::share_string(content), this);
 }
 
 
@@ -411,13 +410,10 @@ void InkboardDocument::notifyChildOrderChanged(XML::Node &parent,
 {
     if (_in_transaction && state == State::IN_WHITEBOARD) 
     {
-        XML::Node *element = (XML::Node *)&child;
-        XML::Node *parentElement = (XML::Node *)&parent;
-
-        unsigned int index = parentElement->_childPosition(*element);
+        unsigned int index = child.position();
 
         Message::Message message = String::ucompose(Vars::MOVE_MESSAGE,
-                tracker->get(element),index);
+                tracker->get(&child),index);
 
         send(getRecipient(),Message::MOVE,message);
     }