From 36fb4d4cf897957cf1e2409a32b302c35d8cc614 Mon Sep 17 00:00:00 2001 From: Edward Date: Thu, 11 Apr 2019 16:10:20 +0800 Subject: [PATCH] Fix #5845 - Edit photo on the main tab --- Pman.Gnumeric.js | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/Pman.Gnumeric.js b/Pman.Gnumeric.js index 75b30bf0..041fde23 100644 --- a/Pman.Gnumeric.js +++ b/Pman.Gnumeric.js @@ -1197,7 +1197,7 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, { var hh2 = 0.99; var offset_str = ww + ' ' + hh + ' ' + ww2 + ' '+hh2; - //console.log(offset_str ); + //alert(offset_str); soi.setAttribute('ObjectOffset', offset_str); soi.setAttribute('ObjectAnchorType','16 16 16 16'); @@ -1227,6 +1227,19 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, { godoc.appendChild(goimage); + if (typeof(this.grid[row]) == 'undefined') { + this.grid[row] = []; + } + if (typeof(this.grid[row][col]) == 'undefined') { + this.createCell(row,col); + } + + this.grid[row][col].value= data; + this.grid[row][col].valueFormat = 'image'; + this.grid[row][col].imageType = type; + this.grid[row][col].width = width; + this.grid[row][col].height = height; + return true; //< /gnm:SheetObjectImage> // < /gnm:Objects> @@ -1266,8 +1279,6 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, { soi.appendChild(content); objs.appendChild(soi); - Roo.log(name); - var godoc = this.doc.getElementsByTagNameNS('*','GODoc')[0]; var goimage = this.doc.createElement('GOImage'); @@ -1280,6 +1291,19 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, { godoc.appendChild(goimage); + if (typeof(this.grid[startRow]) == 'undefined') { + this.grid[startRow] = []; + } + if (typeof(this.grid[startRow][startCol]) == 'undefined') { + this.createCell(startRow,startCol); + } + + this.grid[startRow][startCol].value= data; + this.grid[startRow][startCol].valueFormat = 'image'; + this.grid[startRow][startCol].imageType = type; + this.grid[startRow][startCol].width = width; + this.grid[startRow][startCol].height = height; + return true; }, @@ -1471,6 +1495,22 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, { } + if(g.valueFormat == 'image') { + out+=String.format('
', + g.colspan, g.rowspan, g.cls.join(' '), + 'overflow:hidden;' + + 'width:'+g.width+'px;' + + + 'text-overflow:ellipsis;' + + 'white-space:nowrap;', + g.imageType, + value, g.width, g.height + + ); + c+=(g.colspan-1); + continue; + } + out+=String.format('
{2}
', g.colspan, g.rowspan, value, 'overflow:hidden;' + -- 2.39.2