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

WorksheetView переделал отправку эвентов на handlers вместо вызова options["name"]

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53314 954022d7-b5bf-4e40-9824-e11837661b57
parent 9f53ba18
...@@ -498,7 +498,7 @@ function asc_CCellCommentator(currentSheet) { ...@@ -498,7 +498,7 @@ function asc_CCellCommentator(currentSheet) {
var asc = window["Asc"]; var asc = window["Asc"];
var asc_applyFunction = asc.applyFunction; var asc_applyFunction = asc.applyFunction;
var asc_CCollaborativeRange = asc.asc_CCollaborativeRange; var asc_CCollaborativeRange = asc.asc_CCollaborativeRange;
var isViewerMode = function() { return _this.worksheet._trigger("getViewerMode"); }; var isViewerMode = function() { return _this.worksheet.handlers.trigger("getViewerMode"); };
_this.worksheet = currentSheet; _this.worksheet = currentSheet;
_this.overlayCtx = currentSheet.overlayCtx; _this.overlayCtx = currentSheet.overlayCtx;
...@@ -1161,7 +1161,7 @@ function asc_CCellCommentator(currentSheet) { ...@@ -1161,7 +1161,7 @@ function asc_CCellCommentator(currentSheet) {
coords.nLeft = (mergedRange ? mergedRange.c2 : comment.nCol) + 1; coords.nLeft = (mergedRange ? mergedRange.c2 : comment.nCol) + 1;
if ( !_this.worksheet.cols[coords.nLeft] ) { if ( !_this.worksheet.cols[coords.nLeft] ) {
_this.worksheet.expandColsOnScroll(true); _this.worksheet.expandColsOnScroll(true);
_this.worksheet._trigger("reinitializeScrollX"); _this.worksheet.handlers.trigger("reinitializeScrollX");
} }
coords.nTop = mergedRange ? mergedRange.r1 : comment.nRow; coords.nTop = mergedRange ? mergedRange.r1 : comment.nRow;
...@@ -1357,12 +1357,12 @@ asc_CCellCommentator.prototype = { ...@@ -1357,12 +1357,12 @@ asc_CCellCommentator.prototype = {
if ( (row < vr.r1) || (row > vr.r2) ) { if ( (row < vr.r1) || (row > vr.r2) ) {
var offset = row - vr.r1 - Math.round(( vr.r2 - vr.r1 ) / 2); var offset = row - vr.r1 - Math.round(( vr.r2 - vr.r1 ) / 2);
_this.worksheet.scrollVertical(offset); _this.worksheet.scrollVertical(offset);
_this.worksheet._trigger("reinitializeScrollY"); _this.worksheet.handlers.trigger("reinitializeScrollY");
} }
if ( (col < vr.c1) || (col > vr.c2) ) { if ( (col < vr.c1) || (col > vr.c2) ) {
var offset = col - vr.c1 - Math.round(( vr.c2 - vr.c1 ) / 2); var offset = col - vr.c1 - Math.round(( vr.c2 - vr.c1 ) / 2);
_this.worksheet.scrollHorizontal(offset); _this.worksheet.scrollHorizontal(offset);
_this.worksheet._trigger("reinitializeScrollX"); _this.worksheet.handlers.trigger("reinitializeScrollX");
} }
} }
......
...@@ -3427,7 +3427,7 @@ function CreateImageDrawingObject(imageUrl, options, drawingObjects) { ...@@ -3427,7 +3427,7 @@ function CreateImageDrawingObject(imageUrl, options, drawingObjects) {
object.to.row = cellTo.row; object.to.row = cellTo.row;
object.to.rowOff = cellTo.rowOff; object.to.rowOff = cellTo.rowOff;
worksheet._trigger("reinitializeScroll"); worksheet.handlers.trigger("reinitializeScroll");
} }
function addImageObject(_image) { function addImageObject(_image) {
......
...@@ -3064,7 +3064,7 @@ ...@@ -3064,7 +3064,7 @@
autoFilterObject.asc_setX(cell.x1*kF); autoFilterObject.asc_setX(cell.x1*kF);
autoFilterObject.asc_setWidth(cell.width*kF); autoFilterObject.asc_setWidth(cell.width*kF);
autoFilterObject.asc_setHeight(cell.height*kF); autoFilterObject.asc_setHeight(cell.height*kF);
ws._trigger("setAutoFiltersDialog", autoFilterObject); ws.handlers.trigger("setAutoFiltersDialog", autoFilterObject);
}, },
//отрисовка кнопки фильтра //отрисовка кнопки фильтра
_drawButton: function(x1, y1, options) _drawButton: function(x1, y1, options)
......
...@@ -62,7 +62,6 @@ ...@@ -62,7 +62,6 @@
this.Api = Api; this.Api = Api;
this.collaborativeEditing = collaborativeEditing; this.collaborativeEditing = collaborativeEditing;
this.lastSendInfoRange = null; this.lastSendInfoRange = null;
this.lastSendInfoIsSelectOnShape = null;
this.canUpdateAfterShiftUp = false; // Нужно ли обновлять информацию после отпускания Shift this.canUpdateAfterShiftUp = false; // Нужно ли обновлять информацию после отпускания Shift
//----- declaration ----- //----- declaration -----
...@@ -403,8 +402,8 @@ ...@@ -403,8 +402,8 @@
_createWorksheetView: function (wsModel) { _createWorksheetView: function (wsModel) {
var self = this, var self = this, opt = $.extend(true, {}, this.settings.worksheetDefaults);
opt = $.extend(true, {}, this.settings.worksheetDefaults, { return new asc_WSV(wsModel, /*handlers*/{
"getViewerMode" : function () { return self.controller.getViewerMode ? self.controller.getViewerMode() : true; }, "getViewerMode" : function () { return self.controller.getViewerMode ? self.controller.getViewerMode() : true; },
"reinitializeScroll" : function () {self.controller.reinitializeScroll(/*All*/);}, "reinitializeScroll" : function () {self.controller.reinitializeScroll(/*All*/);},
"reinitializeScrollY" : function () {self.controller.reinitializeScroll(/*vertical*/1);}, "reinitializeScrollY" : function () {self.controller.reinitializeScroll(/*vertical*/1);},
...@@ -418,8 +417,7 @@ ...@@ -418,8 +417,7 @@
"selectionRangeChanged" : function (val) {self.handlers.trigger("asc_onSelectionRangeChanged", val);}, "selectionRangeChanged" : function (val) {self.handlers.trigger("asc_onSelectionRangeChanged", val);},
"getDCForCharts" : function () { return self.drawingCtxCharts; }, "getDCForCharts" : function () { return self.drawingCtxCharts; },
"onRenameCellTextEnd" : function (countFind, countReplace) {self.handlers.trigger("asc_onRenameCellTextEnd", countFind, countReplace);} "onRenameCellTextEnd" : function (countFind, countReplace) {self.handlers.trigger("asc_onRenameCellTextEnd", countFind, countReplace);}
}); }, this.buffers, this.stringRender, this.maxDigitWidth, this.collaborativeEditing, opt);
return new asc_WSV(wsModel, this.buffers, this.stringRender, this.maxDigitWidth, this.collaborativeEditing, opt);
}, },
_onSelectionNameChanged: function (name) { _onSelectionNameChanged: function (name) {
......
...@@ -272,6 +272,7 @@ ...@@ -272,6 +272,7 @@
* Widget for displaying and editing Worksheet object * Widget for displaying and editing Worksheet object
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
* @param {Worksheet} model Worksheet * @param {Worksheet} model Worksheet
* @param {Object} handlers Event handlers
* @param {Array} buffers DrawingContext + Overlay * @param {Array} buffers DrawingContext + Overlay
* @param {StringRender} stringRender StringRender * @param {StringRender} stringRender StringRender
* @param {Number} maxDigitWidth Максимальный размер цифры * @param {Number} maxDigitWidth Максимальный размер цифры
...@@ -281,9 +282,9 @@ ...@@ -281,9 +282,9 @@
* @constructor * @constructor
* @memberOf Asc * @memberOf Asc
*/ */
function WorksheetView(model, buffers, stringRender, maxDigitWidth, collaborativeEditing, settings) { function WorksheetView(model, handlers, buffers, stringRender, maxDigitWidth, collaborativeEditing, settings) {
if ( !(this instanceof WorksheetView) ) { if ( !(this instanceof WorksheetView) ) {
return new WorksheetView(model, buffers, stringRender, maxDigitWidth, collaborativeEditing, settings); return new WorksheetView(model, handlers, buffers, stringRender, maxDigitWidth, collaborativeEditing, settings);
} }
this.settings = $.extend(true, {}, this.defaults, settings); this.settings = $.extend(true, {}, this.defaults, settings);
...@@ -294,6 +295,8 @@ ...@@ -294,6 +295,8 @@
this.vspRatio = 1.275; this.vspRatio = 1.275;
this.handlers = new asc.asc_CHandlersList(handlers);
this.model = model; this.model = model;
this.buffers = buffers; this.buffers = buffers;
...@@ -984,7 +987,7 @@ ...@@ -984,7 +987,7 @@
// ToDo переделать на полную отрисовку на нашем контексте // ToDo переделать на полную отрисовку на нашем контексте
getDrawingContextCharts: function () { getDrawingContextCharts: function () {
return this._trigger("getDCForCharts"); return this.handlers.trigger("getDCForCharts");
}, },
...@@ -1000,7 +1003,7 @@ ...@@ -1000,7 +1003,7 @@
this._cleanCellsTextMetricsCache(); this._cleanCellsTextMetricsCache();
this._prepareCellTextMetricsCache(this.visibleRange); this._prepareCellTextMetricsCache(this.visibleRange);
// initializing is completed // initializing is completed
this._trigger("initialized"); this.handlers.trigger("initialized");
}, },
_initConditionalFormatting: function () { _initConditionalFormatting: function () {
...@@ -3556,11 +3559,11 @@ ...@@ -3556,11 +3559,11 @@
// Увеличиваем, если выходим за область видимости // Critical Bug 17413 // Увеличиваем, если выходим за область видимости // Critical Bug 17413
while ( !this.cols[activeMoveRangeClone.c2] ) { while ( !this.cols[activeMoveRangeClone.c2] ) {
this.expandColsOnScroll(true); this.expandColsOnScroll(true);
this._trigger("reinitializeScrollX"); this.handlers.trigger("reinitializeScrollX");
} }
while ( !this.rows[activeMoveRangeClone.r2] ) { while ( !this.rows[activeMoveRangeClone.r2] ) {
this.expandRowsOnScroll(true); this.expandRowsOnScroll(true);
this._trigger("reinitializeScrollY"); this.handlers.trigger("reinitializeScrollY");
} }
// Координаты для перемещения диапазона // Координаты для перемещения диапазона
...@@ -3882,13 +3885,13 @@ ...@@ -3882,13 +3885,13 @@
bUpdateScrollY = this.expandRowsOnScroll(/*isNotActive*/ false, /*updateRowsCount*/ true); bUpdateScrollY = this.expandRowsOnScroll(/*isNotActive*/ false, /*updateRowsCount*/ true);
} }
if (bUpdateScrollX && bUpdateScrollY) { if (bUpdateScrollX && bUpdateScrollY) {
this._trigger("reinitializeScroll"); this.handlers.trigger("reinitializeScroll");
} }
else if (bUpdateScrollX) { else if (bUpdateScrollX) {
this._trigger("reinitializeScrollX"); this.handlers.trigger("reinitializeScrollX");
} }
else if (bUpdateScrollY) { else if (bUpdateScrollY) {
this._trigger("reinitializeScrollY"); this.handlers.trigger("reinitializeScrollY");
} }
// Range для замерженной ячейки // Range для замерженной ячейки
...@@ -4745,17 +4748,6 @@ ...@@ -4745,17 +4748,6 @@
} }
}, },
// ----- Events processing -----
_trigger: function (eventName) {
var f = this.settings[eventName];
return f && asc_typeof(f) === "function" ?
f.apply( this, Array.prototype.slice.call(arguments, 1) ) :
undefined;
},
// ----- Scrolling ----- // ----- Scrolling -----
_calcCellPosition: function (c, r, dc, dr) { _calcCellPosition: function (c, r, dc, dr) {
...@@ -4891,7 +4883,7 @@ ...@@ -4891,7 +4883,7 @@
if (this.rows[this.rows.length - 1].height < 0.000001) {break;} if (this.rows[this.rows.length - 1].height < 0.000001) {break;}
} while (this._isVisibleY()); } while (this._isVisibleY());
if (!skipScrolReinit) { if (!skipScrolReinit) {
this._trigger("reinitializeScrollY"); this.handlers.trigger("reinitializeScrollY");
} }
} }
}, },
...@@ -4905,7 +4897,7 @@ ...@@ -4905,7 +4897,7 @@
if (this.cols[this.cols.length - 1].width < 0.000001) {break;} if (this.cols[this.cols.length - 1].width < 0.000001) {break;}
} while (this._isVisibleX()); } while (this._isVisibleX());
if (!skipScrolReinit) { if (!skipScrolReinit) {
this._trigger("reinitializeScrollX"); this.handlers.trigger("reinitializeScrollX");
} }
} }
}, },
...@@ -5022,11 +5014,11 @@ ...@@ -5022,11 +5014,11 @@
this._fixSelectionOfMergedCells(); this._fixSelectionOfMergedCells();
this._drawSelection(); this._drawSelection();
if (widthChanged) {this._trigger("reinitializeScrollX");} if (widthChanged) {this.handlers.trigger("reinitializeScrollX");}
} }
if (reinitScrollY) if (reinitScrollY)
this._trigger("reinitializeScrollY"); this.handlers.trigger("reinitializeScrollY");
this.cellCommentator.updateCommentPosition(); this.cellCommentator.updateCommentPosition();
//ToDo this.drawDepCells(); //ToDo this.drawDepCells();
...@@ -5113,7 +5105,7 @@ ...@@ -5113,7 +5105,7 @@
} }
if (reinitScrollX) if (reinitScrollX)
this._trigger("reinitializeScrollX"); this.handlers.trigger("reinitializeScrollX");
this.cellCommentator.updateCommentPosition(); this.cellCommentator.updateCommentPosition();
//ToDo this.drawDepCells(); //ToDo this.drawDepCells();
...@@ -5837,7 +5829,7 @@ ...@@ -5837,7 +5829,7 @@
} }
catch(e){ catch(e){
this.expandColsOnScroll(true); this.expandColsOnScroll(true);
this._trigger("reinitializeScrollX"); this.handlers.trigger("reinitializeScrollX");
} }
} }
if (adjustBottom) { if (adjustBottom) {
...@@ -5846,7 +5838,7 @@ ...@@ -5846,7 +5838,7 @@
} }
catch(e){ catch(e){
this.expandRowsOnScroll(true); this.expandRowsOnScroll(true);
this._trigger("reinitializeScrollY"); this.handlers.trigger("reinitializeScrollY");
} }
} }
return { return {
...@@ -6155,9 +6147,9 @@ ...@@ -6155,9 +6147,9 @@
}, },
_updateSelectionNameAndInfo: function () { _updateSelectionNameAndInfo: function () {
this._trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false)); this.handlers.trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false));
this._trigger("selectionChanged", this.getSelectionInfo()); this.handlers.trigger("selectionChanged", this.getSelectionInfo());
this._trigger("selectionMathInfoChanged", this.getSelectionMathInfo()); this.handlers.trigger("selectionMathInfoChanged", this.getSelectionMathInfo());
}, },
getSelectionShape: function () { getSelectionShape: function () {
...@@ -6166,9 +6158,9 @@ ...@@ -6166,9 +6158,9 @@
setSelectionShape: function (isSelectOnShape) { setSelectionShape: function (isSelectOnShape) {
this.isSelectOnShape = isSelectOnShape; this.isSelectOnShape = isSelectOnShape;
// отправляем евент для получения свойств картинки, шейпа или группы // отправляем евент для получения свойств картинки, шейпа или группы
this._trigger("selectionNameChanged", this.getSelectionName()); this.handlers.trigger("selectionNameChanged", this.getSelectionName());
this._trigger("selectionChanged", this.getSelectionInfo()); this.handlers.trigger("selectionChanged", this.getSelectionInfo());
this._trigger("selectionMathInfoChanged", this.getSelectionMathInfo()); this.handlers.trigger("selectionMathInfoChanged", this.getSelectionMathInfo());
}, },
getActiveRangeObj: function(){ getActiveRangeObj: function(){
return this.activeRange.clone(true); return this.activeRange.clone(true);
...@@ -6208,9 +6200,9 @@ ...@@ -6208,9 +6200,9 @@
this.activeRange.normalize(); this.activeRange.normalize();
this._drawSelection(); this._drawSelection();
this._trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false)); this.handlers.trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false));
this._trigger("selectionChanged", this.getSelectionInfo()); this.handlers.trigger("selectionChanged", this.getSelectionInfo());
this._trigger("selectionMathInfoChanged", this.getSelectionMathInfo()); this.handlers.trigger("selectionMathInfoChanged", this.getSelectionMathInfo());
return this._calcActiveCellOffset(); return this._calcActiveCellOffset();
}, },
...@@ -6232,9 +6224,9 @@ ...@@ -6232,9 +6224,9 @@
this._drawSelection(); this._drawSelection();
this._trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false)); this.handlers.trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false));
this._trigger("selectionChanged", this.getSelectionInfo()); this.handlers.trigger("selectionChanged", this.getSelectionInfo());
this._trigger("selectionMathInfoChanged", this.getSelectionMathInfo()); this.handlers.trigger("selectionMathInfoChanged", this.getSelectionMathInfo());
oRes = this._calcActiveCellOffset(); oRes = this._calcActiveCellOffset();
} }
...@@ -6268,14 +6260,14 @@ ...@@ -6268,14 +6260,14 @@
if (!this.isCellEditMode && (sc !== ar.startCol || sr !== ar.startRow || isChangeSelectionShape)) { if (!this.isCellEditMode && (sc !== ar.startCol || sr !== ar.startRow || isChangeSelectionShape)) {
if (!this.isSelectionDialogMode) { if (!this.isSelectionDialogMode) {
this._trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false)); this.handlers.trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false));
if (!isSelectMode) { if (!isSelectMode) {
this._trigger("selectionChanged", this.getSelectionInfo()); this.handlers.trigger("selectionChanged", this.getSelectionInfo());
this._trigger("selectionMathInfoChanged", this.getSelectionMathInfo()); this.handlers.trigger("selectionMathInfoChanged", this.getSelectionMathInfo());
} }
} else { } else {
// Смена диапазона // Смена диапазона
this._trigger("selectionRangeChanged", this.getSelectionRangeValue()); this.handlers.trigger("selectionRangeChanged", this.getSelectionRangeValue());
} }
} }
...@@ -6395,14 +6387,14 @@ ...@@ -6395,14 +6387,14 @@
if (!this.isCellEditMode && !arnOld.isEqual(ar.clone(true))) { if (!this.isCellEditMode && !arnOld.isEqual(ar.clone(true))) {
if (!this.isSelectionDialogMode) { if (!this.isSelectionDialogMode) {
this._trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/true)); this.handlers.trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/true));
if (!isSelectMode) { if (!isSelectMode) {
this._trigger("selectionChanged", this.getSelectionInfo(false)); this.handlers.trigger("selectionChanged", this.getSelectionInfo(false));
this._trigger("selectionMathInfoChanged", this.getSelectionMathInfo()); this.handlers.trigger("selectionMathInfoChanged", this.getSelectionMathInfo());
} }
} else { } else {
// Смена диапазона // Смена диапазона
this._trigger("selectionRangeChanged", this.getSelectionRangeValue()); this.handlers.trigger("selectionRangeChanged", this.getSelectionRangeValue());
} }
} }
...@@ -6442,8 +6434,8 @@ ...@@ -6442,8 +6434,8 @@
ret = this._calcActiveCellOffset(); ret = this._calcActiveCellOffset();
// Эвент обновления // Эвент обновления
this._trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false)); this.handlers.trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false));
this._trigger("selectionChanged", this.getSelectionInfo()); this.handlers.trigger("selectionChanged", this.getSelectionInfo());
return ret; return ret;
}, },
...@@ -7019,11 +7011,11 @@ ...@@ -7019,11 +7011,11 @@
// Увеличиваем, если выходим за область видимости // Critical Bug 17413 // Увеличиваем, если выходим за область видимости // Critical Bug 17413
while (!this.cols[this.activeMoveRange.c2]) { while (!this.cols[this.activeMoveRange.c2]) {
this.expandColsOnScroll(true); this.expandColsOnScroll(true);
this._trigger("reinitializeScrollX"); this.handlers.trigger("reinitializeScrollX");
} }
while (!this.rows[this.activeMoveRange.r2]) { while (!this.rows[this.activeMoveRange.r2]) {
this.expandRowsOnScroll(true); this.expandRowsOnScroll(true);
this._trigger("reinitializeScrollY"); this.handlers.trigger("reinitializeScrollY");
} }
// Перерисовываем // Перерисовываем
...@@ -7329,7 +7321,7 @@ ...@@ -7329,7 +7321,7 @@
case "angle": range.setAngle(val); break; case "angle": range.setAngle(val); break;
case "border": case "border":
if (isLargeRange) { callTrigger = true; t._trigger("slowOperation", true); } if (isLargeRange) { callTrigger = true; t.handlers.trigger("slowOperation", true); }
// None // None
if (val.length < 1) { if (val.length < 1) {
range.setBorder(null); range.setBorder(null);
...@@ -7352,7 +7344,7 @@ ...@@ -7352,7 +7344,7 @@
range.setBorder(res); range.setBorder(res);
break; break;
case "merge": case "merge":
if (isLargeRange) { callTrigger = true; t._trigger("slowOperation", true); } if (isLargeRange) { callTrigger = true; t.handlers.trigger("slowOperation", true); }
switch (val) { switch (val) {
case c_oAscMergeOptions.Unmerge: range.unmerge(); break; case c_oAscMergeOptions.Unmerge: range.unmerge(); break;
case c_oAscMergeOptions.MergeCenter: range.merge(val); break; case c_oAscMergeOptions.MergeCenter: range.merge(val); break;
...@@ -7370,13 +7362,13 @@ ...@@ -7370,13 +7362,13 @@
break; break;
case "sort": case "sort":
if (isLargeRange) { callTrigger = true; t._trigger("slowOperation", true); } if (isLargeRange) { callTrigger = true; t.handlers.trigger("slowOperation", true); }
var changes = range.sort(val, arn.startCol); var changes = range.sort(val, arn.startCol);
t.cellCommentator.sortComments(arn, changes); t.cellCommentator.sortComments(arn, changes);
break; break;
case "empty": case "empty":
if (isLargeRange) { callTrigger = true; t._trigger("slowOperation", true); } if (isLargeRange) { callTrigger = true; t.handlers.trigger("slowOperation", true); }
/* отключаем отрисовку на случай необходимости пересчета ячеек, заносим ячейку, при необходимости в список перерисовываемых */ /* отключаем отрисовку на случай необходимости пересчета ячеек, заносим ячейку, при необходимости в список перерисовываемых */
lockDraw(t.model.workbook); lockDraw(t.model.workbook);
if (val === c_oAscCleanOptions.All) if (val === c_oAscCleanOptions.All)
...@@ -7428,7 +7420,7 @@ ...@@ -7428,7 +7420,7 @@
break; break;
case "paste": case "paste":
var pasteLocal = function () { var pasteLocal = function () {
if (isLargeRange) { callTrigger = true; t._trigger("slowOperation", true); } if (isLargeRange) { callTrigger = true; t.handlers.trigger("slowOperation", true); }
var selectData; var selectData;
if(isLocal === 'binary') if(isLocal === 'binary')
selectData = t._pasteFromBinary(val); selectData = t._pasteFromBinary(val);
...@@ -7503,7 +7495,7 @@ ...@@ -7503,7 +7495,7 @@
arn.c1 = 0; arn.c1 = 0;
arn.c2 = gc_nMaxCol0; arn.c2 = gc_nMaxCol0;
if (bIsUpdate) { if (bIsUpdate) {
if (callTrigger) { t._trigger("slowOperation", false); } if (callTrigger) { t.handlers.trigger("slowOperation", false); }
t.isChanged = true; t.isChanged = true;
t._updateCellsRange(arn, canChangeColWidth); t._updateCellsRange(arn, canChangeColWidth);
t._prepareCellTextMetricsCache(arn); t._prepareCellTextMetricsCache(arn);
...@@ -7653,7 +7645,7 @@ ...@@ -7653,7 +7645,7 @@
} }
if (bIsUpdate) { if (bIsUpdate) {
if (callTrigger) { t._trigger("slowOperation", false); } if (callTrigger) { t.handlers.trigger("slowOperation", false); }
t.isChanged = true; t.isChanged = true;
t._updateCellsRange(arn, canChangeColWidth); t._updateCellsRange(arn, canChangeColWidth);
} }
...@@ -7722,7 +7714,7 @@ ...@@ -7722,7 +7714,7 @@
} }
else else
{ {
this._trigger ("onError", c_oAscError.ID.PastInMergeAreaError, c_oAscError.Level.NoCritical); this.handlers.trigger ("onError", c_oAscError.ID.PastInMergeAreaError, c_oAscError.Level.NoCritical);
return; return;
} }
} }
...@@ -7745,7 +7737,7 @@ ...@@ -7745,7 +7737,7 @@
} }
else else
{ {
this._trigger ("onErrorEvent", c_oAscError.ID.PastInMergeAreaError, c_oAscError.Level.NoCritical); this.handlers.trigger ("onErrorEvent", c_oAscError.ID.PastInMergeAreaError, c_oAscError.Level.NoCritical);
return; return;
} }
} }
...@@ -7996,7 +7988,7 @@ ...@@ -7996,7 +7988,7 @@
} }
else else
{ {
this._trigger ("onError", c_oAscError.ID.PastInMergeAreaError, c_oAscError.Level.NoCritical); this.handlers.trigger ("onError", c_oAscError.ID.PastInMergeAreaError, c_oAscError.Level.NoCritical);
return; return;
} }
} }
...@@ -8019,7 +8011,7 @@ ...@@ -8019,7 +8011,7 @@
} }
else else
{ {
this._trigger ("onErrorEvent", c_oAscError.ID.PastInMergeAreaError, c_oAscError.Level.NoCritical); this.handlers.trigger ("onErrorEvent", c_oAscError.ID.PastInMergeAreaError, c_oAscError.Level.NoCritical);
return; return;
} }
} }
...@@ -8304,7 +8296,7 @@ ...@@ -8304,7 +8296,7 @@
} }
else else
{ {
this._trigger ("onError", c_oAscError.ID.PastInMergeAreaError, c_oAscError.Level.NoCritical); this.handlers.trigger ("onError", c_oAscError.ID.PastInMergeAreaError, c_oAscError.Level.NoCritical);
return; return;
} }
} }
...@@ -8327,7 +8319,7 @@ ...@@ -8327,7 +8319,7 @@
} }
else else
{ {
this._trigger ("onErrorEvent", c_oAscError.ID.PastInMergeAreaError, c_oAscError.Level.NoCritical); this.handlers.trigger ("onErrorEvent", c_oAscError.ID.PastInMergeAreaError, c_oAscError.Level.NoCritical);
return; return;
} }
} }
...@@ -8783,7 +8775,7 @@ ...@@ -8783,7 +8775,7 @@
t.objectRender.setScrollOffset(); t.objectRender.setScrollOffset();
t.draw(); t.draw();
t._trigger("reinitializeScroll"); t.handlers.trigger("reinitializeScroll");
if (isUpdateCols) { t._updateVisibleColsCount(); } if (isUpdateCols) { t._updateVisibleColsCount(); }
if (isUpdateRows) { t._updateVisibleRowsCount(); } if (isUpdateRows) { t._updateVisibleRowsCount(); }
...@@ -9127,7 +9119,7 @@ ...@@ -9127,7 +9119,7 @@
t._prepareCellTextMetricsCache(t.visibleRange); t._prepareCellTextMetricsCache(t.visibleRange);
t.draw(lockDraw); t.draw(lockDraw);
t._trigger("reinitializeScroll"); t.handlers.trigger("reinitializeScroll");
if (isUpdateCols) { t._updateVisibleColsCount(); } if (isUpdateCols) { t._updateVisibleColsCount(); }
if (isUpdateRows) { t._updateVisibleRowsCount(); } if (isUpdateRows) { t._updateVisibleRowsCount(); }
...@@ -9364,8 +9356,8 @@ ...@@ -9364,8 +9356,8 @@
offs = this._calcActiveRangeOffset(); offs = this._calcActiveRangeOffset();
if (sc !== ar.startCol || sr !== ar.startRow) { if (sc !== ar.startCol || sr !== ar.startRow) {
this._trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false)); this.handlers.trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false));
this._trigger("selectionChanged", this.getSelectionInfo()); this.handlers.trigger("selectionChanged", this.getSelectionInfo());
} }
return offs; return offs;
}, },
...@@ -9507,7 +9499,7 @@ ...@@ -9507,7 +9499,7 @@
var aReplaceCells = []; var aReplaceCells = [];
if (options.isReplaceAll) { if (options.isReplaceAll) {
// На ReplaceAll ставим медленную операцию // На ReplaceAll ставим медленную операцию
t._trigger("slowOperation", true); t.handlers.trigger("slowOperation", true);
var aReplaceCellsIndex = {}; var aReplaceCellsIndex = {};
var optionsFind = {text: options.findWhat, scanByRows: true, scanForward: true, var optionsFind = {text: options.findWhat, scanByRows: true, scanForward: true,
isMatchCase: options.isMatchCase, isWholeCell: options.isWholeCell, isNotSelect: true, activeRange: ar}; isMatchCase: options.isMatchCase, isWholeCell: options.isWholeCell, isNotSelect: true, activeRange: ar};
...@@ -9532,7 +9524,7 @@ ...@@ -9532,7 +9524,7 @@
if (c === undefined) { if (c === undefined) {
asc_debug("log", "Unknown cell's info: col = " + c1 + ", row = " + r1); asc_debug("log", "Unknown cell's info: col = " + c1 + ", row = " + r1);
t._trigger("onRenameCellTextEnd", 0, 0); t.handlers.trigger("onRenameCellTextEnd", 0, 0);
return; return;
} }
...@@ -9541,7 +9533,7 @@ ...@@ -9541,7 +9533,7 @@
// Попробуем сначала найти // Попробуем сначала найти
if ((true === options.isWholeCell && cellValue.length !== options.findWhat.length) || if ((true === options.isWholeCell && cellValue.length !== options.findWhat.length) ||
0 > cellValue.search(valueForSearching)) { 0 > cellValue.search(valueForSearching)) {
t._trigger("onRenameCellTextEnd", 0, 0); t.handlers.trigger("onRenameCellTextEnd", 0, 0);
return; return;
} }
...@@ -9549,7 +9541,7 @@ ...@@ -9549,7 +9541,7 @@
} }
if (0 > aReplaceCells.length) { if (0 > aReplaceCells.length) {
t._trigger("onRenameCellTextEnd", 0, 0); t.handlers.trigger("onRenameCellTextEnd", 0, 0);
return; return;
} }
this._replaceCellsText(aReplaceCells, valueForSearching, options); this._replaceCellsText(aReplaceCells, valueForSearching, options);
...@@ -9572,10 +9564,10 @@ ...@@ -9572,10 +9564,10 @@
History.EndTransaction(); History.EndTransaction();
if (options.isReplaceAll) { if (options.isReplaceAll) {
// Завершаем медленную операцию // Завершаем медленную операцию
t._trigger("slowOperation", false); t.handlers.trigger("slowOperation", false);
} }
t._trigger("onRenameCellTextEnd", options.countFind, options.countReplace); t.handlers.trigger("onRenameCellTextEnd", options.countFind, options.countReplace);
return; return;
} }
...@@ -9864,13 +9856,13 @@ ...@@ -9864,13 +9856,13 @@
t._calcVisibleRows(); t._calcVisibleRows();
} }
if (bIsUpdateX && bIsUpdateY) { if (bIsUpdateX && bIsUpdateY) {
this._trigger("reinitializeScroll"); this.handlers.trigger("reinitializeScroll");
} }
else if (bIsUpdateX) { else if (bIsUpdateX) {
this._trigger("reinitializeScrollX"); this.handlers.trigger("reinitializeScrollX");
} }
else if (bIsUpdateY) { else if (bIsUpdateY) {
this._trigger("reinitializeScrollY"); this.handlers.trigger("reinitializeScrollY");
} }
if (bIsUpdateX || bIsUpdateY) { if (bIsUpdateX || bIsUpdateY) {
...@@ -10007,10 +9999,10 @@ ...@@ -10007,10 +9999,10 @@
t.cache.reset(); t.cache.reset();
t._cleanCellsTextMetricsCache(); t._cleanCellsTextMetricsCache();
t._prepareCellTextMetricsCache(t.visibleRange); t._prepareCellTextMetricsCache(t.visibleRange);
t._trigger("reinitializeScroll"); t.handlers.trigger("reinitializeScroll");
t._trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false)); t.handlers.trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false));
t._trigger("selectionChanged", t.getSelectionInfo()); t.handlers.trigger("selectionChanged", t.getSelectionInfo());
t._trigger("selectionMathInfoChanged", t.getSelectionMathInfo()); t.handlers.trigger("selectionMathInfoChanged", t.getSelectionMathInfo());
} }
t.objectRender.rebuildChartGraphicObjects(); t.objectRender.rebuildChartGraphicObjects();
......
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