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

чтение и запись аттрибута hidden в именованных диапазонах. (Bug 29984 -...

чтение и запись аттрибута hidden  в именованных диапазонах. (Bug 29984 - [NamedRanges] Различные ошибки в консоли при выборе диапазонов из списка или обращению к ним в XLSX файле)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64100 954022d7-b5bf-4e40-9824-e11837661b57
parent 279ef149
......@@ -245,18 +245,20 @@
prot["asc_getClearFilter"] = prot.asc_getClearFilter;//TODO DELETE
/** @constructor */
function asc_CDefName(n, r, s, t) {
function asc_CDefName(n, r, s, t, h) {
this.Name = n;
this.LocalSheetId = s;
this.Ref = r;
this.isTable = t;
this.Hidden = h;
}
asc_CDefName.prototype = {
asc_getName: function(){return this.Name;},
asc_getScope: function(){return this.LocalSheetId;},
asc_getRef: function(){return this.Ref;},
asc_getIsTable: function(){return this.isTable;}
asc_getIsTable: function(){return this.isTable;},
asc_getIsHidden: function(){return this.Hidden;}
};
window["Asc"].asc_CDefName = window["Asc"]["asc_CDefName"] = asc_CDefName;
......@@ -266,6 +268,7 @@
prot["asc_getScope"] = prot.asc_getScope;
prot["asc_getRef"] = prot.asc_getRef;
prot["asc_getIsTable"] = prot.asc_getIsTable;
prot["asc_getIsHidden"] = prot.asc_getIsHidden;
}
)(window);
\ No newline at end of file
......@@ -1340,7 +1340,7 @@ cName.prototype.addDefinedNameNode = function ( nameReParse ) {
var dN = this.wb.getDefinesNames( this.defName.Name, this.ws.getId() );
dN = dN.getAscCDefName();
var node = this.wb.dependencyFormulas.addDefinedNameNode( dN.Name, dN.LocalSheetId, dN.Ref ),
var node = this.wb.dependencyFormulas.addDefinedNameNode( dN.Name, dN.LocalSheetId, dN.Ref, dN.Hidden ),
wsR, ref, nTo;
for ( var i = 0; i < this.ref.outStack.length; i++ ) {
ref = this.ref.outStack[i];
......
......@@ -149,7 +149,8 @@
{
Name: 0,
Ref: 1,
LocalSheetId: 2
LocalSheetId: 2,
Hidden: 3
};
/** @enum */
var c_oSerWorksheetsTypes =
......@@ -2185,6 +2186,12 @@
if (null !== oDefinedName.LocalSheetId){
this.bs.WriteItem(c_oSerDefinedNameTypes.LocalSheetId, function(){oThis.memory.WriteLong(oDefinedName.LocalSheetId);});
}
if (null != oDefinedName.Hidden)
{
this.memory.WriteByte(c_oSerDefinedNameTypes.Hidden);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(oDefinedName.Hidden);
}
};
}
function BinaryWorksheetsTableWriter(memory, wb, oSharedStrings, aDxfs, aXfs, aFonts, aFills, aBorders, aNums, idWorksheet, isCopyPaste)
......@@ -5112,7 +5119,7 @@
if(null != oNewDefinedName.Name && null != oNewDefinedName.Ref)
{
this.oWorkbook.dependencyFormulas.addDefinedNameNode(oNewDefinedName.Name, oNewDefinedName.LocalSheetId, oNewDefinedName.Ref);
this.oWorkbook.dependencyFormulas.addDefinedNameNode(oNewDefinedName.Name, oNewDefinedName.LocalSheetId, oNewDefinedName.Ref, oNewDefinedName.Hidden);
}
}
......@@ -5129,6 +5136,8 @@
oDefinedName.Ref = this.stream.GetString2LE(length);
else if ( c_oSerDefinedNameTypes.LocalSheetId == type )
oDefinedName.LocalSheetId = this.stream.GetULongLE();
else if ( c_oSerDefinedNameTypes.Hidden == type )
oDefinedName.Hidden = this.stream.GetBool();
else
res = c_oSerConstants.ReadUnknown;
return res;
......
......@@ -872,7 +872,7 @@ DependencyGraph.prototype = {
return false;
},
addDefinedNameNode:function ( defName, sheetId, defRef, bUndo ) {
addDefinedNameNode:function ( defName, sheetId, defRef, defHidden, bUndo ) {
var ws = this.wb.getWorksheet( sheetId )
ws ? sheetId = ws.getId() : null;
......@@ -881,7 +881,7 @@ DependencyGraph.prototype = {
oRes = this.defNameList[nodeId], dfv, defNameSheetsList;
if ( null == oRes || ( null == oRes.Ref && null == defRef ) ) {
dfv = new DefNameVertex( sheetId, defName, defRef, this.wb );
dfv = new DefNameVertex( sheetId, defName, defRef, defHidden, this.wb );
oRes = (this.defNameList[dfv.nodeId] = dfv);
defNameSheetsList = this.defNameSheets[dfv.sheetId];
if ( defNameSheetsList == null ) {
......@@ -924,7 +924,9 @@ DependencyGraph.prototype = {
oRes.Ref = defRef;
}
oRes.parsedRef.buildDependencies(null,oRes);
if( !oRes.isTable ){
oRes.parsedRef.buildDependencies(null,oRes);
}
return oRes;
......@@ -1077,7 +1079,7 @@ DependencyGraph.prototype = {
addTableName:function ( sName, ws, Ref ) {
var refClone = Ref.clone(true);
refClone.r1++;
var dfv = new DefNameVertex( null, sName, parserHelp.get3DRef( ws.getName(), refClone.getAbsName() ), this.wb, true ),
var dfv = new DefNameVertex( null, sName, parserHelp.get3DRef( ws.getName(), refClone.getAbsName() ), null, this.wb, true ),
defNameSheetsList = this.defNameSheets[dfv.sheetId];
this.defNameList[dfv.nodeId] = dfv;
if ( defNameSheetsList == null ) {
......@@ -1363,7 +1365,7 @@ Vertex.prototype = {
};
function DefNameVertex( scope, defName, defRef, wb, isTable ) {
function DefNameVertex( scope, defName, defRef, defHidden, wb, isTable ) {
this.sheetId = scope === null || scope === undefined ? "WB" : scope;
......@@ -1371,6 +1373,7 @@ function DefNameVertex( scope, defName, defRef, wb, isTable ) {
this.cellId = defName.toLowerCase();
this.Ref = defRef;
this.Name = defName;
this.Hidden = defHidden;
this.isTable = isTable;
this.nodeId = getDefNameVertexId( this.sheetId, defName );
this.wb = wb;
......@@ -1410,7 +1413,7 @@ DefNameVertex.prototype = {
constructor:Vertex,
clone:function(){
return new DefNameVertex( this.sheetId, this.cellId, this.Ref , this.wb, this.isTable );
return new DefNameVertex( this.sheetId, this.cellId, this.Ref, this.Hidden, this.wb, this.isTable );
},
changeScope:function( newScope ){
......@@ -1609,7 +1612,7 @@ DefNameVertex.prototype = {
return new Asc.asc_CDefName( this.Name,
this.Ref,
this.sheetId == "WB" ? null : a ? a.getIndex() : null,
this.isTable );
this.isTable, this.Hidden );
},
changeDefName:function ( newName ) {
......@@ -2421,7 +2424,8 @@ Workbook.prototype.getDefinesNamesWB = function (defNameListId) {
var listDN = thas.dependencyFormulas.defNameSheets[id], name;
for ( var id in listDN ) {
name = listDN[id].getAscCDefName();
if ( name.Ref ) {
if ( name.Ref && !name.Hidden ) {
arr.push( name );
}
}
......@@ -2447,7 +2451,7 @@ Workbook.prototype.getDefinesNamesWB = function (defNameListId) {
default:
for ( var id in this.dependencyFormulas.defNameList ) {
name = this.dependencyFormulas.defNameList[id].getAscCDefName()
if ( name.Ref ) {
if ( name.Ref && !name.Hidden ) {
names.push( name );
}
}
......@@ -2518,7 +2522,7 @@ Workbook.prototype.editDefinesNames = function ( oldName, newName, bUndo ) {
rename = true;
}
else {
retRes = this.dependencyFormulas.addDefinedNameNode( newName.Name, newName.LocalSheetId, newName.Ref, bUndo );
retRes = this.dependencyFormulas.addDefinedNameNode( newName.Name, newName.LocalSheetId, newName.Ref, newName.Hidden, bUndo );
}
if ( retRes ) {
......@@ -9177,6 +9181,7 @@ function DefinedName(){
this.Name = null;
this.Ref = null;
this.LocalSheetId = null;
this.Hidden = null;
this.bTable = false;
}
......
......@@ -10320,19 +10320,19 @@
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);
if( _C2H50H_.parsedRef.RefPos.length == 1 ){
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);
}
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