TOC Links creation improved

This commit is contained in:
Georgy Litvinov 2020-06-27 13:21:30 +02:00
parent e2d0bd1bb6
commit 05020edb1d
5 changed files with 37 additions and 15 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Archive" script:language="StarBasic" script:moduleType="normal">Sub archMark15
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Archive" script:language="StarBasic" script:moduleType="normal">Sub archMark17
End Sub
@ -83,18 +83,22 @@ Sub createLink(targetRange as Object,linkName as String,linkURL as String)
dispatcher = createUnoService(&quot;com.sun.star.frame.DispatchHelper&quot;)
oViewCursor = ThisComponent.CurrentController.getViewCursor()
oViewCursor.gotoRange(targetRange,false)
dim args2(4) as new com.sun.star.beans.PropertyValue
args2(0).Name = &quot;Hyperlink.Text&quot;
args2(0).Value = linkName
args2(1).Name = &quot;Hyperlink.URL&quot;
args2(1).Value = &quot;#&quot;+linkURL
args2(2).Name = &quot;Hyperlink.Target&quot;
args2(2).Value = &quot;&quot;
args2(3).Name = &quot;Hyperlink.Name&quot;
args2(3).Value = linkName
args2(4).Name = &quot;Hyperlink.Type&quot;
args2(4).Value = 1
dispatcher.executeDispatch(document, &quot;.uno:SetHyperlink&quot;, &quot;&quot;, 0, args2())
&apos;Globalscope.BasicLibraries.LoadLibrary( &quot;MRILib&quot; )
&apos;Mri oViewCursor
oViewCursor.HyperlinkURL = &quot;#&quot; &amp; linkURL
oViewCursor.HyperLinkName = linkName
&apos;dim args2(4) as new com.sun.star.beans.PropertyValue
&apos;args2(0).Name = &quot;Hyperlink.Text&quot;
&apos;args2(0).Value = linkName
&apos;args2(1).Name = &quot;Hyperlink.URL&quot;
&apos;args2(1).Value = &quot;#&quot;+linkURL
&apos;args2(2).Name = &quot;Hyperlink.Target&quot;
&apos;args2(2).Value = &quot;&quot;
&apos;args2(3).Name = &quot;Hyperlink.Name&quot;
&apos;args2(3).Value = linkName
&apos;args2(4).Name = &quot;Hyperlink.Type&quot;
&apos;args2(4).Value = 1
&apos;dispatcher.executeDispatch(document, &quot;.uno:SetHyperlink&quot;, &quot;&quot;, 0, args2())
End Sub
Function RND_String