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

@ -3,7 +3,7 @@
xmlns:dep="http://openoffice.org/extensions/description/2006" xmlns:dep="http://openoffice.org/extensions/description/2006"
xmlns:xlink="http://www.w3.org/1999/xlink"> xmlns:xlink="http://www.w3.org/1999/xlink">
<identifier value="pro.litvinovg.epublishing" /> <identifier value="pro.litvinovg.epublishing" />
<version value="0.6.9" /> <version value="0.6.10" />
<platform value="all" /> <platform value="all" />
<display-name> <display-name>
<name lang="ru">Инструменты для создания электронных изданий</name> <name lang="ru">Инструменты для создания электронных изданий</name>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> <!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 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;) dispatcher = createUnoService(&quot;com.sun.star.frame.DispatchHelper&quot;)
oViewCursor = ThisComponent.CurrentController.getViewCursor() oViewCursor = ThisComponent.CurrentController.getViewCursor()
oViewCursor.gotoRange(targetRange,false) oViewCursor.gotoRange(targetRange,false)
dim args2(4) as new com.sun.star.beans.PropertyValue &apos;Globalscope.BasicLibraries.LoadLibrary( &quot;MRILib&quot; )
args2(0).Name = &quot;Hyperlink.Text&quot; &apos;Mri oViewCursor
args2(0).Value = linkName oViewCursor.HyperlinkURL = &quot;#&quot; &amp; linkURL
args2(1).Name = &quot;Hyperlink.URL&quot; oViewCursor.HyperLinkName = linkName
args2(1).Value = &quot;#&quot;+linkURL &apos;dim args2(4) as new com.sun.star.beans.PropertyValue
args2(2).Name = &quot;Hyperlink.Target&quot; &apos;args2(0).Name = &quot;Hyperlink.Text&quot;
args2(2).Value = &quot;&quot; &apos;args2(0).Value = linkName
args2(3).Name = &quot;Hyperlink.Name&quot; &apos;args2(1).Name = &quot;Hyperlink.URL&quot;
args2(3).Value = linkName &apos;args2(1).Value = &quot;#&quot;+linkURL
args2(4).Name = &quot;Hyperlink.Type&quot; &apos;args2(2).Name = &quot;Hyperlink.Target&quot;
args2(4).Value = 1 &apos;args2(2).Value = &quot;&quot;
dispatcher.executeDispatch(document, &quot;.uno:SetHyperlink&quot;, &quot;&quot;, 0, args2()) &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 End Sub
Function RND_String Function RND_String

View file

@ -5,7 +5,7 @@
For i = 1 To 10 For i = 1 To 10
makeLinksWithLevel(i) makeLinksWithLevel(i)
Next i Next i
MsgBox (getTranslation(&quot;OutlineLinksFinished&quot;))
End Sub End Sub

View file

@ -249,6 +249,9 @@ Function getRussian(identifier As String) As String
Exit Function Exit Function
Case &quot;allPagesHaveUniqPageStyle&quot; Case &quot;allPagesHaveUniqPageStyle&quot;
getRussian = &quot;Каждой странице в документе назначен уникальный стиль&quot; getRussian = &quot;Каждой странице в документе назначен уникальный стиль&quot;
Exit Function
Case &quot;OutlineLinksFinished&quot;
getRussian = &quot;Создание ссылок в оглавлении завершено. Если этому сообщению предшествовали предупреждения об ошибках, то после исправления ошибок запустите создание ссылок заново.&quot;
Exit Function Exit Function
Case Else Case Else
getRussian = &quot;Перевод не найден&quot; getRussian = &quot;Перевод не найден&quot;
@ -479,6 +482,9 @@ Function getEnglish(identifier As String) As String
Exit Function Exit Function
Case &quot;allPagesHaveUniqPageStyle&quot; Case &quot;allPagesHaveUniqPageStyle&quot;
getEnglish = &quot;Every page in document now have unique page style&quot; getEnglish = &quot;Every page in document now have unique page style&quot;
Exit Function
Case &quot;OutlineLinksFinished&quot;
getEnglish = &quot;Creating links in the table of contents is complete. If this message was preceded by error warnings, then after correcting the errors, restart creating links in table of contents.&quot;
Exit Function Exit Function
Case Else Case Else
getEnglish = &quot;No translation&quot; getEnglish = &quot;No translation&quot;
@ -709,6 +715,9 @@ Function getFrench(identifier As String) As String
Case &quot;allPagesHaveUniqPageStyle&quot; Case &quot;allPagesHaveUniqPageStyle&quot;
getFrench = &quot;Un style unique est attribué à chaque page du document&quot; getFrench = &quot;Un style unique est attribué à chaque page du document&quot;
Exit Function Exit Function
Case &quot;OutlineLinksFinished&quot;
getFrench = &quot;La création de liens dans la table des matières est terminée. Si ce message a été précédé d&apos;avertissements d&apos;erreur, après avoir corrigé les erreurs, recommencez à créer des liens.&quot;
Exit Function
Case Else Case Else
getFrench = &quot;No translation&quot; getFrench = &quot;No translation&quot;
End Select End Select
@ -938,6 +947,9 @@ Function getCroatian(identifier As String) As String
Case &quot;allPagesHaveUniqPageStyle&quot; Case &quot;allPagesHaveUniqPageStyle&quot;
getCroatian = &quot;Svakoj stranici u dokumentu dodeljen je jedinstveni stil.&quot; getCroatian = &quot;Svakoj stranici u dokumentu dodeljen je jedinstveni stil.&quot;
Exit Function Exit Function
Case &quot;OutlineLinksFinished&quot;
getCroatian = &quot;Stvaranje veza u sadržaju je završeno. Ako su ovoj poruci prethodila upozorenja o pogrešci, počnite stvarati veze nakon ispravljanja pogrešaka.&quot;
Exit Function
Case Else Case Else
getCroatian = &quot;No translation&quot; getCroatian = &quot;No translation&quot;
End Select End Select
@ -1167,6 +1179,9 @@ Function getSerbian(identifier As String) As String
Case &quot;allPagesHaveUniqPageStyle&quot; Case &quot;allPagesHaveUniqPageStyle&quot;
getSerbian = &quot;Свакој страници у документу додељен је јединствени стил.&quot; getSerbian = &quot;Свакој страници у документу додељен је јединствени стил.&quot;
Exit Function Exit Function
Case &quot;OutlineLinksFinished&quot;
getSerbian = &quot;Стварање веза у табели садржаја је завршено. Ако су овој поруци претходила упозорења о грешци, након исправљања грешака поново почните стварати везе.&quot;
Exit Function
Case Else Case Else
getSerbian = &quot;No translation&quot; getSerbian = &quot;No translation&quot;
End Select End Select
@ -1396,6 +1411,9 @@ Function getBosnian(identifier As String) As String
Case &quot;allPagesHaveUniqPageStyle&quot; Case &quot;allPagesHaveUniqPageStyle&quot;
getBosnian = &quot;Svakoj stranici u dokumentu dodeljen je jedinstveni stil.&quot; getBosnian = &quot;Svakoj stranici u dokumentu dodeljen je jedinstveni stil.&quot;
Exit Function Exit Function
Case &quot;OutlineLinksFinished&quot;
getBosnian = &quot;Stvaranje veza u sadržaju je završeno. Ako su ovoj poruci prethodila upozorenja o pogrešci, počnite stvarati veze nakon ispravljanja pogrešaka.&quot;
Exit Function
Case Else Case Else
getBosnian = &quot;No translation&quot; getBosnian = &quot;No translation&quot;
End Select End Select

Binary file not shown.