Commit faf10bd5 authored by GoshaZotov's avatar GoshaZotov Committed by Alexander.Trofimov

draw format table pictures with properties

parent cba40401
"use strict"; "use strict";
/* WorkbookView.js /* WorkbookView.js
* *
...@@ -1396,8 +1396,8 @@ ...@@ -1396,8 +1396,8 @@
} }
}; };
WorkbookView.prototype.getTablePictures = function() { WorkbookView.prototype.getTablePictures = function(props) {
return this.af_getTablePictures(this.model, this.fmgrGraphics, this.m_oFont); return this.af_getTablePictures(this.model, this.fmgrGraphics, this.m_oFont, props);
}; };
WorkbookView.prototype.getCellStyles = function() { WorkbookView.prototype.getCellStyles = function() {
...@@ -2576,7 +2576,7 @@ ...@@ -2576,7 +2576,7 @@
this.defaults.worksheetView.cells.paddingPlusBorder = 2 * this.defaults.worksheetView.cells.padding + 1; this.defaults.worksheetView.cells.paddingPlusBorder = 2 * this.defaults.worksheetView.cells.padding + 1;
}; };
WorkbookView.prototype.af_getTablePictures = function(wb, fmgrGraphics, oFont) WorkbookView.prototype.af_getTablePictures = function(wb, fmgrGraphics, oFont, props)
{ {
var styleThumbnailWidth = 61; var styleThumbnailWidth = 61;
var styleThumbnailHeight = 46; var styleThumbnailHeight = 46;
...@@ -2603,7 +2603,7 @@ ...@@ -2603,7 +2603,7 @@
name: i, name: i,
displayName: customStyles[i].displayName, displayName: customStyles[i].displayName,
type: 'custom', type: 'custom',
image: this.af_getSmallIconTable(canvas, customStyles[i], fmgrGraphics, oFont) image: this.af_getSmallIconTable(canvas, customStyles[i], fmgrGraphics, oFont, props)
}; };
result[n] = new Asc.formatTablePictures(options); result[n] = new Asc.formatTablePictures(options);
n++; n++;
...@@ -2622,7 +2622,7 @@ ...@@ -2622,7 +2622,7 @@
name: i, name: i,
displayName: defaultStyles[i].displayName, displayName: defaultStyles[i].displayName,
type: 'default', type: 'default',
image: this.af_getSmallIconTable(canvas, defaultStyles[i], fmgrGraphics, oFont) image: this.af_getSmallIconTable(canvas, defaultStyles[i], fmgrGraphics, oFont, props)
}; };
result[n] = new Asc.formatTablePictures(options); result[n] = new Asc.formatTablePictures(options);
n++; n++;
...@@ -2632,20 +2632,38 @@ ...@@ -2632,20 +2632,38 @@
return result; return result;
}; };
WorkbookView.prototype.af_getSmallIconTable = function(canvas, style, fmgrGraphics, oFont) WorkbookView.prototype.af_getSmallIconTable = function(canvas, style, fmgrGraphics, oFont, props)
{ {
var ctx = new Asc.DrawingContext({canvas: canvas, units: 1/*pt*/, fmgrGraphics: fmgrGraphics, font: oFont}); var ctx = new Asc.DrawingContext({canvas: canvas, units: 1/*pt*/, fmgrGraphics: fmgrGraphics, font: oFont});
var styleOptions = style; var styleOptions = style;
//по умолчанию ставим строку заголовка и чередующиеся строки, позже нужно будет получать параметр //по умолчанию ставим строку заголовка и чередующиеся строки, позже нужно будет получать параметр
var styleInfo = var styleInfo;
if(props)
{ {
styleInfo =
{
ShowColumnStripes: props.asc_getBandVer(),
ShowFirstColumn: props.asc_getFirstCol(),
ShowLastColumn: props.asc_getLastCol(),
ShowRowStripes: props.asc_getBandHor(),
HeaderRowCount: props.asc_getFirstRow(),
TotalsRowCount: props.asc_getLastRow()
};
}
else
{
styleInfo =
{
ShowColumnStripes: false, ShowColumnStripes: false,
ShowFirstColumn: false, ShowFirstColumn: false,
ShowLastColumn: false, ShowLastColumn: false,
ShowRowStripes: true, ShowRowStripes: true,
HeaderRowCount: null,
TotalsRowCount: 0 TotalsRowCount: 0
}; };
}
var pxToMM = 72 / 96; var pxToMM = 72 / 96;
var ySize = 45 * pxToMM; var ySize = 45 * pxToMM;
...@@ -2783,7 +2801,7 @@ ...@@ -2783,7 +2801,7 @@
} }
} }
if(styleOptions)//header row if(styleInfo.HeaderRowCount)//header row
{ {
if(styleOptions.headerRow && styleOptions.headerRow.dxf.fill && null != styleOptions.headerRow.dxf.fill.bg) if(styleOptions.headerRow && styleOptions.headerRow.dxf.fill && null != styleOptions.headerRow.dxf.fill.bg)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment