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 @@
};
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
t.undoList.push({fn: t._removeChars, args: [pos, str.length], isRange: isRange});
t.redoList = [];
this.undoList.push({fn: this._removeChars, args: [pos, str.length], isRange: isRange});
this.redoList = [];
}
if (t.newTextFormat) {
var oNewObj = new Fragment({format: t.newTextFormat, text: str});
t._addFragments([oNewObj], pos);
delete t.newTextFormat;
if (this.newTextFormat) {
var oNewObj = new Fragment({format: this.newTextFormat, text: str});
this._addFragments([oNewObj], pos);
delete this.newTextFormat;
} else {
f = t._findFragmentToInsertInto(pos);
f = this._findFragmentToInsertInto(pos);
if (f) {
l = pos - f.begin;
s = opt.fragments[f.index].text;
......@@ -1315,10 +1315,9 @@
}
}
t.cursorPos = pos + str.length;
if (!t.undoAllMode) {
t._update();
}
this.cursorPos = pos + str.length;
if (!this.undoAllMode)
this._update();
};
CellEditor.prototype._addNewLine = function () {
......
......@@ -384,7 +384,7 @@
"isGlobalLockEditCell" : function () {return self.collaborativeEditing.getGlobalLockEditCell();},
"updateFormulaEditModEnd" : function (rangeUpdated) {self.getWorksheet().updateSelection();},
"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) {
self.handlers.trigger("asc_onCanUndoChanged", bCanUndo);
self.handlers.trigger("asc_onCanRedoChanged", bCanRedo);
......
......@@ -10711,20 +10711,26 @@
};
WorksheetView.prototype.enterCellRange = function (editor) {
var t = this;
if (!t.isFormulaEditMode)
if (!this.isFormulaEditMode)
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);
if (mergedRange && ar.isEqual(mergedRange)) {
ar.r2 = ar.r1;
ar.c2 = ar.c1;
var mergedRange = this.model.getMergedByCell(arNormal.r1, arNormal.c1);
if (mergedRange && arNormal.isEqual(mergedRange)) {
arNormal.r2 = arNormal.r1;
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) {
......@@ -10738,7 +10744,7 @@
this._fixSelectionOfMergedCells();
};
WorksheetView.prototype.changeFormulaRange = function (range) {
WorksheetView.prototype.activeFormulaRange = function (range) {
for (var i = 0; i < this.arrActiveFormulaRanges.length; ++i) {
if (this.arrActiveFormulaRanges[i].isEqual(range)) {
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