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

fix bug #24429

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59971 954022d7-b5bf-4e40-9824-e11837661b57
parent ddf93a47
...@@ -1290,24 +1290,24 @@ ...@@ -1290,24 +1290,24 @@
}; };
CellEditor.prototype._addChars = function (str, pos, isRange) { CellEditor.prototype._addChars = function (str, pos, isRange) {
var t = this, opt = t.options, f, l, s; var opt = this.options, f, l, s;
if (t.selectionBegin !== t.selectionEnd) {t._removeChars(undefined, undefined, isRange);} if (this.selectionBegin !== this.selectionEnd) {this._removeChars(undefined, undefined, isRange);}
if (pos === undefined) {pos = t.cursorPos;} if (pos === undefined) {pos = this.cursorPos;}
if (!t.undoMode) { if (!this.undoMode) {
// save info to undo/redo // save info to undo/redo
t.undoList.push({fn: t._removeChars, args: [pos, str.length], isRange: isRange}); this.undoList.push({fn: this._removeChars, args: [pos, str.length], isRange: isRange});
t.redoList = []; this.redoList = [];
} }
if (t.newTextFormat) { if (this.newTextFormat) {
var oNewObj = new Fragment({format: t.newTextFormat, text: str}); var oNewObj = new Fragment({format: this.newTextFormat, text: str});
t._addFragments([oNewObj], pos); this._addFragments([oNewObj], pos);
delete t.newTextFormat; delete this.newTextFormat;
} else { } else {
f = t._findFragmentToInsertInto(pos); f = this._findFragmentToInsertInto(pos);
if (f) { if (f) {
l = pos - f.begin; l = pos - f.begin;
s = opt.fragments[f.index].text; s = opt.fragments[f.index].text;
...@@ -1315,10 +1315,9 @@ ...@@ -1315,10 +1315,9 @@
} }
} }
t.cursorPos = pos + str.length; this.cursorPos = pos + str.length;
if (!t.undoAllMode) { if (!this.undoAllMode)
t._update(); this._update();
}
}; };
CellEditor.prototype._addNewLine = function () { CellEditor.prototype._addNewLine = function () {
......
...@@ -384,7 +384,7 @@ ...@@ -384,7 +384,7 @@
"isGlobalLockEditCell" : function () {return self.collaborativeEditing.getGlobalLockEditCell();}, "isGlobalLockEditCell" : function () {return self.collaborativeEditing.getGlobalLockEditCell();},
"updateFormulaEditModEnd" : function (rangeUpdated) {self.getWorksheet().updateSelection();}, "updateFormulaEditModEnd" : function (rangeUpdated) {self.getWorksheet().updateSelection();},
"newRange" : function (range) { self.getWorksheet().addFormulaRange(range); }, "newRange" : function (range) { self.getWorksheet().addFormulaRange(range); },
"existedRange" : function (range) { self.getWorksheet().changeFormulaRange(range); }, "existedRange" : function (range) { self.getWorksheet().activeFormulaRange(range); },
"updateUndoRedoChanged" : function (bCanUndo, bCanRedo) { "updateUndoRedoChanged" : function (bCanUndo, bCanRedo) {
self.handlers.trigger("asc_onCanUndoChanged", bCanUndo); self.handlers.trigger("asc_onCanUndoChanged", bCanUndo);
self.handlers.trigger("asc_onCanRedoChanged", bCanRedo); self.handlers.trigger("asc_onCanRedoChanged", bCanRedo);
......
...@@ -10711,20 +10711,26 @@ ...@@ -10711,20 +10711,26 @@
}; };
WorksheetView.prototype.enterCellRange = function (editor) { WorksheetView.prototype.enterCellRange = function (editor) {
var t = this; if (!this.isFormulaEditMode)
if (!t.isFormulaEditMode)
return; return;
var ar = t.arrActiveFormulaRanges[t.arrActiveFormulaRanges.length - 1].clone(true); var currentRange = this.arrActiveFormulaRanges[this.arrActiveFormulaRanges.length - 1];
var arOriginal = currentRange.clone();
var arNormal = currentRange.clone(true);
// Замерженную ячейку должны отдать только левую верхнюю. // Замерженную ячейку должны отдать только левую верхнюю.
var mergedRange = this.model.getMergedByCell(ar.r1, ar.c1); var mergedRange = this.model.getMergedByCell(arNormal.r1, arNormal.c1);
if (mergedRange && ar.isEqual(mergedRange)) { if (mergedRange && arNormal.isEqual(mergedRange)) {
ar.r2 = ar.r1; arNormal.r2 = arNormal.r1;
ar.c2 = ar.c1; arNormal.c2 = arNormal.c1;
} }
editor.enterCellRange(ar.getName()); editor.enterCellRange(arNormal.getName());
for (var i = 0; i < this.arrActiveFormulaRanges.length; ++i) {
if (this.arrActiveFormulaRanges[i].isEqual(arNormal)) {
this.arrActiveFormulaRanges[i].assign2(arOriginal);
break;
}
}
}; };
WorksheetView.prototype.addFormulaRange = function (range) { WorksheetView.prototype.addFormulaRange = function (range) {
...@@ -10738,7 +10744,7 @@ ...@@ -10738,7 +10744,7 @@
this._fixSelectionOfMergedCells(); this._fixSelectionOfMergedCells();
}; };
WorksheetView.prototype.changeFormulaRange = function (range) { WorksheetView.prototype.activeFormulaRange = function (range) {
for (var i = 0; i < this.arrActiveFormulaRanges.length; ++i) { for (var i = 0; i < this.arrActiveFormulaRanges.length; ++i) {
if (this.arrActiveFormulaRanges[i].isEqual(range)) { if (this.arrActiveFormulaRanges[i].isEqual(range)) {
var r = this.arrActiveFormulaRanges[i]; var r = this.arrActiveFormulaRanges[i];
......
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