Commit 495f259a authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

Range.prototype._getHyperlinks учитываются скрытые строки.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49812 954022d7-b5bf-4e40-9824-e11837661b57
parent fc54ddff
...@@ -7100,7 +7100,7 @@ Range.prototype.unmerge=function(bOnlyInRange){ ...@@ -7100,7 +7100,7 @@ Range.prototype.unmerge=function(bOnlyInRange){
} }
} }
}; };
Range.prototype._getHyperlinks=function(bStopOnFirst){ Range.prototype._getHyperlinks=function(bStopOnFirst, bAvoidHiddenRow){
var nRangeType = this._getRangeType(); var nRangeType = this._getRangeType();
var result = []; var result = [];
var oAllCol = this.worksheet.oAllCol; var oAllCol = this.worksheet.oAllCol;
...@@ -7125,49 +7125,60 @@ Range.prototype._getHyperlinks=function(bStopOnFirst){ ...@@ -7125,49 +7125,60 @@ Range.prototype._getHyperlinks=function(bStopOnFirst){
oRow[nCol] = hyperlink; oRow[nCol] = hyperlink;
}; };
var oProcessedMerged = new Object(); var oProcessedMerged = new Object();
this._foreachIndex(function(nRow, nCol){ var oBBox = this.bbox;
var cell = oThis.worksheet._getCellNoEmpty(nRow, nCol); for(var nRow = oBBox.r1; nRow <= oBBox.r2; nRow++){
if(null != cell && cell.hyperlinks.length > 0) var row = this.worksheet._getRowNoEmpty(nRow);
if(null != row)
{ {
var oCurHyperlink = cell.hyperlinks[cell.hyperlinks.length - 1]; if(true == row.hd && bAvoidHiddenRow)
if(bStopOnFirst) continue;
{ for(var nCol = oBBox.c1; nCol <= oBBox.c2; nCol++){
result.push({hyperlink: oCurHyperlink, col: nCol, row: nRow}); var cell = oThis.worksheet._getCellNoEmpty(nRow, nCol);
return; if(null != cell && cell.hyperlinks.length > 0)
}
else
{
fAddToTemp(oTempRows, oCurHyperlink, nRow, nCol);
//расширяем гиперссылки в замерженых ячейках
if(null != cell.merged)
{ {
var sId = cell.merged.getName(); var oCurHyperlink = cell.hyperlinks[cell.hyperlinks.length - 1];
if(null == oProcessedMerged[sId]) if(bStopOnFirst)
{
result.push({hyperlink: oCurHyperlink, col: nCol, row: nRow});
break;
}
else
{ {
var intersect = oThis.intersect(cell.merged); fAddToTemp(oTempRows, oCurHyperlink, nRow, nCol);
if(null != intersect) //расширяем гиперссылки в замерженых ячейках
if(null != cell.merged)
{ {
intersect._foreach(function(cell, nRow, nCol, nRowStart, nColStart){ var sId = cell.merged.getName();
fAddToTemp(oTempRows, oCurHyperlink, nRow, nCol); if(null == oProcessedMerged[sId])
}); {
var intersect = oThis.intersect(cell.merged);
if(null != intersect)
{
intersect._foreach(function(cell, nRow, nCol, nRowStart, nColStart){
fAddToTemp(oTempRows, oCurHyperlink, nRow, nCol);
});
}
oProcessedMerged[sId] = cell.merged;
}
} }
oProcessedMerged[sId] = cell.merged;
} }
} }
else
{
var row = aRows[nRow];
var col = aCols[nCol];
if(null != row && row.hyperlinks.lengh > 0)
fAddToTemp(oTempRows, row.hyperlinks[row.hyperlinks.length - 1], nRow, nCol);
if(null != col && col.hyperlinks.length > 0)
fAddToTemp(oTempRows, col.hyperlinks[col.hyperlinks.length - 1], nRow, nCol);
else if(null != oAllCol && oAllCol.hyperlinks.length > 0)
fAddToTemp(oTempRows, oAllCol.hyperlinks[oAllCol.hyperlinks.length - 1], nRow, nCol);
}
} }
if(bStopOnFirst && result.length > 0)
break;
} }
else }
{
var row = aRows[nRow];
var col = aCols[nCol];
if(null != row && row.hyperlinks.lengh > 0)
fAddToTemp(oTempRows, row.hyperlinks[row.hyperlinks.length - 1], nRow, nCol);
if(null != col && col.hyperlinks.length > 0)
fAddToTemp(oTempRows, col.hyperlinks[col.hyperlinks.length - 1], nRow, nCol);
else if(null != oAllCol && oAllCol.hyperlinks.length > 0)
fAddToTemp(oTempRows, oAllCol.hyperlinks[oAllCol.hyperlinks.length - 1], nRow, nCol);
}
});
//формируем результат //формируем результат
for(var i in oTempRows) for(var i in oTempRows)
{ {
...@@ -7184,13 +7195,13 @@ Range.prototype._getHyperlinks=function(bStopOnFirst){ ...@@ -7184,13 +7195,13 @@ Range.prototype._getHyperlinks=function(bStopOnFirst){
return result; return result;
} }
Range.prototype.getHyperlink=function(){ Range.prototype.getHyperlink=function(){
var aHyperlinks = this._getHyperlinks(true); var aHyperlinks = this._getHyperlinks(true, false);
if(null != aHyperlinks && aHyperlinks.length > 0) if(null != aHyperlinks && aHyperlinks.length > 0)
return aHyperlinks[0].hyperlink; return aHyperlinks[0].hyperlink;
return null; return null;
}; };
Range.prototype.getHyperlinks=function(){ Range.prototype.getHyperlinks=function(){
return this._getHyperlinks(false); return this._getHyperlinks(false, true);
}; };
Range.prototype.setHyperlink=function(val, bWithoutStyle){ Range.prototype.setHyperlink=function(val, bWithoutStyle){
if(null != val && false == val.isValid()) if(null != val && false == val.isValid())
......
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