},
-
+ /**
+ * writeImage:
+ * write an image in old gnumberic format (needs base64 data to write it)
+ *
+ *
+ * @param {Number} row row to put it in (rows start at 0)
+ * @param {Number} col column to put it in
+ * @param {Number} data the base64 description of the images
+ * @param {Number} width image width
+ * @param {Number} width image height
+ *
+ */
+ writeImageOld : function (row, col, data, width, height, type)
+ {
+
+ },
/**
* writeImage:
writeImage : function (row, col, data, width, height, type)
{
-
if (!data) {
throw "write Image called with missing data";
}
// step 1 - work out how many columns it will span..
// lets hope the spreadsheet is big enought..
- var colwidth = 0;
- var endcol=col;
- for ( endcol=col;endcol <100; endcol++) {
- if (!this.colInfo[endcol]) {
- this.colInfo[endcol] = 100; // eak fudge
- }
- colwidth += this.colInfo[endcol];
- if (colwidth > width) {
- break;
- }
- }
+// var colwidth = 0;
+// var endcol=col;
+// for ( endcol=col;endcol <100; endcol++) {
+// if (!this.colInfo[endcol]) {
+// this.colInfo[endcol] = 100; // eak fudge
+// }
+// colwidth += this.colInfo[endcol];
+// if (colwidth > width) {
+// break;
+// }
+// }
soi.setAttribute('ObjectBound',
//gnumeric_colRowToName(row,col) + ':' + gnumeric_colRowToName(row+1,col+1));
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');
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>
soi.appendChild(content);
objs.appendChild(soi);
- Roo.log(name);
-
var godoc = this.doc.getElementsByTagNameNS('*','GODoc')[0];
var goimage = this.doc.createElement('GOImage');
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;
},
}
+ if(g.valueFormat == 'image') {
+
+ out+=String.format('<td colspan="{0}" rowspan="{1}" class="{2}"><div style="{3}"><img src="data:image/{4};base64, {5}" width="{6}" height="{7}"></div></td>',
+ 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('<td colspan="{0}" rowspan="{1}" class="{4}"><div style="{3}">{2}</div></td>',
g.colspan, g.rowspan, value,
'overflow:hidden;' +