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

fix: Bug 30475 - [NamedRanges] Ошибка в консоли при подключении второго...

fix: Bug 30475 - [NamedRanges] Ошибка в консоли при подключении второго пользователя к книге, использующей именованный диапазон на листе с умлаутами или иероглифами в имени (http://bugzserver/show_bug.cgi?id=30475)
Bug 30430 - [NamedRanges] Выделение с объединенной ячейки сбрасывается при вводе имени диапазона в адресную строку (http://bugzserver/show_bug.cgi?id=30430)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64980 954022d7-b5bf-4e40-9824-e11837661b57
parent ca6135a3
...@@ -2889,7 +2889,7 @@ UndoRedoWorkbook.prototype = { ...@@ -2889,7 +2889,7 @@ UndoRedoWorkbook.prototype = {
* */ * */
} }
else if(historyitem_Workbook_DefinedNamesChange === Type ){ else if(historyitem_Workbook_DefinedNamesChange === Type ){
var oldName, newName, res; var oldName, newName;
if(bUndo){ if(bUndo){
oldName = Data.newName; oldName = Data.newName;
newName= Data.oldName; newName= Data.oldName;
...@@ -2907,7 +2907,7 @@ UndoRedoWorkbook.prototype = { ...@@ -2907,7 +2907,7 @@ UndoRedoWorkbook.prototype = {
oldName = Data.oldName; oldName = Data.oldName;
newName = Data.newName; newName = Data.newName;
} }
res = this.wb.editDefinesNames( oldName, newName, true ); this.wb.editDefinesNames( oldName, newName, true );
this.wb.handlers.trigger("asc_onEditDefName", oldName, newName); this.wb.handlers.trigger("asc_onEditDefName", oldName, newName);
} }
else if(historyitem_Workbook_DefinedNamesDelete === Type ){ else if(historyitem_Workbook_DefinedNamesDelete === Type ){
...@@ -3473,6 +3473,14 @@ UndoRedoWoorksheet.prototype = { ...@@ -3473,6 +3473,14 @@ UndoRedoWoorksheet.prototype = {
if(null != oConflictWs) if(null != oConflictWs)
oConflictWs.renameWsToCollaborate(this.wb.getUniqueSheetNameFrom(oConflictWs.getName(), true)); oConflictWs.renameWsToCollaborate(this.wb.getUniqueSheetNameFrom(oConflictWs.getName(), true));
} }
var dN;
for(var id in arrDefNameRecalc ){
dN = arrDefNameRecalc[id];
if( !dN.parsedRef ){
dN.parsedRef = new parserFormula(dN.Ref, "", ws.workbook.getWorksheet(0));
dN.parsedRef.parse();
}
}
} }
ws.setName(name, true); ws.setName(name, true);
} }
......
...@@ -1030,7 +1030,7 @@ DependencyGraph.prototype = { ...@@ -1030,7 +1030,7 @@ DependencyGraph.prototype = {
oldS[id].Ref = oldS[id].Ref.replace(oName,nName); oldS[id].Ref = oldS[id].Ref.replace(oName,nName);
} }
else{ else{
oldS[id].relinkRef(); oldS[id].relinkRef(oName, nName);
} }
} }
...@@ -1613,7 +1613,7 @@ DefNameVertex.prototype = { ...@@ -1613,7 +1613,7 @@ DefNameVertex.prototype = {
this.nodeId = getDefNameVertexId( this.sheetId, newName.Name ); this.nodeId = getDefNameVertexId( this.sheetId, newName.Name );
}, },
relinkRef:function(){ relinkRef:function(oName, nName){
if( this.parsedRef.isParsed ){ if( this.parsedRef.isParsed ){
this.Ref = this.parsedRef.assemble(); this.Ref = this.parsedRef.assemble();
} }
...@@ -2602,9 +2602,9 @@ Workbook.prototype.editDefinesNames = function ( oldName, newName, bUndo ) { ...@@ -2602,9 +2602,9 @@ Workbook.prototype.editDefinesNames = function ( oldName, newName, bUndo ) {
} }
} }
} }
if(retRes){ /*if(retRes){
retRes = retRes.getAscCDefName(); retRes = retRes.getAscCDefName();
} }*/
} }
if(!bUndo) if(!bUndo)
buildRecalc(this); buildRecalc(this);
......
...@@ -1958,7 +1958,8 @@ ...@@ -1958,7 +1958,8 @@
WorkbookView.prototype.setDefinedNames = function (defName) { WorkbookView.prototype.setDefinedNames = function (defName) {
//ToDo проверка defName.ref на знак "=" в начале ссылки. знака нет тогда это либо число либо строка, так делает Excel. //ToDo проверка defName.ref на знак "=" в начале ссылки. знака нет тогда это либо число либо строка, так делает Excel.
this.handlers.trigger("asc_onDefName", this.model.setDefinesNames(defName.Name,defName.Ref,defName.Scope )); this.model.setDefinesNames(defName.Name,defName.Ref,defName.Scope);
this.handlers.trigger("asc_onDefName");
}; };
...@@ -1998,7 +1999,8 @@ ...@@ -1998,7 +1999,8 @@
} }
else{ else{
this.handlers.trigger("asc_onDefName", this.model.editDefinesNames(oldName, newName)); this.model.editDefinesNames(oldName, newName);
this.handlers.trigger("asc_onDefName");
this.handlers.trigger("asc_onRefreshDefNameList"); this.handlers.trigger("asc_onRefreshDefNameList");
this.handlers.trigger("asc_onLockDefNameManager",c_oAscDefinedNameReason.LockDefNameManager); this.handlers.trigger("asc_onLockDefNameManager",c_oAscDefinedNameReason.LockDefNameManager);
selectNameChange(); selectNameChange();
......
...@@ -10065,18 +10065,27 @@ ...@@ -10065,18 +10065,27 @@
_C2H50H_ = this.model.workbook.getDefinesNames( reference, this.model.workbook.getActiveWs().getId() ); _C2H50H_ = this.model.workbook.getDefinesNames( reference, this.model.workbook.getActiveWs().getId() );
if( !_C2H50H_ ){ if( !_C2H50H_ ){
if (this.collaborativeEditing.getGlobalLock()){
this.handlers.trigger("asc_onError",c_oAscError.ID.LockCreateDefName,c_oAscError.Level.NoCritical);
var ar_norm = ascRange.normalize(),
mc = this.model.getMergedByCell(ar_norm.r1, ar_norm.c1);
return {range:mc?mc:range, sheet:this.model.getName()};
}
_C2H50H_ = this.model.workbook.editDefinesNames( null, defName ); _C2H50H_ = this.model.workbook.editDefinesNames( null, defName );
} }
if(_C2H50H_){ if(_C2H50H_){
_C2H50H_ = this.model.workbook.getDefinesNames( reference, this.model.workbook.getActiveWs().getId() );
sheetName = _C2H50H_.Ref.split("!"); sheetName = _C2H50H_.Ref.split("!");
ref = sheetName[1]; ref = sheetName[1];
sheetName = sheetName[0]; sheetName = sheetName[0];
if(_C2H50H_.isTable || (_C2H50H_.parsedRef.RefPos.length == 1 && _C2H50H_.parsedRef.outStack.length == 1) ){ if(_C2H50H_.isTable || (_C2H50H_.parsedRef.RefPos.length == 1 && _C2H50H_.parsedRef.outStack.length == 1) ){
range = {range:asc.g_oRangeCache.getAscRange(ref), sheet:sheetName}; range = asc.g_oRangeCache.getAscRange(ref);
ar_norm = range.normalize();
mc = this.model.getMergedByCell(ar_norm.r1, ar_norm.c1);
range = {range:mc?mc:range, sheet:sheetName};
if( sheetName[0] == "'" && sheetName[sheetName.length-1] == "'" ){ if( sheetName[0] == "'" && sheetName[sheetName.length-1] == "'" ){
range.sheet = range.sheet.substring(1,range.sheet.length-1); range.sheet = range.sheet.substring(1,range.sheet.length-1);
} }
...@@ -10087,7 +10096,10 @@ ...@@ -10087,7 +10096,10 @@
} }
} }
else{ else{
range = {range:range, sheet:this.model.getName()}; var ar_norm = range.normalize(),
mc = this.model.getMergedByCell(ar_norm.r1, ar_norm.c1);
range = {range:mc?mc:range, sheet:this.model.getName()};
} }
return range;// ? this.setSelection(range, true) : null; 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