Commit c6e5f952 authored by GoshaZotov's avatar GoshaZotov

draw format table pictures with properties

parent 0ff76650
...@@ -1402,8 +1402,8 @@ ...@@ -1402,8 +1402,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() {
...@@ -2580,7 +2580,7 @@ ...@@ -2580,7 +2580,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;
...@@ -2607,7 +2607,7 @@ ...@@ -2607,7 +2607,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++;
...@@ -2626,7 +2626,7 @@ ...@@ -2626,7 +2626,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++;
...@@ -2636,20 +2636,38 @@ ...@@ -2636,20 +2636,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)
{ {
ShowColumnStripes: false, styleInfo =
ShowFirstColumn: false, {
ShowLastColumn: false, ShowColumnStripes: props.asc_getBandVer(),
ShowRowStripes: true, ShowFirstColumn: props.asc_getFirstCol(),
TotalsRowCount: 0 ShowLastColumn: props.asc_getLastCol(),
}; ShowRowStripes: props.asc_getBandHor(),
HeaderRowCount: props.asc_getFirstRow(),
TotalsRowCount: props.asc_getLastRow()
};
}
else
{
styleInfo =
{
ShowColumnStripes: false,
ShowFirstColumn: false,
ShowLastColumn: false,
ShowRowStripes: true,
HeaderRowCount: null,
TotalsRowCount: 0
};
}
var pxToMM = 72 / 96; var pxToMM = 72 / 96;
var ySize = 45 * pxToMM; var ySize = 45 * pxToMM;
...@@ -2787,7 +2805,7 @@ ...@@ -2787,7 +2805,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