Improve media management in DocBook.
[gpl/argeo-suite.git] / publishing / org.argeo.publishing.ui / src / org / argeo / docbook / DbkUtils.java
index 19f7cd40fd905dd46c543785e3d292cb655caf34..226df4b544786178fe21107741247b5c7cfd818b 100644 (file)
@@ -97,11 +97,6 @@ public class DbkUtils {
        public static Node insertImageAfter(Node sibling) {
                try {
 
-                       // FIXME make it more robust
-                       if (DbkType.imagedata.get().equals(sibling.getName())) {
-                               sibling = sibling.getParent().getParent();
-                       }
-
                        Node parent = sibling.getParent();
                        Node mediaNode = addDbk(parent, DbkType.mediaobject);
                        // TODO optimise?
@@ -123,7 +118,7 @@ public class DbkUtils {
 //                     // TODO make it more robust and generic
 //                     String fileRef = mediaNode.getName();
 //                     imageDataNode.setProperty(DocBookNames.DBK_FILEREF, fileRef);
-                       return imageDataNode;
+                       return mediaNode;
                } catch (RepositoryException e) {
                        throw new JcrException("Cannot insert empty image after " + sibling, e);
                }