Commit b47badd5 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

fix bug #28881

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64860 954022d7-b5bf-4e40-9824-e11837661b57
parent 8dd10faf
......@@ -3243,15 +3243,22 @@ CCellValue.prototype =
}
}
}
if((0 == val.indexOf("http://") || 0 == val.indexOf("https://") || (0 == val.indexOf("www.") && val.length > 4)) && -1 == val.indexOf("\n"))
{
var sRealUrl = val;
if(0 != val.indexOf("http://") && 0 != val.indexOf("https://"))
if (0 == val.indexOf("http://") || 0 == val.indexOf("https://") || (0 == val.indexOf("www.") && val.length > 4)) {
// Удаляем концевые пробелы и
var endIndex = val.length - 1;
while (0 < endIndex && ('\n' === val[endIndex] || ' ' === val[endIndex])) {
--endIndex;
}
var sRealUrl = val.slice(0, endIndex);
if (-1 === sRealUrl.indexOf('\n')) {
if (0 != val.indexOf("http://") && 0 != val.indexOf("https://")) {
sRealUrl = "http://" + sRealUrl;
}
var oNewHyperlink = new Hyperlink();
oNewHyperlink.Ref = cell.ws.getCell3(cell.nRow, cell.nCol);
oNewHyperlink.Hyperlink = encodeURI(sRealUrl);
oNewHyperlink.Ref.setHyperlink(oNewHyperlink);
}
}
},
setValue2 : function(cell, aVal)
......
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