Commit 362f8bad authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

Bug 15415 - HyperLink: Подхватывать ссылки при вводе в рабочую область.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48545 954022d7-b5bf-4e40-9824-e11837661b57
parent 43d8b8ca
......@@ -7171,6 +7171,20 @@ Range.prototype.getHyperlinks=function(){
Range.prototype.setHyperlink=function(val, bWithoutStyle){
if(null != val && false == val.isValid())
return;
//проверяем, может эта ссылка уже существует
var aHyperlinks = this.getHyperlinks();
var bExist = false;
for(var i = 0, length = aHyperlinks.length; i < length; ++i)
{
var elem = aHyperlinks[i];
if(elem.hyperlink.isEqual(val))
{
bExist = true;
break;
}
}
if(bExist)
return;
History.Create_NewPoint();
var oBBox = this.bbox;
History.SetSelection(new Asc.Range(oBBox.c1, oBBox.r1, oBBox.c2, oBBox.r2));
......
......@@ -1495,7 +1495,7 @@ StyleManager.prototype =
if(null != xfs && null != xfs.font)
oRes.oldVal = xfs.font;
else
oRes.oldVal = g_oDefaultFont;
oRes.oldVal = null;
if(null == val)
{
if(null != xfs)
......@@ -3089,6 +3089,16 @@ CCellValue.prototype =
}
}
}
if(0 == val.indexOf("http://") || 0 == val.indexOf("https://") || (0 == val.indexOf("www.") && val.length > 4))
{
var sRealUrl = val;
if(0 != val.indexOf("http://") && 0 != val.indexOf("https://"))
sRealUrl = "http://" + sRealUrl;
var oNewHyperlink = new Hyperlink();
oNewHyperlink.Ref = this.cell.ws.getCell3(this.cell.oId.getRow0(), this.cell.oId.getCol0());
oNewHyperlink.Hyperlink = sRealUrl;
oNewHyperlink.Ref.setHyperlink(oNewHyperlink);
}
},
setValue2 : function(aVal)
{
......@@ -3096,7 +3106,7 @@ CCellValue.prototype =
for(var i = 0, length = aVal.length; i < length; ++i)
sSimpleText += aVal[i].text;
this.setValue(sSimpleText);
if(CellValueType.String == this.type)
if(CellValueType.String == this.type && 0 == this.cell.getHyperlinks().length)
{
this.clean();
this.type = CellValueType.String;
......
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