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

pageOptions -> pageSetup

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