From 76c9b2c0f94a6d8c2870c1a4485d8a5054623c68 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 4 May 2011 00:18:10 -0300 Subject: [PATCH] Fix relationship error during import. --- .../javascript/peer/svg/CurvedLinePeer.js | 27 +- .../java/com/wisemapping/model/MindMap.java | 2 +- .../data/wisemaps/{bigmap.xml => bigmap.wxml} | 0 .../src/test/data/wisemaps/simple-maps.wxml | 616 ++++++++++++++++++ 4 files changed, 632 insertions(+), 13 deletions(-) rename wise-webapp/src/test/data/wisemaps/{bigmap.xml => bigmap.wxml} (100%) create mode 100644 wise-webapp/src/test/data/wisemaps/simple-maps.wxml diff --git a/web2d/src/main/javascript/peer/svg/CurvedLinePeer.js b/web2d/src/main/javascript/peer/svg/CurvedLinePeer.js index 181cd9db..8c019b3b 100644 --- a/web2d/src/main/javascript/peer/svg/CurvedLinePeer.js +++ b/web2d/src/main/javascript/peer/svg/CurvedLinePeer.js @@ -152,18 +152,21 @@ web2d.peer.svg.CurvedLinePeer.prototype.isShowStartArrow = function(){ web2d.peer.svg.CurvedLinePeer.prototype._updatePath = function(avoidControlPointFix) { - this._calculateAutoControlPoints(avoidControlPointFix); - var path = "M"+this._x1+","+this._y1 - +" C"+(this._control1.x+this._x1)+","+(this._control1.y+this._y1)+" " - +(this._control2.x+this._x2)+","+(this._control2.y+this._y2)+" " - +this._x2+","+this._y2+ - (this._lineStyle?" " - +(this._control2.x+this._x2)+","+(this._control2.y+this._y2+3)+" " - +(this._control1.x+this._x1)+","+(this._control1.y+this._y1+5)+" " - +this._x1+","+(this._y1+7)+" Z" - :"" - ); - this._native.setAttribute("d",path); + if(core.Utils.isDefined(this._x1) && core.Utils.isDefined(this._y1)) + { + this._calculateAutoControlPoints(avoidControlPointFix); + var path = "M"+this._x1+","+this._y1 + +" C"+(this._control1.x + this._x1)+","+(this._control1.y+this._y1)+" " + +(this._control2.x+this._x2)+","+(this._control2.y+this._y2)+" " + +this._x2+","+this._y2+ + (this._lineStyle?" " + +(this._control2.x+this._x2)+","+(this._control2.y+this._y2+3)+" " + +(this._control1.x+this._x1)+","+(this._control1.y+this._y1+5)+" " + +this._x1+","+(this._y1+7)+" Z" + :"" + ); + this._native.setAttribute("d",path); + } }; web2d.peer.svg.CurvedLinePeer.prototype._updateStyle = function() diff --git a/wise-webapp/src/main/java/com/wisemapping/model/MindMap.java b/wise-webapp/src/main/java/com/wisemapping/model/MindMap.java index e1ea8602..db6127cd 100644 --- a/wise-webapp/src/main/java/com/wisemapping/model/MindMap.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/MindMap.java @@ -183,7 +183,7 @@ public class MindMap { String xml = getNativeXml(); if (xml != null) { xml = xml.replace("'", "\\'"); - xml = xml.replace("\n", ""); + xml = xml.replaceAll("\\r|\\n", ""); xml = xml.trim(); } return xml; diff --git a/wise-webapp/src/test/data/wisemaps/bigmap.xml b/wise-webapp/src/test/data/wisemaps/bigmap.wxml similarity index 100% rename from wise-webapp/src/test/data/wisemaps/bigmap.xml rename to wise-webapp/src/test/data/wisemaps/bigmap.wxml diff --git a/wise-webapp/src/test/data/wisemaps/simple-maps.wxml b/wise-webapp/src/test/data/wisemaps/simple-maps.wxml new file mode 100644 index 00000000..51afa751 --- /dev/null +++ b/wise-webapp/src/test/data/wisemaps/simple-maps.wxml @@ -0,0 +1,616 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file