Pman.Gnumeric.js
[Pman.Core] / Pman.Gnumeric.js
index 8994f00..2574bd2 100644 (file)
@@ -1177,26 +1177,13 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, {
         soi.setAttribute('crop-bottom','0.000000');
         soi.setAttribute('crop-left','0.000000');
         soi.setAttribute('crop-right','0.000000');
-         
-        var name = 'Image' + Math.random().toString(36).substring(2);
+        
         var content = this.doc.createElement('Content');
         content.setAttribute('image-type', type ? type : 'jpeg');
-        content.setAttribute('name', name);
+        content.setAttribute('size-bytes', size);
         soi.appendChild(content);
         objs.appendChild(soi);
         
-        var godoc = this.doc.getElementsByTagNameNS('*','GODoc')[0];
-        
-        var goimage = this.doc.createElement('GOImage');
-        goimage.setAttribute('image-type', type ? type : 'jpeg');
-        goimage.setAttribute('name', name);
-        goimage.setAttribute('type', 'GOPixbuf');
-        goimage.setAttribute('width', width);
-        goimage.setAttribute('height', height);
-        goimage.textContent = data;
-        
-        godoc.appendChild(goimage);
-        
         if (typeof(this.grid[row]) == 'undefined') {
             this.grid[row] = [];
         }
@@ -1210,10 +1197,13 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, {
         this.grid[row][col].width = width;
         this.grid[row][col].height = height;
         
+        var godoc = this.doc.getElementsByTagNameNS('*','GODoc')[0];
+        
+        if(godoc && godoc.parentNode) {
+            godoc.parentNode.removeChild(godoc);
+        }
+        
         return true;
-                //< /gnm:SheetObjectImage>
-                // < /gnm:Objects>
-
     },
     
     /**
@@ -1228,8 +1218,6 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, {
      * @param {Number} width image height
      * 
      */
-    
-    
     writeImage : function (row, col, data, width, height, type) 
     {
         
@@ -1389,6 +1377,12 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, {
         this.grid[startRow][startCol].width = width;
         this.grid[startRow][startCol].height = height;
         
+        var godoc = this.doc.getElementsByTagNameNS('*','GODoc')[0];
+        
+        if(godoc && godoc.parentNode) {
+            godoc.parentNode.removeChild(godoc);
+        }
+        
         return true;
     },