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 = {
* */
}
else if(historyitem_Workbook_DefinedNamesChange === Type ){
var oldName, newName, res;
var oldName, newName;
if(bUndo){
oldName = Data.newName;
newName= Data.oldName;
......@@ -2907,7 +2907,7 @@ UndoRedoWorkbook.prototype = {
oldName = Data.oldName;
newName = Data.newName;
}
res = this.wb.editDefinesNames( oldName, newName, true );
this.wb.editDefinesNames( oldName, newName, true );
this.wb.handlers.trigger("asc_onEditDefName", oldName, newName);
}
else if(historyitem_Workbook_DefinedNamesDelete === Type ){
......@@ -3473,6 +3473,14 @@ UndoRedoWoorksheet.prototype = {
if(null != oConflictWs)
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);
}
......
......@@ -1030,7 +1030,7 @@ DependencyGraph.prototype = {
oldS[id].Ref = oldS[id].Ref.replace(oName,nName);
}
else{
oldS[id].relinkRef();
oldS[id].relinkRef(oName, nName);
}
}
......@@ -1613,7 +1613,7 @@ DefNameVertex.prototype = {
this.nodeId = getDefNameVertexId( this.sheetId, newName.Name );
},
relinkRef:function(){
relinkRef:function(oName, nName){
if( this.parsedRef.isParsed ){
this.Ref = this.parsedRef.assemble();
}
......@@ -2602,9 +2602,9 @@ Workbook.prototype.editDefinesNames = function ( oldName, newName, bUndo ) {
}
}
}
if(retRes){
/*if(retRes){
retRes = retRes.getAscCDefName();
}
}*/
}
if(!bUndo)
buildRecalc(this);
......
......@@ -1958,7 +1958,8 @@
WorkbookView.prototype.setDefinedNames = function (defName) {
//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 @@
}
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_onLockDefNameManager",c_oAscDefinedNameReason.LockDefNameManager);
selectNameChange();
......
......@@ -10065,18 +10065,27 @@
_C2H50H_ = this.model.workbook.getDefinesNames( reference, this.model.workbook.getActiveWs().getId() );
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 );
}
if(_C2H50H_){
_C2H50H_ = this.model.workbook.getDefinesNames( reference, this.model.workbook.getActiveWs().getId() );
sheetName = _C2H50H_.Ref.split("!");
ref = sheetName[1];
sheetName = sheetName[0];
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] == "'" ){
range.sheet = range.sheet.substring(1,range.sheet.length-1);
}
......@@ -10087,7 +10096,10 @@
}
}
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;
};
......
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