]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/test/editor.cc
Added some controls concerning the graphical deleting.
[helm.git] / helm / DEVEL / mathml_editor / test / editor.cc
index 265d35e53477249bda2226930c436ce8e8a62666..8ee408a3db41777c1a0c9aa080c5175bf35d7f7e 100644 (file)
@@ -87,7 +87,7 @@ public:
        DOM::Document res = style.apply(doc.document(), dirtyId);
        assert(res);
        style.save(doc.document(), stdout);
-       style.save(res, stdout);
+       //style.save(res, stdout);
        if (result)
          {
            cout << "REPLACING A FRAGMENT OF THE DOCUMENT" << endl;
@@ -98,10 +98,13 @@ public:
            if (result.get_documentElement().getAttribute("xref") == root.getAttribute("xref"))
              {
                cout << "REPLACING ROOT" << endl;
+               result.replaceChild(result.importNode(root, true), result.get_documentElement());
+#if 0
                // the following remove should not be necessary
                // according to the spec replaceChild should work just fine
                result.removeChild(result.get_documentElement());
                result.appendChild(result.importNode(root, true));
+#endif
              }
            else
              try
@@ -130,6 +133,7 @@ public:
             if (GUI_load_document(gdome_cast_doc(static_cast<GdomeNode*>(result))) < 0)
              cerr << "c'e' stato un errore" << endl;
          }
+       style.save(result, stdout);
 
        doc.clearDirty();
       }