Fix #1806852: sort PasteCanvas layers by z-depth even if they do have a non-zero...
[synfig.git] / synfig-core / trunk / src / synfig / savecanvas.cpp
index 18224df..8988a50 100644 (file)
 #include "gradient.h"
 #include <errno.h>
 
+extern "C" {
+#include <libxml/tree.h>
+}
+
 #endif
 
 /* === U S I N G =========================================================== */
@@ -300,7 +304,7 @@ xmlpp::Element* encode_animated(xmlpp::Element* root,ValueNode_Animated::ConstHa
                case INTERPOLATION_TCB:
                        // This is the default value, so don't add a new attribute (unless it's an angle - they default to linear)
                        if (value_node->get_type() == ValueBase::TYPE_ANGLE)
-                               waypoint_node->set_attribute("before","tcb");
+                               waypoint_node->set_attribute("before","auto");
                        break;
                default:
                        error("Unknown waypoint type for \"before\" attribute");
@@ -325,7 +329,7 @@ xmlpp::Element* encode_animated(xmlpp::Element* root,ValueNode_Animated::ConstHa
                case INTERPOLATION_TCB:
                        // This is the default value, so don't add a new attribute (unless it's an angle - they default to linear)
                        if (value_node->get_type() == ValueBase::TYPE_ANGLE)
-                               waypoint_node->set_attribute("after","tcb");
+                               waypoint_node->set_attribute("after","auto");
                        break;
                default:
                        error("Unknown waypoint type for \"after\" attribute");
@@ -747,6 +751,11 @@ synfig::save_canvas(const String &filename, Canvas::ConstHandle canvas)
 
        synfig::String tmp_filename(filename+".TMP");
 
+       if (String(filename.begin() + filename.find_last_of('.')+1, filename.end()) == "sifz")
+               xmlSetCompressMode(9);
+       else
+               xmlSetCompressMode(0);
+
        try
        {
                assert(canvas);