Hi,
 
I am using jOpenDocument 1.2 and trying to add an image to a table cell in 
a text document.
 
I created my ODT template file with LibreOffice 3.6.1.2 Win.
 
When i am calling setImage, the following exception appears :
 
"this cell doesn't contain an image"
 
I took a look a the MutableCell class source code i understood where the 
problem was. The setImage method is looking for a "frame" element then an 
"image" element. The problem is my ODF XML code is like this :
 
<table:table-cell>
      <text:p>
           <draw:frame>
                <draw:image>
 
There is an extra <text:p> element, causing the setImage method not finding 
the frame element. I tried to remove the paragraph in the cell in 
LibreOffice, but it seems to be impossible ...
 
I applyed a patch to the source code and it seems to work :
 
final Namespace text = this.getNS().getNS("text");
final Element frame = this.getElement().getChild("p", 
text).getChild("frame", draw);
 
My question now is what is the cause of this ? Is the ODF standard changed ?
 
Thanks

Reply via email to