]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/src/TDocument.cc
* added show/hide cursro methods
[helm.git] / helm / DEVEL / mathml_editor / src / TDocument.cc
index e578b79f46ae9d8411f3d00931c8c5dcbacac2e1..cbf163c7afc185b024d89098bd6c9a28b682dfaf 100644 (file)
@@ -27,6 +27,15 @@ TDocument::~TDocument()
   et.removeEventListener("DOMSubtreeModified", *this, false);
 }
 
+void
+TDocument::reset()
+{
+  DOM::Element root = doc.createElementNS(TML_NS_URI, "tml:tex");
+  root.setAttributeNS(XMLNS_NS_URI, "xmlns:tml", TML_NS_URI);
+  doc.replaceChild(root, doc.get_documentElement());
+  clearDirty();
+}
+
 void
 TDocument::serialize(const char* filename) const
 {
@@ -89,7 +98,7 @@ TDocument::findCommonAncestor(const DOM::Node& node1, const DOM::Node& node2)
   unsigned d1 = nodeDepth(n1);
   unsigned d2 = nodeDepth(n2);
 
-  cout << "finding common ancestor " << d1 << " " << d2 << endl;
+  // cout << "finding common ancestor " << d1 << " " << d2 << endl;
 
   while (d1 < d2)
     {
@@ -157,10 +166,12 @@ TDocument::handleEvent(const DOM::Event& ev)
   DOM::MutationEvent me(ev);
   assert(me);
 
+#if 0
   if (dirty)
     cout << "TDocument::handleEvent DIRTY BEFORE = " << dirty.getAttribute("id") << endl;
   else
     cout << "TDocument::handleEvent DIRTY BEFORE = (nil)" << endl;
+#endif
 
   if (DOM::Node node = me.get_target())
     if (dirty)
@@ -170,7 +181,8 @@ TDocument::handleEvent(const DOM::Event& ev)
   else
     assert(0);
 
+#if 0
   cout << "TDocument::handleEvent target = " << DOM::Node(me.get_target()).get_nodeName() << " DIRTY AFTER = "
        << dirty.getAttribute("id") << " ME = " << DOM::Node(me.get_target()).get_nodeName() << endl;
-  
+#endif
 }