From: Randy Baumgarte Date: Sat, 13 Oct 2012 11:09:07 +0000 (-0400) Subject: Correct import error on older versions. X-Git-Tag: version0.1.1~37 X-Git-Url: http://git.sourceforge.jp/view?p=neighbornote%2FNeighborNote.git;a=commitdiff_plain;h=7777d8ca447cc5f9cdee8f2e2e7d05ae4fd9cc59 Correct import error on older versions. --- diff --git a/src/cx/fbn/nevernote/xml/ImportEnex.java b/src/cx/fbn/nevernote/xml/ImportEnex.java index 5736545..a3540b5 100644 --- a/src/cx/fbn/nevernote/xml/ImportEnex.java +++ b/src/cx/fbn/nevernote/xml/ImportEnex.java @@ -186,6 +186,8 @@ public class ImportEnex { if (reader.name().equalsIgnoreCase("resource") && reader.isEndElement()) atEnd = true; } + if (resource.getAttributes() == null) + resource.setAttributes(new ResourceAttributes()); conn.getNoteTable().noteResourceTable.updateNoteResource(resource, true); return resource; } @@ -275,17 +277,15 @@ public class ImportEnex { boolean atEnd = false; while(!atEnd) { if (reader.isStartElement()) { - if (reader.name().equalsIgnoreCase("CameraMake")) - attributes.setCameraMake(textValue()); - if (reader.name().equalsIgnoreCase("CameraModel")) + if (reader.name().equalsIgnoreCase("camera-model")) attributes.setCameraModel(textValue()); - if (reader.name().equalsIgnoreCase("FileName")) + if (reader.name().equalsIgnoreCase("file-name")) attributes.setFileName(textValue()); - if (reader.name().equalsIgnoreCase("RecoType")) + if (reader.name().equalsIgnoreCase("reco-type")) attributes.setRecoType(textValue()); - if (reader.name().equalsIgnoreCase("CameraModel")) + if (reader.name().equalsIgnoreCase("camera-make")) attributes.setCameraMake(textValue()); - if (reader.name().equalsIgnoreCase("SourceURL")) + if (reader.name().equalsIgnoreCase("source-url")) attributes.setSourceURL(textValue()); if (reader.name().equalsIgnoreCase("Altitude")) attributes.setAltitude(doubleValue());