This commit is contained in:
Eduard Belozertsev
2025-12-13 21:02:13 +07:00
parent 4081bcea82
commit ece57f33e4

View File

@ -7160,7 +7160,8 @@ background-repeat: no-repeat;\
}
else if (Url.indexOf('ppaction://hlinkfile') == 0)
{
this.sendEvent("asc_onHyperlinkClick", Url.replace("ppaction://hlinkfile?file=", "file://"));
const fileHyperlink = normalizeFileHyperlink(Url)
this.sendEvent("asc_onHyperlinkClick", fileHyperlink);
}
else
{
@ -7179,6 +7180,26 @@ background-repeat: no-repeat;\
this.sendEvent("asc_onHyperlinkClick", Url);
};
function normalizeFileHyperlink(url) {
if (!url) {
return url;
}
let result = url;
const actionPrefix = 'ppaction://hlinkfile?file=';
const filePrefix = 'file://';
if (result.indexOf(actionPrefix) === 0) {
result = result.substring(actionPrefix.length);
}
if (result.indexOf(filePrefix) !== 0) {
result = filePrefix + result;
}
return result;
}
asc_docs_api.prototype.asc_GoToInternalHyperlink = function(url)
{
for(var i = 0; i < this.SelectedObjectsStack.length; ++i){