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,16 +3243,23 @@ CCellValue.prototype = ...@@ -3243,16 +3243,23 @@ CCellValue.prototype =
} }
} }
} }
if((0 == val.indexOf("http://") || 0 == val.indexOf("https://") || (0 == val.indexOf("www.") && val.length > 4)) && -1 == val.indexOf("\n")) if (0 == val.indexOf("http://") || 0 == val.indexOf("https://") || (0 == val.indexOf("www.") && val.length > 4)) {
{ // Удаляем концевые пробелы и
var sRealUrl = val; var endIndex = val.length - 1;
if(0 != val.indexOf("http://") && 0 != val.indexOf("https://")) while (0 < endIndex && ('\n' === val[endIndex] || ' ' === val[endIndex])) {
sRealUrl = "http://" + sRealUrl; --endIndex;
var oNewHyperlink = new Hyperlink(); }
oNewHyperlink.Ref = cell.ws.getCell3(cell.nRow, cell.nCol); var sRealUrl = val.slice(0, endIndex);
oNewHyperlink.Hyperlink = encodeURI(sRealUrl); if (-1 === sRealUrl.indexOf('\n')) {
oNewHyperlink.Ref.setHyperlink(oNewHyperlink); 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) 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