|
|
|
@@ -12,8 +12,9 @@ Type xlsxHyperLink = Class
|
|
|
|
|
return new xlsxHyperLink(sheetname, file, xmlFile);
|
|
|
|
|
End;
|
|
|
|
|
|
|
|
|
|
Function SetCellHyperLink(axis, hyperlink);
|
|
|
|
|
Function SetCellHyperLink(axis, link);
|
|
|
|
|
Begin
|
|
|
|
|
hyperlink := link;
|
|
|
|
|
work_node := xmlFile_.FirstChildElement('worksheet');
|
|
|
|
|
hyperlinks := work_node.FirstChildElement('hyperlinks');
|
|
|
|
|
if not ifObj(hyperlinks) then begin
|
|
|
|
@@ -32,22 +33,23 @@ Type xlsxHyperLink = Class
|
|
|
|
|
hyperlink.Axis := axis;
|
|
|
|
|
if hyperlink.LinkType = "location" then
|
|
|
|
|
begin
|
|
|
|
|
hyperlink.LinkType := nil;
|
|
|
|
|
hyperlink.Location := hyperlink.LinkUrl;
|
|
|
|
|
hyperlink.LinkUrl := nil;
|
|
|
|
|
end
|
|
|
|
|
else if hyperlink.LinkType = 'external' then
|
|
|
|
|
begin
|
|
|
|
|
[rid, commentFileName, sheetFileName, relsfile] := file_.WorkBook().GetRelationshipRid(sheetName_, hyperlink.LinkUrl);
|
|
|
|
|
if commentFileName = "" then
|
|
|
|
|
relsfile := file_.WorkBook().GetSheetRelsFile(sheetName_);
|
|
|
|
|
[id, target, rid] := class(TSXml).FindRelationshipRid(relsfile, hyperlink.LinkUrl);
|
|
|
|
|
if target = "" then
|
|
|
|
|
Begin
|
|
|
|
|
rid++;
|
|
|
|
|
ridstr := 'rId' + inttostr(rid);
|
|
|
|
|
xmlfile := file_.WorkBook().GetXmlFileObj(relsfile);
|
|
|
|
|
class(TSXml).AddRelationshipRid(xmlfile, hyperlink.LinkUrl, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", ridstr, "External");
|
|
|
|
|
id++;
|
|
|
|
|
ridstr := 'rId' + inttostr(id);
|
|
|
|
|
class(TSXml).AddRelationshipRid(relsfile, hyperlink.LinkUrl, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", ridstr, "External");
|
|
|
|
|
hyperlink.Rid := ridstr;
|
|
|
|
|
End
|
|
|
|
|
hyperlink.RId := 'rId' + inttostr(rid);
|
|
|
|
|
else hyperlink.Rid := 'rId' + inttostr(rid);
|
|
|
|
|
end
|
|
|
|
|
hyperlink.LinkType := nil;
|
|
|
|
|
hyperlink.LinkUrl := nil;
|
|
|
|
|
if not ifObj(hyperlink_node) then
|
|
|
|
|
begin
|
|
|
|
|
hyperlinks.InsertEndChild(hyperlink.marshal());
|
|
|
|
|