mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-15 11:07:57 +01:00
Don't serialize/deserialize invalid order values.
This commit is contained in:
parent
84fbe241d0
commit
6b1cafb8fb
@ -64,9 +64,12 @@ mindplot.XMLMindmapSerializer_Beta.prototype._topicToXML = function(document, to
|
||||
} else
|
||||
{
|
||||
var order = topic.getOrder();
|
||||
if(core.Utils.isDefined(order) && !isNaN(order-0))
|
||||
{
|
||||
parentTopic.setAttribute("order", order);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var text = topic.getText();
|
||||
if (core.Utils.isDefined(text)) {
|
||||
@ -213,7 +216,7 @@ mindplot.XMLMindmapSerializer_Beta.prototype._deserializeNode = function(domElem
|
||||
}
|
||||
|
||||
var order = domElem.getAttribute('order');
|
||||
if (core.Utils.isDefined(order)) {
|
||||
if (core.Utils.isDefined(order) && !isNaN(order-0)) {
|
||||
topic.setOrder(order);
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,10 @@ mindplot.XMLMindmapSerializer_Pela.prototype._topicToXML = function(document, to
|
||||
// } else
|
||||
// {
|
||||
var order = topic.getOrder();
|
||||
if(core.Utils.isDefined(order) && !isNaN(order-0))
|
||||
{
|
||||
parentTopic.setAttribute("order", order);
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
@ -281,7 +284,7 @@ mindplot.XMLMindmapSerializer_Pela.prototype._deserializeNode = function(domElem
|
||||
}
|
||||
|
||||
var order = domElem.getAttribute('order');
|
||||
if (core.Utils.isDefined(order)) {
|
||||
if (core.Utils.isDefined(order) && !isNaN(order-0)) {
|
||||
topic.setOrder(parseInt(order));
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ import org.testng.annotations.Test;
|
||||
import java.io.*;
|
||||
|
||||
@Test
|
||||
public class ExportTest {
|
||||
public class FreemindExportTest {
|
||||
private static final String DATA_DIR_PATH = "src/test/data/wisemaps/";
|
||||
|
||||
@Test(dataProvider = "Data-Provider-Function")
|
||||
@ -85,7 +85,7 @@ public class ExportTest {
|
||||
final File[] freeMindFiles = dataDir.listFiles(new FilenameFilter() {
|
||||
|
||||
public boolean accept(File dir, String name) {
|
||||
return name.endsWith(".xml");
|
||||
return name.endsWith(".wxml");
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user