Commit 4d7d1021 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 33513

parent 19fdc147
...@@ -646,7 +646,6 @@ ...@@ -646,7 +646,6 @@
WorksheetView.prototype.changeZoom = function (isUpdate) { WorksheetView.prototype.changeZoom = function (isUpdate) {
if (isUpdate) { if (isUpdate) {
History.TurnOff();
this.notUpdateRowHeight = true; this.notUpdateRowHeight = true;
this.cleanSelection(); this.cleanSelection();
this._initCellsArea(AscCommonExcel.recalcType.recalc); this._initCellsArea(AscCommonExcel.recalcType.recalc);
...@@ -660,14 +659,12 @@ ...@@ -660,14 +659,12 @@
this.objectRender.drawingArea.reinitRanges(); this.objectRender.drawingArea.reinitRanges();
this.updateZoom = false; this.updateZoom = false;
this.notUpdateRowHeight = false; this.notUpdateRowHeight = false;
History.TurnOn();
} else { } else {
this.updateZoom = true; this.updateZoom = true;
} }
return this; return this;
}; };
WorksheetView.prototype.changeZoomResize = function () { WorksheetView.prototype.changeZoomResize = function () {
History.TurnOff();
this.cleanSelection(); this.cleanSelection();
this._initCellsArea(AscCommonExcel.recalcType.full); this._initCellsArea(AscCommonExcel.recalcType.full);
this._normalizeViewRange(); this._normalizeViewRange();
...@@ -681,7 +678,6 @@ ...@@ -681,7 +678,6 @@
this.updateResize = false; this.updateResize = false;
this.updateZoom = false; this.updateZoom = false;
History.TurnOn();
}; };
WorksheetView.prototype.getSheetViewSettings = function () { WorksheetView.prototype.getSheetViewSettings = function () {
...@@ -1148,7 +1144,6 @@ ...@@ -1148,7 +1144,6 @@
// ----- Initialization ----- // ----- Initialization -----
WorksheetView.prototype._init = function () { WorksheetView.prototype._init = function () {
History.TurnOff();
this._initConstValues(); this._initConstValues();
this._initWorksheetDefaultWidth(); this._initWorksheetDefaultWidth();
this._initPane(); this._initPane();
...@@ -1156,7 +1151,6 @@ ...@@ -1156,7 +1151,6 @@
this.af_setStyleAfterOpen(); this.af_setStyleAfterOpen();
this._cleanCellsTextMetricsCache(); this._cleanCellsTextMetricsCache();
this._prepareCellTextMetricsCache(); this._prepareCellTextMetricsCache();
History.TurnOn();
// initializing is completed // initializing is completed
this.handlers.trigger("initialized"); this.handlers.trigger("initialized");
...@@ -4661,43 +4655,45 @@ ...@@ -4661,43 +4655,45 @@
}; };
WorksheetView.prototype._updateRowHeight = WorksheetView.prototype._updateRowHeight =
function (tm, col, row, flags, isMerged, fMergedRows, va, ha, angle, maxW, colWidth, textBound) { function (tm, col, row, flags, isMerged, fMergedRows, va, ha, angle, maxW, colWidth, textBound) {
var rowInfo = this.rows[row], rowHeight; var rowInfo = this.rows[row];
// update row's descender // update row's descender
if (va !== Asc.c_oAscVAlign.Top && va !== Asc.c_oAscVAlign.Center && !isMerged) { if (va !== Asc.c_oAscVAlign.Top && va !== Asc.c_oAscVAlign.Center && !isMerged) {
rowInfo.descender = Math.max(rowInfo.descender, tm.height - tm.baseline); rowInfo.descender = Math.max(rowInfo.descender, tm.height - tm.baseline);
} }
rowHeight = rowInfo.height;
// update row's height
// Замерженная ячейка (с 2-мя или более строками) не влияет на высоту строк!
if (!rowInfo.isCustomHeight && !(window["NATIVE_EDITOR_ENJINE"] && this.notUpdateRowHeight) && !fMergedRows) {
var newHeight = tm.height;
if (angle && textBound) {
newHeight = Math.max(rowInfo.height, textBound.height);
}
rowInfo.heightReal = rowInfo.height = Math.min(this.maxRowHeight, Math.max(rowInfo.height, newHeight)); // update row's height
if (rowHeight !== rowInfo.height) { // Замерженная ячейка (с 2-мя или более строками) не влияет на высоту строк!
this.model.setRowHeight(rowInfo.height, row, row, false); if (!rowInfo.isCustomHeight && !(window["NATIVE_EDITOR_ENJINE"] && this.notUpdateRowHeight) &&
!fMergedRows) {
var newHeight = tm.height + this.height_1px;
if (angle && textBound) {
newHeight = Math.max(rowInfo.height, textBound.height);
}
if (angle) { newHeight = Math.min(this.maxRowHeight, Math.max(rowInfo.height, newHeight));
if (newHeight !== rowInfo.height) {
rowInfo.heightReal = rowInfo.height = newHeight;
History.TurnOff();
this.model.setRowHeight(rowInfo.height, row, row, false);
History.TurnOn();
if (flags.wrapText && !rowInfo.isCustomHeight) { if (angle) {
maxW = tm.width; if (flags.wrapText && !rowInfo.isCustomHeight) {
} maxW = tm.width;
}
textBound = textBound =
this.stringRender.getTransformBound(angle, colWidth, rowInfo.height, tm.width, ha, va, maxW); this.stringRender.getTransformBound(angle, colWidth, rowInfo.height, tm.width, ha, va,
maxW);
this._fetchCellCache(col, row).text.textBound = textBound; this._fetchCellCache(col, row).text.textBound = textBound;
} }
this.isChanged = true; this.isChanged = true;
} }
} }
}; };
WorksheetView.prototype._calcMaxWidth = function (col, row, mc) { WorksheetView.prototype._calcMaxWidth = function (col, row, mc) {
if (null === mc) { if (null === mc) {
...@@ -5475,7 +5471,6 @@ ...@@ -5475,7 +5471,6 @@
return this; return this;
} }
History.TurnOff();
this.cleanSelection(); this.cleanSelection();
this.cellCommentator.cleanSelectedComment(); this.cellCommentator.cleanSelectedComment();
...@@ -5653,7 +5648,6 @@ ...@@ -5653,7 +5648,6 @@
//ToDo this.drawDepCells(); //ToDo this.drawDepCells();
this.cellCommentator.updateCommentPosition(); this.cellCommentator.updateCommentPosition();
this.cellCommentator.drawCommentCells(); this.cellCommentator.drawCommentCells();
History.TurnOn();
return this; return this;
}; };
...@@ -5679,7 +5673,6 @@ ...@@ -5679,7 +5673,6 @@
return this; return this;
} }
History.TurnOff();
this.cleanSelection(); this.cleanSelection();
this.cellCommentator.cleanSelectedComment(); this.cellCommentator.cleanSelectedComment();
...@@ -5808,7 +5801,6 @@ ...@@ -5808,7 +5801,6 @@
//ToDo this.drawDepCells(); //ToDo this.drawDepCells();
this.cellCommentator.updateCommentPosition(); this.cellCommentator.updateCommentPosition();
this.cellCommentator.drawCommentCells(); this.cellCommentator.drawCommentCells();
History.TurnOn();
return this; return this;
}; };
...@@ -11157,7 +11149,7 @@ ...@@ -11157,7 +11149,7 @@
bUpdateRowHeight = mergedRange.r1 === mergedRange.r2; bUpdateRowHeight = mergedRange.r1 === mergedRange.r2;
} }
if (bUpdateRowHeight) { if (bUpdateRowHeight) {
h = Math.max(h, ct.metrics.height); h = Math.max(h, ct.metrics.height + this.height_1px);
} }
if (ct.cellVA !== Asc.c_oAscVAlign.Top && ct.cellVA !== Asc.c_oAscVAlign.Center && !isMerged) { if (ct.cellVA !== Asc.c_oAscVAlign.Top && ct.cellVA !== Asc.c_oAscVAlign.Center && !isMerged) {
...@@ -11166,7 +11158,9 @@ ...@@ -11166,7 +11158,9 @@
} }
if (Math.abs(h - this.rows[r].height) > 0.000001 && !this.rows[r].isCustomHeight) { if (Math.abs(h - this.rows[r].height) > 0.000001 && !this.rows[r].isCustomHeight) {
this.rows[r].heightReal = this.rows[r].height = Math.min(h, this.maxRowHeight); this.rows[r].heightReal = this.rows[r].height = Math.min(h, this.maxRowHeight);
this.model.setRowHeight(this.rows[r].height + this.height_1px, r, r, false); History.TurnOff();
this.model.setRowHeight(this.rows[r].height, r, r, false);
History.TurnOn();
this.isChanged = true; this.isChanged = true;
} }
if (Math.abs(d - this.rows[r].descender) > 0.000001) { if (Math.abs(d - this.rows[r].descender) > 0.000001) {
......
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