Commit d8dd3b59 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Для заголовком шрифт берется не Calibri 11, а default для ячеек (как в Excel)

Высота заголовков теперь зависит не от default-высоты строк, а от шрифта заголовков: баг http://bugzserver/show_bug.cgi?id=19666

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49711 954022d7-b5bf-4e40-9824-e11837661b57
parent 62b05fc3
...@@ -1557,7 +1557,6 @@ ...@@ -1557,7 +1557,6 @@
var ppiX = 96; // Мерить только с 96 var ppiX = 96; // Мерить только с 96
var ptConvToPx = asc_getcvt(1/*pt*/, 0/*px*/, ppiX); var ptConvToPx = asc_getcvt(1/*pt*/, 0/*px*/, ppiX);
var pxConvToPt = asc_getcvt(0/*px*/, 1/*pt*/, ppiX);
// Максимальная ширина в Pt // Максимальная ширина в Pt
var maxWidthInPt = this.stringRender.getWidestCharWidth(); var maxWidthInPt = this.stringRender.getWidestCharWidth();
......
...@@ -181,8 +181,6 @@ ...@@ -181,8 +181,6 @@
return new WorksheetViewSettings(); return new WorksheetViewSettings();
} }
this.header = { this.header = {
fontName: "Calibri",
fontSize: 11,
style: [ style: [
// Old header colors // Old header colors
/*{ // kHeaderDefault /*{ // kHeaderDefault
...@@ -403,6 +401,7 @@ ...@@ -403,6 +401,7 @@
this.headersTop = 0; this.headersTop = 0;
this.headersWidth = 0; this.headersWidth = 0;
this.headersHeight = 0; this.headersHeight = 0;
this.headersHeightByFont = 0; // Размер по шрифту (размер без скрытия заголовков)
this.cellsLeft = 0; this.cellsLeft = 0;
this.cellsTop = 0; this.cellsTop = 0;
this.cols = []; this.cols = [];
...@@ -1141,6 +1140,12 @@ ...@@ -1141,6 +1140,12 @@
this.defaultRowDescender = this._calcRowDescender(this.settings.cells.fontSize); this.defaultRowDescender = this._calcRowDescender(this.settings.cells.fontSize);
this.defaultRowHeight = asc_calcnpt(this.settings.cells.fontSize * this.vspRatio, this._getPPIY()) + this.height_1px; this.defaultRowHeight = asc_calcnpt(this.settings.cells.fontSize * this.vspRatio, this._getPPIY()) + this.height_1px;
gc_dDefaultRowHeightAttribute = this.model.getDefaultHeight() || this.defaultRowHeight; gc_dDefaultRowHeightAttribute = this.model.getDefaultHeight() || this.defaultRowHeight;
var cells = this.settings.cells;
this._setFont(undefined, cells.fontName, cells.fontSize);
var sr = this.stringRender;
var tm = this._roundTextMetrics(sr.measureString("A"));
this.headersHeightByFont = tm.height;
}, },
_initConstValues: function () { _initConstValues: function () {
var ppiX = this._getPPIX(); var ppiX = this._getPPIX();
...@@ -1254,7 +1259,8 @@ ...@@ -1254,7 +1259,8 @@
if (false === this.model.sheetViews[0].asc_getShowRowColHeaders()) if (false === this.model.sheetViews[0].asc_getShowRowColHeaders())
this.headersHeight = 0; this.headersHeight = 0;
else else
this.headersHeight = this.model.getDefaultHeight() || this.defaultRowHeight; //this.headersHeight = this.model.getDefaultHeight() || this.defaultRowHeight;
this.headersHeight = this.headersHeightByFont + this.height_1px;
//this.headersHeight = asc_calcnpt( this.settings.header.fontSize * this.vspRatio, this._getPPIY() ); //this.headersHeight = asc_calcnpt( this.settings.header.fontSize * this.vspRatio, this._getPPIY() );
this.cellsTop = this.headersTop + this.headersHeight; this.cellsTop = this.headersTop + this.headersHeight;
...@@ -2001,7 +2007,6 @@ ...@@ -2001,7 +2007,6 @@
_drawColumnHeaders: function (drawingCtx, start, end, style, offsetXForDraw, offsetYForDraw) { _drawColumnHeaders: function (drawingCtx, start, end, style, offsetXForDraw, offsetYForDraw) {
if (undefined === drawingCtx && false === this.model.sheetViews[0].asc_getShowRowColHeaders()) if (undefined === drawingCtx && false === this.model.sheetViews[0].asc_getShowRowColHeaders())
return; return;
var hdr = this.settings.header;
var cells = this.settings.cells; var cells = this.settings.cells;
var vr = this.visibleRange; var vr = this.visibleRange;
var offsetX = (offsetXForDraw) ? offsetXForDraw : this.cols[vr.c1].left - this.cellsLeft; var offsetX = (offsetXForDraw) ? offsetXForDraw : this.cols[vr.c1].left - this.cellsLeft;
...@@ -2011,8 +2016,7 @@ ...@@ -2011,8 +2016,7 @@
if (asc_typeof(end) !== "number") {end = vr.c2;} if (asc_typeof(end) !== "number") {end = vr.c2;}
if (style === undefined) {style = kHeaderDefault;} if (style === undefined) {style = kHeaderDefault;}
this._setFont(drawingCtx, hdr.fontName, hdr.fontSize); this._setFont(drawingCtx, cells.fontName, cells.fontSize);
this.stringRender.setDefaultFont(new asc_FP(hdr.fontName, hdr.fontSize));
// draw column headers // draw column headers
for (var i = start; i <= end; ++i) { for (var i = start; i <= end; ++i) {
...@@ -2020,15 +2024,12 @@ ...@@ -2020,15 +2024,12 @@
this.cols[i].left - offsetX, offsetY, this.cols[i].width, this.headersHeight, this.cols[i].left - offsetX, offsetY, this.cols[i].width, this.headersHeight,
style, true, i); style, true, i);
} }
this.stringRender.setDefaultFont(new asc_FP(cells.fontName, cells.fontSize));
}, },
/** Рисует заголовки видимых строк */ /** Рисует заголовки видимых строк */
_drawRowHeaders: function (drawingCtx, start, end, style, offsetXForDraw, offsetYForDraw) { _drawRowHeaders: function (drawingCtx, start, end, style, offsetXForDraw, offsetYForDraw) {
if (undefined === drawingCtx && false === this.model.sheetViews[0].asc_getShowRowColHeaders()) if (undefined === drawingCtx && false === this.model.sheetViews[0].asc_getShowRowColHeaders())
return; return;
var hdr = this.settings.header;
var cells = this.settings.cells; var cells = this.settings.cells;
var vr = this.visibleRange; var vr = this.visibleRange;
var offsetX = (offsetXForDraw) ? offsetXForDraw : this.headersLeft; var offsetX = (offsetXForDraw) ? offsetXForDraw : this.headersLeft;
...@@ -2038,8 +2039,7 @@ ...@@ -2038,8 +2039,7 @@
if (asc_typeof(end) !== "number") {end = vr.r2;} if (asc_typeof(end) !== "number") {end = vr.r2;}
if (style === undefined) {style = kHeaderDefault;} if (style === undefined) {style = kHeaderDefault;}
this._setFont(drawingCtx, hdr.fontName, hdr.fontSize); this._setFont(drawingCtx, cells.fontName, cells.fontSize);
this.stringRender.setDefaultFont(new asc_FP(hdr.fontName, hdr.fontSize));
// draw row headers // draw row headers
for (var i = start; i <= end; ++i) { for (var i = start; i <= end; ++i) {
...@@ -2047,8 +2047,6 @@ ...@@ -2047,8 +2047,6 @@
offsetX, this.rows[i].top - offsetY, this.headersWidth, this.rows[i].height, offsetX, this.rows[i].top - offsetY, this.headersWidth, this.rows[i].height,
style, false, i); style, false, i);
} }
this.stringRender.setDefaultFont(new asc_FP(cells.fontName, cells.fontSize));
}, },
/** /**
......
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