X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Fmathml_editor%2Fsrc%2FTDocument.cc;h=cbf163c7afc185b024d89098bd6c9a28b682dfaf;hb=caab26f85122e0040555139c48a9111a0b2b9fff;hp=e578b79f46ae9d8411f3d00931c8c5dcbacac2e1;hpb=387aeebf96181c051b7f527a0901b173cfcdf194;p=helm.git diff --git a/helm/DEVEL/mathml_editor/src/TDocument.cc b/helm/DEVEL/mathml_editor/src/TDocument.cc index e578b79f4..cbf163c7a 100644 --- a/helm/DEVEL/mathml_editor/src/TDocument.cc +++ b/helm/DEVEL/mathml_editor/src/TDocument.cc @@ -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 }