Commit a2d06201 authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

удаление именованных диапазонов при удалении листа.

баг при удалении листа в ячейках вида Sheet1!A1.
баг поиска таблицы/автофильтра по имени при переносе.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@63128 954022d7-b5bf-4e40-9824-e11837661b57
parent dc636c93
......@@ -3138,8 +3138,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.wb.removeHyperlink();
};
spreadsheet_api.prototype.asc_insertFormula = function (functionName, autoComplet) {
this.wb.insertFormulaInEditor(functionName, autoComplet);
spreadsheet_api.prototype.asc_insertFormula = function (functionName, autoComplet, isDefName) {
this.wb.insertFormulaInEditor(functionName, autoComplet, isDefName);
this.wb.restoreFocus();
};
......
This diff is collapsed.
......@@ -2893,7 +2893,7 @@ UndoRedoWorkbook.prototype = {
var n;
for(var i = 0; i < Data.slaveEdge.length; i++){
n = this.wb.dependencyFormulas.getNode3(Data.slaveEdge[i]);
if( n ){
this.wb.needRecalc.nodes[n.nodeId] = [n.sheetId, n.cellId ];
this.wb.needRecalc.length++;
......@@ -2904,6 +2904,7 @@ UndoRedoWorkbook.prototype = {
n.formulaParsed.buildDependencies();
}() : null;
}
}
sortDependency(this.wb);
}
this.wb.handlers.trigger("asc_onEditDefName", null, Data);
......
This diff is collapsed.
......@@ -4348,11 +4348,14 @@ TablePart.prototype.clone = function(ws) {
TablePart.prototype.recalc = function(ws) {
this.DisplayName = ws.workbook.dependencyFormulas.getNextTableName(ws, this.Ref);
};
TablePart.prototype.moveRef = function(col, row) {
TablePart.prototype.moveRef = function(col, row, ws) {
var ref = this.Ref.clone();
ref.setOffset({offsetCol: col ? col : 0, offsetRow: row ? row : 0});
var worksheet = ws.model;
this.Ref = ref;
worksheet.workbook.dependencyFormulas.changeTableName( this.DisplayName, worksheet, this.Ref );
if(this.AutoFilter)
this.AutoFilter.moveRef(col, row);
};
......
......@@ -1692,7 +1692,7 @@ var maxIndividualValues = 10000;
range = ref;
//move ref
findFilters[i].moveRef(diffCol, diffRow);
findFilters[i].moveRef(diffCol, diffRow, ws);
isUpdate = false;
if((findFilters[i].AutoFilter && findFilters[i].AutoFilter.FilterColumns && findFilters[i].AutoFilter.FilterColumns.length) || (findFilters[i].FilterColumns && findFilters[i].FilterColumns.length))
......
......@@ -1553,16 +1553,15 @@
};
// Вставка формулы в редактор
WorkbookView.prototype.insertFormulaInEditor = function (functionName, autoComplete) {
var t = this;
var ws = this.getWorksheet();
WorkbookView.prototype.insertFormulaInEditor = function (functionName, autoComplete, isDefName) {
var t = this, ws = this.getWorksheet(), cursorPos
// Проверяем, открыт ли редактор
if (ws.getCellEditMode()) {
// При autoComplete заканчиваем ввод
if (autoComplete)
this.cellEditor.close(true);
else if (false === this.cellEditor.insertFormula (functionName)) {
else if (false === this.cellEditor.insertFormula (functionName,isDefName)) {
// Не смогли вставить формулу, закроем редактор, с сохранением текста
this.cellEditor.close(true);
}
......@@ -1573,6 +1572,10 @@
if (autoComplete) {
cellRange = ws.autoCompleteFormula(functionName);
}
if(isDefName){
functionName = "=" + functionName
}
else{
if (cellRange) {
if (cellRange.notEditCell) {
// Мы уже ввели все что нужно, редактор открывать не нужно
......@@ -1584,9 +1587,9 @@
// Меняем значение ячейки
functionName = "=" + functionName + "()";
}
// Вычисляем позицию курсора (он должен быть в функции)
var cursorPos = functionName.length - 1;
cursorPos = functionName.length - 1;
}
// Проверка глобального лока
if (this.collaborativeEditing.getGlobalLock())
......@@ -1938,8 +1941,8 @@
return ws.findCell(reference);
};
WorkbookView.prototype.getDefinedNames = function () {
return this.model.getDefinesNamesWB();
WorkbookView.prototype.getDefinedNames = function (defNameListId) {
return this.model.getDefinesNamesWB(defNameListId);
};
WorkbookView.prototype.setDefinedNames = function (defName) {
......
......@@ -6506,7 +6506,7 @@
defName = this.model.getName() + "!" + dN.getAbsName();
}*/
defName = this.model.getName() + "!" + dN.getAbsName();
defName = parserHelp.getEscapeSheetName(this.model.getName()) + "!" + dN.getAbsName();
defName = defName ? this.model.workbook.findDefinesNames(defName,this.model.getId()) : null;
......@@ -6516,8 +6516,8 @@
WorksheetView.prototype.getSelectionRangeValue = function () {
// ToDo проблема с выбором целого столбца/строки
var ar = this.activeRange.clone(true);
ar.r1Abs = ar.c1Abs = ar.r2Abs = ar.c2Abs = true;
var sName = ar.getName();
// ar.r1Abs = ar.c1Abs = ar.r2Abs = ar.c2Abs = true;
var sName = ar.getAbsName();
return (c_oAscSelectionDialogType.FormatTable === this.selectionDialogType) ? sName :
parserHelp.get3DRef(this.model.getName(), sName);
};
......@@ -10205,16 +10205,30 @@
ascRange = new asc_Range(c1, r1, c2, r2 );
/*TODO: сделать поиск по названиям автофигур, должен искать до того как вызвать поиск по именованным диапазонам*/
var defName = new Asc.asc_CDefName( reference, this.model.getName()+"!"+ascRange.getAbsName(), null ),
_C2H50H_ = this.model.workbook.editDefinesNames( null, defName ), sheetName = "", ref = "";
_C2H50H_, sheetName = "", ref = "";
_C2H50H_ = this.model.workbook.getDefinesNames( reference, this.model.workbook.getActiveWs().getId() );
if( !_C2H50H_ ){
_C2H50H_ = this.model.workbook.editDefinesNames( null, defName );
}
if(_C2H50H_){
sheetName = _C2H50H_.Ref.split("!");
ref = sheetName[1];
sheetName = sheetName[0];
range = {range:asc.g_oRangeCache.getAscRange(ref), sheet:sheetName};
if( sheetName[0] == "'" && sheetName[sheetName.length-1] == "'" ){
range.sheet = range.sheet.substring(1,range.sheet.length-1);
}
this.model.workbook.handlers.trigger("asc_onDefName", defName);
}
}
else{
range = {range:range, sheet:this.model.getName()};
}
return range;// ? this.setSelection(range, true) : null;
};
......
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