Commit 9401d460 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

обработка для гиперссылок

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55760 954022d7-b5bf-4e40-9824-e11837661b57
parent 16a5136c
...@@ -3408,95 +3408,121 @@ ...@@ -3408,95 +3408,121 @@
{ {
case para_Run://*paraRun* case para_Run://*paraRun*
{ {
paraRunContent = content[n].Content; s = this._parseParaRun(content[n], oNewItem, paraPr, s, row, c1, text, formatText);
break;
cTextPr = content[n].Get_CompiledPr(); };
if(cTextPr && !(paraRunContent.length == 1 && paraRunContent[0] instanceof ParaEnd))//settings for text case para_Hyperlink://*link*
formatText = this._getPrParaRun(paraPr, cTextPr); {
else if(!formatText) oNewItem.hyperLink = content[n].Value;
formatText = this._getPrParaRun(paraPr, cTextPr); oNewItem.toolTip = content[n].ToolTip;
//проходимся по контенту paraRun for(var h = 0; h < content[n].Content.length; h++)
for(var pR = 0; pR < paraRunContent.length; pR++)
{ {
switch(content[n].Content[h].Type)
switch(paraRunContent[pR].Type)
{ {
case para_Text://*paraText* case para_Run://*paraRun*
{ {
text += paraRunContent[pR].Value; s = this._parseParaRun(content[n].Content[h], oNewItem, paraPr, s, row, c1, text, formatText);
break; break;
}; };
};
case para_Space://*paraSpace*
{
text += " ";
break;
};
case para_Tab://*paraEnd / paraTab*
{
//if(!oNewItem.length)
//{
fontFamily = paragraphFontFamily;
this.fontsNew[fontFamily] = 1;
oNewItem.push(formatText);
//}
if(text !== null)
oNewItem[oNewItem.length - 1].text = text;
cloneNewItem = this._getCloneNewItem(oNewItem);
//переходим в следующую ячейку
if(typeof aResult[row][s + c1] == "object")
aResult[row][s + c1][aResult[row][s + c1].length] = cloneNewItem;
else
{
aResult[row][s + c1] = [];
aResult[row][s + c1][0] = cloneNewItem;
}
text = "";
oNewItem = [];
s++;
break;
};
case para_End:
{
if(typeof aResult[row][s + c1] == "object")
aResult[row][s + c1][aResult[row][s + c1].length] = oNewItem;
else
{
aResult[row][s + c1] = [];
aResult[row][s + c1][0] = oNewItem;
}
};
}
}; };
break;
if(text != "") };
{ };
fontFamily = paragraphFontFamily; };
this.fontsNew[fontFamily] = 1; },
_parseParaRun: function(paraRun, oNewItem, paraPr, s, row, c1, text, formatText)
{
var paraRunContent = paraRun.Content;
var aResult = this.aResult;
var paragraphFontFamily = paraPr.TextPr.FontFamily.Name;
var cloneNewItem;
var cTextPr = paraRun.Get_CompiledPr();
if(cTextPr && !(paraRunContent.length == 1 && paraRunContent[0] instanceof ParaEnd))//settings for text
formatText = this._getPrParaRun(paraPr, cTextPr);
else if(!formatText)
formatText = this._getPrParaRun(paraPr, cTextPr);
//проходимся по контенту paraRun
for(var pR = 0; pR < paraRunContent.length; pR++)
{
switch(paraRunContent[pR].Type)
{
case para_Text://*paraText*
{
text += paraRunContent[pR].Value;
break;
};
case para_Space://*paraSpace*
{
text += " ";
break;
};
case para_Tab://*paraEnd / paraTab*
{
//if(!oNewItem.length)
//{
this.fontsNew[paragraphFontFamily] = 1;
oNewItem.push(formatText); oNewItem.push(formatText);
//}
if(text !== null) if(text !== null)
oNewItem[oNewItem.length - 1].text = text; oNewItem[oNewItem.length - 1].text = text;
cloneNewItem = this._getCloneNewItem(oNewItem); cloneNewItem = this._getCloneNewItem(oNewItem);
text = "";
};
//переходим в следующую ячейку
if(typeof aResult[row][s + c1] == "object")
aResult[row][s + c1][aResult[row][s + c1].length] = cloneNewItem;
else
{
aResult[row][s + c1] = [];
aResult[row][s + c1][0] = cloneNewItem;
}
text = "";
oNewItem = [];
s++;
break; break;
}; };
};
case para_End:
{
if(typeof aResult[row][s + c1] == "object")
aResult[row][s + c1][aResult[row][s + c1].length] = oNewItem;
else
{
aResult[row][s + c1] = [];
aResult[row][s + c1][0] = oNewItem;
}
};
}
};
if(text != "")
{
this.fontsNew[paragraphFontFamily] = 1;
oNewItem.push(formatText);
if(text !== null)
oNewItem[oNewItem.length - 1].text = text;
cloneNewItem = this._getCloneNewItem(oNewItem);
text = "";
}; };
return s;
}, },
_getAllNumberingText: function(Lvl, numberingText) _getAllNumberingText: function(Lvl, numberingText)
...@@ -3816,7 +3842,9 @@ ...@@ -3816,7 +3842,9 @@
result.borders = oNewItem.borders; result.borders = oNewItem.borders;
result.rowSpan = oNewItem.rowSpan; result.rowSpan = oNewItem.rowSpan;
result.colSpan = oNewItem.colSpan; result.colSpan = oNewItem.colSpan;
result.toolTip = result.toolTip;
result.bc = oNewItem.bc; result.bc = oNewItem.bc;
result.hyperLink = oNewItem.hyperLink;
return result; return result;
} }
......
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