diff --git a/source/pro/litvinovg/libreoffice/metadata/Document.java b/source/pro/litvinovg/libreoffice/metadata/Document.java index 3a3e85b..4be3964 100644 --- a/source/pro/litvinovg/libreoffice/metadata/Document.java +++ b/source/pro/litvinovg/libreoffice/metadata/Document.java @@ -134,11 +134,10 @@ public class Document { String author = (String) annotationProperties.getPropertyValue("Author"); if (author != null && author.equals(METADATA_EXTENSION)) { String content = (String) annotationProperties.getPropertyValue("Content"); - System.out.println("Content " + content); OutlineElement lastElement = outline.get(outline.size()-1); lastElement.readMetadata(content); } - } + } } catch (NoSuchElementException e) { e.printStackTrace(); } catch (WrappedTargetException e) { diff --git a/source/pro/litvinovg/libreoffice/metadata/OutlineElement.java b/source/pro/litvinovg/libreoffice/metadata/OutlineElement.java index a98beb7..a02ab16 100644 --- a/source/pro/litvinovg/libreoffice/metadata/OutlineElement.java +++ b/source/pro/litvinovg/libreoffice/metadata/OutlineElement.java @@ -20,14 +20,19 @@ public class OutlineElement { private XTextRange textRange; private boolean hasMetadataStorage = false; - private XTextRange metadataTextRange = null; + private XTextRange annotationStart = null; + private XTextRange annotationEnd = null; public OutlineElement(XTextRange textRange) { this.textRange = textRange; this.name = textRange.getString(); this.metadata = new ArrayList(); + annotationStart = textRange.getStart(); } - + public void setAnnotationAnchorEnd(XTextRange anchor) { + this.annotationEnd = anchor; + } + public void readMetadata(String data) { try { JSONObject json = new JSONObject(data); @@ -44,7 +49,7 @@ public class OutlineElement { } } -public String toString() { +public String metadataToString() { JSONObject json = new JSONObject(); for (MetadataElement element : metadata) { json.put(element.getName(), element.getValue());