Commit 91ecd1a8 authored by Alexander.Trofimov's avatar Alexander.Trofimov

pageOptions -> pageSetup

parent 68664c45
......@@ -1637,8 +1637,8 @@
var maxRows = this.model.getRowsCount();
var lastC = -1, lastR = -1;
var activeRange = printOnlySelection ? this.activeRange : null;
var bFitToWidth = pageOptions.asc_getFitToWidth();
var bFitToHeight = pageOptions.asc_getFitToHeight();
var bFitToWidth = false;
var bFitToHeight = false;
if (null === activeRange) {
range = new asc_Range(0, 0, maxCols, maxRows);
......@@ -1688,6 +1688,8 @@
pageWidth = pageSetup.asc_getWidth();
pageHeight = pageSetup.asc_getHeight();
pageOrientation = pageSetup.asc_getOrientation();
bFitToWidth = pageSetup.asc_getFitToWidth();
bFitToHeight = pageSetup.asc_getFitToHeight();
}
var pageLeftField, pageRightField, pageTopField, pageBottomField;
......@@ -1894,19 +1896,19 @@
return arrResult;
};
WorksheetView.prototype.drawForPrint = function ( drawingCtx, printPagesData ) {
WorksheetView.prototype.drawForPrint = function(drawingCtx, printPagesData) {
var isAppBridge = (undefined != window['appBridge']);
if ( null === printPagesData ) {
if (null === printPagesData) {
// Напечатаем пустую страницу
drawingCtx.BeginPage( c_oAscPrintDefaultSettings.PageWidth, c_oAscPrintDefaultSettings.PageHeight );
drawingCtx.BeginPage(c_oAscPrintDefaultSettings.PageWidth, c_oAscPrintDefaultSettings.PageHeight);
drawingCtx.EndPage();
}
else {
drawingCtx.BeginPage( printPagesData.pageWidth, printPagesData.pageHeight );
drawingCtx.AddClipRect( printPagesData.pageClipRectLeft, printPagesData.pageClipRectTop, printPagesData.pageClipRectWidth, printPagesData.pageClipRectHeight );
} else {
drawingCtx.BeginPage(printPagesData.pageWidth, printPagesData.pageHeight);
drawingCtx.AddClipRect(printPagesData.pageClipRectLeft, printPagesData.pageClipRectTop,
printPagesData.pageClipRectWidth, printPagesData.pageClipRectHeight);
if ( isAppBridge ) {
if (isAppBridge) {
window['appBridge']['dummyCommandUpdate']();
}
......@@ -1919,43 +1921,46 @@
// Сменим visibleRange для прохождения проверок отрисовки
this.visibleRange = range;
if ( isAppBridge ) {
if (isAppBridge) {
window['appBridge']['dummyCommandUpdate']();
}
// Нужно отрисовать заголовки
if ( printPagesData.pageHeadings ) {
this._drawColumnHeaders( drawingCtx, range.c1, range.c2, /*style*/ undefined, offsetX, printPagesData.topFieldInPt - this.cellsTop );
this._drawRowHeaders( drawingCtx, range.r1, range.r2, /*style*/ undefined, printPagesData.leftFieldInPt - this.cellsLeft, offsetY );
if (printPagesData.pageHeadings) {
this._drawColumnHeaders(drawingCtx, range.c1, range.c2, /*style*/ undefined, offsetX,
printPagesData.topFieldInPt - this.cellsTop);
this._drawRowHeaders(drawingCtx, range.r1, range.r2, /*style*/ undefined,
printPagesData.leftFieldInPt - this.cellsLeft, offsetY);
}
if ( isAppBridge ) {
if (isAppBridge) {
window['appBridge']['dummyCommandUpdate']();
}
// Рисуем сетку
if ( printPagesData.pageGridLines ) {
this._drawGrid( drawingCtx, range, offsetX, offsetY, printPagesData.pageWidth / vector_koef, printPagesData.pageHeight / vector_koef );
if (printPagesData.pageGridLines) {
this._drawGrid(drawingCtx, range, offsetX, offsetY, printPagesData.pageWidth / vector_koef,
printPagesData.pageHeight / vector_koef);
}
if ( isAppBridge ) {
if (isAppBridge) {
window['appBridge']['dummyCommandUpdate']();
}
// Отрисовываем ячейки и бордеры
this._drawCellsAndBorders( drawingCtx, range, offsetX, offsetY );
this._drawCellsAndBorders(drawingCtx, range, offsetX, offsetY);
if ( isAppBridge ) {
if (isAppBridge) {
window['appBridge']['dummyCommandUpdate']();
}
var drawingPrintOptions = {
ctx: drawingCtx, printPagesData: printPagesData
};
this.objectRender.showDrawingObjectsEx( false, null, drawingPrintOptions );
this.objectRender.showDrawingObjectsEx(false, null, drawingPrintOptions);
this.visibleRange = tmpVisibleRange;
if ( isAppBridge ) {
if (isAppBridge) {
window['appBridge']['dummyCommandUpdate']();
}
......
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