Pman.Gnumeric.js
[Pman.Core] / Pman.Gnumeric.js
index d46cb95..187d3a4 100644 (file)
@@ -1139,7 +1139,7 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, {
      */
     
     
-    writeImage : function (row, col, data, width, height) 
+    writeImage : function (row, col, data, width, height, type
     {
         
         if (!data) {
@@ -1187,7 +1187,6 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, {
                 break;
             }
         }
-       
         
         soi.setAttribute('ObjectBound',
             //gnumeric_colRowToName(row,col) + ':' + gnumeric_colRowToName(row+1,col+1));
@@ -1210,14 +1209,20 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, {
         soi.setAttribute('crop-left','0.000000');
         soi.setAttribute('crop-right','0.000000');
                 // <Content image-type="jpeg" size-bytes="3900">......  < / Content>
+                
+        var name = 'Image' + Math.random().toString(36).substring(2);
         var content = this.doc.createElement('Content');
-        content.setAttribute('image-type','jpeg');
-        //alert(imgsrc);
+        content.setAttribute('image-type', type ? type : 'jpeg');
+        content.setAttribute('name', name);
+        soi.appendChild(content);
+        objs.appendChild(soi);
+        
+        var worksheet = this.sheet.getElementsByTagNameNS('*','Workbook')[0];
+        var soi = this.doc.createElementNS('http://www.gnumeric.org/v10.dtd', 'gnm:SheetObjectImage');
         
         content.setAttribute('size-bytes',data.length);
         content.textContent = data;
-        soi.appendChild(content);
-        objs.appendChild(soi);
+        
         return true;
                 //< /gnm:SheetObjectImage>
                 // < /gnm:Objects>