Commit b48dbad6 authored by konovalovsergey's avatar konovalovsergey

capitalization independent defname check while modify

parent 935a5375
...@@ -1557,6 +1557,13 @@ cName.prototype.Calculate = function () { ...@@ -1557,6 +1557,13 @@ cName.prototype.Calculate = function () {
cName.prototype.getDefName = function () { cName.prototype.getDefName = function () {
return this.wb.getDefinesNames( this.value, this.ws ? this.ws.getId() : null ); return this.wb.getDefinesNames( this.value, this.ws ? this.ws.getId() : null );
}; };
cName.prototype.changeDefName = function (from, to) {
var LocalSheetId = this.ws ? this.ws.getIndex() : null;
if (AscCommonExcel.getDefNameIndex(this.value) == AscCommonExcel.getDefNameIndex(from.Name) &&
(null == from.LocalSheetId || LocalSheetId == from.LocalSheetId )) {
this.value = to.Name;
}
};
/** @constructor */ /** @constructor */
function cStrucTable( val, wb, ws ) { function cStrucTable( val, wb, ws ) {
...@@ -4730,10 +4737,7 @@ parserFormula.prototype.calculate = function(opt_defName, opt_range) { ...@@ -4730,10 +4737,7 @@ parserFormula.prototype.calculate = function(opt_defName, opt_range) {
for (i = 0; i < this.outStack.length; i++) { for (i = 0; i < this.outStack.length; i++) {
elem = this.outStack[i]; elem = this.outStack[i];
if (elem.type == cElementType.name || elem.type == cElementType.name3D) { if (elem.type == cElementType.name || elem.type == cElementType.name3D) {
LocalSheetId = elem.ws ? elem.ws.getIndex() : null; elem.changeDefName(from, to);
if (elem.value == from.Name && (null == from.LocalSheetId || LocalSheetId == from.LocalSheetId )) {
elem.value = to.Name;
}
} else if (elem.type == cElementType.table) { } else if (elem.type == cElementType.table) {
LocalSheetId = elem.ws ? elem.ws.getIndex() : null; LocalSheetId = elem.ws ? elem.ws.getIndex() : null;
if (elem.tableName == from.Name && (null == from.LocalSheetId || LocalSheetId == from.LocalSheetId )) { if (elem.tableName == from.Name && (null == from.LocalSheetId || LocalSheetId == from.LocalSheetId )) {
......
...@@ -59,7 +59,6 @@ var UndoRedoData_IndexSimpleProp = AscCommonExcel.UndoRedoData_IndexSimpleProp; ...@@ -59,7 +59,6 @@ var UndoRedoData_IndexSimpleProp = AscCommonExcel.UndoRedoData_IndexSimpleProp;
var UndoRedoData_BBox = AscCommonExcel.UndoRedoData_BBox; var UndoRedoData_BBox = AscCommonExcel.UndoRedoData_BBox;
var UndoRedoData_SheetAdd = AscCommonExcel.UndoRedoData_SheetAdd; var UndoRedoData_SheetAdd = AscCommonExcel.UndoRedoData_SheetAdd;
var UndoRedoData_SheetPositions = AscCommonExcel.UndoRedoData_SheetPositions; var UndoRedoData_SheetPositions = AscCommonExcel.UndoRedoData_SheetPositions;
var UndoRedoData_DefinedNames = AscCommonExcel.UndoRedoData_DefinedNames;
var UndoRedoData_DefinedNamesChange = AscCommonExcel.UndoRedoData_DefinedNamesChange; var UndoRedoData_DefinedNamesChange = AscCommonExcel.UndoRedoData_DefinedNamesChange;
var g_oDefaultFormat = AscCommonExcel.g_oDefaultFormat; var g_oDefaultFormat = AscCommonExcel.g_oDefaultFormat;
var Border = AscCommonExcel.Border; var Border = AscCommonExcel.Border;
...@@ -67,8 +66,6 @@ var RangeDataManagerElem = AscCommonExcel.RangeDataManagerElem; ...@@ -67,8 +66,6 @@ var RangeDataManagerElem = AscCommonExcel.RangeDataManagerElem;
var RangeDataManager = AscCommonExcel.RangeDataManager; var RangeDataManager = AscCommonExcel.RangeDataManager;
var cElementType = AscCommonExcel.cElementType; var cElementType = AscCommonExcel.cElementType;
var cArea3D = AscCommonExcel.cArea3D;
var cRef3D = AscCommonExcel.cRef3D;
var parserFormula = AscCommonExcel.parserFormula; var parserFormula = AscCommonExcel.parserFormula;
...@@ -90,7 +87,6 @@ var g_nAllColIndex = -1; ...@@ -90,7 +87,6 @@ var g_nAllColIndex = -1;
var g_nAllRowIndex = -1; var g_nAllRowIndex = -1;
var aStandartNumFormats = []; var aStandartNumFormats = [];
var aStandartNumFormatsId = {}; var aStandartNumFormatsId = {};
var arrRecalc = {}, arrDefNameRecalc = {};
var oFormulaLocaleInfo = { var oFormulaLocaleInfo = {
Parse: true, Parse: true,
DigitSep: true DigitSep: true
...@@ -152,7 +148,7 @@ function getRangeType(oBBox){ ...@@ -152,7 +148,7 @@ function getRangeType(oBBox){
} }
function getDefNameIndex(name) { function getDefNameIndex(name) {
//можно создавать имена в разном регистре, но уникальность проверяется независимо от регистра //uniqueness is checked without capitalization
return name ? name.toLowerCase() : name; return name ? name.toLowerCase() : name;
} }
...@@ -1250,10 +1246,6 @@ function getRangeType(oBBox){ ...@@ -1250,10 +1246,6 @@ function getRangeType(oBBox){
} }
}; };
function getVertexId(sheetId, cellId){
return sheetId + AscCommon.g_cCharDelimiter + cellId;
}
function angleFormatToInterface(val) function angleFormatToInterface(val)
{ {
var nRes = 0; var nRes = 0;
...@@ -8929,7 +8921,7 @@ DrawingObjectsManager.prototype.rebuildCharts = function(data) ...@@ -8929,7 +8921,7 @@ DrawingObjectsManager.prototype.rebuildCharts = function(data)
window['AscCommonExcel'].aStandartNumFormats = aStandartNumFormats; window['AscCommonExcel'].aStandartNumFormats = aStandartNumFormats;
window['AscCommonExcel'].aStandartNumFormatsId = aStandartNumFormatsId; window['AscCommonExcel'].aStandartNumFormatsId = aStandartNumFormatsId;
window['AscCommonExcel'].oFormulaLocaleInfo = oFormulaLocaleInfo; window['AscCommonExcel'].oFormulaLocaleInfo = oFormulaLocaleInfo;
window['AscCommonExcel'].getVertexId = getVertexId; window['AscCommonExcel'].getDefNameIndex = getDefNameIndex;
window['AscCommonExcel'].angleFormatToInterface2 = angleFormatToInterface2; window['AscCommonExcel'].angleFormatToInterface2 = angleFormatToInterface2;
window['AscCommonExcel'].angleInterfaceToFormat = angleInterfaceToFormat; window['AscCommonExcel'].angleInterfaceToFormat = angleInterfaceToFormat;
window['AscCommonExcel'].Workbook = Workbook; window['AscCommonExcel'].Workbook = Workbook;
......
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