Improving footnote/endnote configuration in progress
This commit is contained in:
parent
8087152c4a
commit
90207f01d0
4 changed files with 184 additions and 23 deletions
|
@ -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="Footnotes" script:language="StarBasic" script:moduleType="normal">sub footMark1
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Footnotes" script:language="StarBasic" script:moduleType="normal">sub footMark2
|
||||
End Sub
|
||||
|
||||
Sub openFootNotesDialog
|
||||
|
@ -14,7 +14,17 @@ Sub openFootNotesDialog
|
|||
dialog.getControl("configText3").setText(getTranslation("configText3"))
|
||||
dialog.getControl("configText4").setText(getTranslation("configText4"))
|
||||
dialog.getControl("configText5").setText(getTranslation("configText5"))
|
||||
dialog.getControl("notesTypeLabel").setText(getTranslation("FootnotesConfigDialogNotesTypeLabel"))
|
||||
dialog.getControl("PerPageRangeLabel").setText(getTranslation("FootnotesConfigDialogNotesPerPageRangeLabel"))
|
||||
|
||||
dialog.getControl("groupByPages").Model.Label = getTranslation("FootnotesConfigDialogNotesPerPage")
|
||||
dialog.getControl("groupByHeadings").Model.Label = getTranslation("FootnotesConfigDialogNotesByHeadingsLabel")
|
||||
dialog.Title = getTranslation("footnotesConfigDialogTitle")
|
||||
Dim nCount As Integer
|
||||
nCount = dialog.getControl("lb_notes_types").getItemCount()
|
||||
dialog.getControl("lb_notes_types").addItem( getTranslation("FootnotesConfigDialogFootnotesName"), nCount )
|
||||
dialog.getControl("lb_notes_types").addItem( getTranslation("FootnotesConfigDialogEndnotesName"), nCount + 1 )
|
||||
dialog.getControl("lb_notes_types").selectItemPos( 0, True )
|
||||
dialog.setVisible(true)
|
||||
Select Case dialog.Execute()
|
||||
Case 1
|
||||
|
@ -27,22 +37,36 @@ End Sub
|
|||
Sub setFootnotesNumberingFrom(dialog)
|
||||
Dim statusIndicator as Object
|
||||
Dim targetLevel As Integer
|
||||
Dim stringLevelInput As String
|
||||
Dim stringPageRangeInput As String
|
||||
Dim noteType As Integer
|
||||
statusIndicator = ThisComponent.getCurrentController.statusIndicator
|
||||
dialog.setVisible(false)
|
||||
doNotTrack
|
||||
targetLevel = dialog.getControl("level").Value
|
||||
stringLevelInput = dialog.getControl("level").getText
|
||||
stringPageRangeInput = dialog.getControl("pageRange").getText
|
||||
noteType = dialog.getControl("lb_notes_types").getSelectedItemPos()
|
||||
If (stringLevelInput <> "") Then
|
||||
targetLevel = CInt(stringLevelInput)
|
||||
If targetLevel > -1 AND targetLevel < 11 Then
|
||||
statusIndicator.Start(getTranslation("statusNumberingInProcess"),100)
|
||||
setFootnotesNumberingLevel(targetLevel,noteType)
|
||||
Else
|
||||
MsgBox getTranslation("numberingInputOutOfRange")
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
If targetLevel > -1 AND targetLevel < 11 Then
|
||||
If (stringPageRangeInput <> "") Then
|
||||
|
||||
statusIndicator.Start(getTranslation("statusNumberingInProcess"),100)
|
||||
setFootnotesNumberingLevel(targetLevel)
|
||||
Else
|
||||
MsgBox getTranslation("numberingInputOutOfRange")
|
||||
setNotesPaginatedNumbering(noteType, pageArray)
|
||||
|
||||
EndIf
|
||||
|
||||
statusIndicator.end()
|
||||
End Sub
|
||||
|
||||
Sub setFootnotesNumberingLevel(level)
|
||||
Sub setFootnotesNumberingLevel(level As Integer,noteType As Integer)
|
||||
Dim enum1Element As Object
|
||||
Dim enum1 As Object
|
||||
Dim enum2 As Object
|
||||
|
@ -50,7 +74,7 @@ Sub setFootnotesNumberingLevel(level)
|
|||
Dim curNum As Integer
|
||||
Dim footnoteText As Object
|
||||
Dim label As String
|
||||
Dim labelNum As Integer
|
||||
Dim labelNum As Long
|
||||
Dim i As Integer
|
||||
Dim cell As Object
|
||||
Dim cellEnum As Object
|
||||
|
@ -72,7 +96,8 @@ Sub setFootnotesNumberingLevel(level)
|
|||
enum2 = enum1Element.createEnumeration
|
||||
While enum2.hasMoreElements
|
||||
thisPortion = enum2.nextElement
|
||||
If thisPortion.TextPortionType = "Footnote" Then
|
||||
If isTargetNote(thisPortion, noteType) Then
|
||||
|
||||
footnoteText = thisPortion.Footnote
|
||||
label = footnoteText.getLabel
|
||||
If label = "" Then
|
||||
|
@ -81,7 +106,7 @@ Sub setFootnotesNumberingLevel(level)
|
|||
curNum = curNum + 1
|
||||
EndIf
|
||||
Else
|
||||
labelNum = CInt(label)
|
||||
labelNum = CLng(label)
|
||||
If labelNum > 0 Then
|
||||
If level < 1 Then
|
||||
footnoteText.setLabel("")
|
||||
|
@ -107,7 +132,7 @@ Sub setFootnotesNumberingLevel(level)
|
|||
cellEnum2 = cellEnumElement.createEnumeration
|
||||
While cellEnum2.hasMoreElements
|
||||
thisPortion = cellEnum2.nextElement
|
||||
If thisPortion.TextPortionType = "Footnote" Then
|
||||
If isTargetNote(thisPortion, noteType) Then
|
||||
footnoteText = thisPortion.Footnote
|
||||
label = footnoteText.getLabel
|
||||
If label = "" Then
|
||||
|
@ -116,7 +141,7 @@ Sub setFootnotesNumberingLevel(level)
|
|||
curNum = curNum + 1
|
||||
EndIf
|
||||
Else
|
||||
labelNum = CInt(label)
|
||||
labelNum = CLng(label)
|
||||
If labelNum > 0 Then
|
||||
If level < 1 Then
|
||||
footnoteText.setLabel("")
|
||||
|
@ -137,6 +162,24 @@ Sub setFootnotesNumberingLevel(level)
|
|||
MsgBox getTranslation("statusNumberingFinished")
|
||||
End Sub
|
||||
|
||||
Function isTargetNote(portion As Object, noteType As Integer) As Boolean
|
||||
If ( portion.TextPortionType = "Footnote" And isEndNote(portion) = CBool(noteType) ) Then
|
||||
isTargetNote = true
|
||||
Else
|
||||
isTargetNote = false
|
||||
EndIf
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Function isEndNote(portion As Object) As Boolean
|
||||
If (IsEmpty(portion.Start.EndNote)) Then
|
||||
isEndNote = false
|
||||
Else
|
||||
isEndNote = true
|
||||
EndIf
|
||||
End Function
|
||||
|
||||
Private Sub doNotTrack
|
||||
Dim dispatcher As Object
|
||||
Dim document As Object
|
||||
|
|
|
@ -1,20 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="FootnotesConfig" dlg:left="99" dlg:top="62" dlg:width="160" dlg:height="98" dlg:closeable="true" dlg:moveable="true">
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="FootnotesConfig" dlg:left="99" dlg:top="62" dlg:width="157" dlg:height="170" dlg:closeable="true" dlg:moveable="true">
|
||||
<dlg:styles>
|
||||
<dlg:style dlg:style-id="0" dlg:border="none"/>
|
||||
</dlg:styles>
|
||||
<dlg:bulletinboard>
|
||||
<dlg:text dlg:id="Label2" dlg:tab-index="1" dlg:left="158" dlg:top="132" dlg:width="0" dlg:height="2" dlg:value="Label2"/>
|
||||
<dlg:button dlg:id="CommandButton2" dlg:tab-index="3" dlg:left="77" dlg:top="122" dlg:width="2" dlg:height="0" dlg:value="CommandButton2"/>
|
||||
<dlg:text dlg:id="Label2" dlg:tab-index="2" dlg:left="158" dlg:top="132" dlg:width="0" dlg:height="2" dlg:value="Label2"/>
|
||||
<dlg:button dlg:id="CommandButton2" dlg:tab-index="4" dlg:left="77" dlg:top="122" dlg:width="2" dlg:height="0" dlg:value="CommandButton2"/>
|
||||
<dlg:text dlg:id="Label6" dlg:tab-index="9" dlg:left="9" dlg:top="120" dlg:width="2" dlg:height="0" dlg:value="Label6"/>
|
||||
<dlg:numericfield dlg:style-id="0" dlg:id="level" dlg:tab-index="6" dlg:left="77" dlg:top="54" dlg:width="17" dlg:height="10"/>
|
||||
<dlg:button dlg:id="buttonOK" dlg:tab-index="2" dlg:left="5" dlg:top="78" dlg:width="69" dlg:height="17" dlg:value="OK" dlg:button-type="ok"/>
|
||||
<dlg:button dlg:id="buttonCancel" dlg:tab-index="4" dlg:left="86" dlg:top="78" dlg:width="69" dlg:height="17" dlg:value="Отмена" dlg:button-type="cancel"/>
|
||||
<dlg:text dlg:id="configText1" dlg:tab-index="8" dlg:left="16" dlg:top="15" dlg:width="109" dlg:height="10" dlg:value="Введите в поле число от 0 до 10"/>
|
||||
<dlg:text dlg:id="configText3" dlg:tab-index="0" dlg:left="16" dlg:top="41" dlg:width="112" dlg:height="10" dlg:value="Начинать нумерацию сносок заново "/>
|
||||
<dlg:text dlg:id="configText2" dlg:tab-index="10" dlg:left="16" dlg:top="28" dlg:width="122" dlg:height="10" dlg:value="0 - возврат к стандартной нумерации"/>
|
||||
<dlg:text dlg:id="configText4" dlg:tab-index="7" dlg:left="16" dlg:top="54" dlg:width="58" dlg:height="10" dlg:value="после заголовков"/>
|
||||
<dlg:text dlg:id="configText5" dlg:tab-index="5" dlg:left="96" dlg:top="54" dlg:width="24" dlg:height="10" dlg:value="уровня"/>
|
||||
<dlg:textfield dlg:style-id="0" dlg:id="level" dlg:tab-index="6" dlg:left="75" dlg:top="78" dlg:width="17" dlg:height="10"/>
|
||||
<dlg:button dlg:id="buttonOK" dlg:tab-index="3" dlg:left="11" dlg:top="146" dlg:width="60" dlg:height="17" dlg:value="OK" dlg:button-type="ok"/>
|
||||
<dlg:button dlg:id="buttonCancel" dlg:tab-index="0" dlg:left="85" dlg:top="146" dlg:width="60" dlg:height="17" dlg:value="Отмена" dlg:button-type="cancel"/>
|
||||
<dlg:text dlg:id="configText1" dlg:tab-index="8" dlg:left="14" dlg:top="38" dlg:width="109" dlg:height="10" dlg:value="Введите в поле число от 0 до 10"/>
|
||||
<dlg:text dlg:id="configText3" dlg:tab-index="1" dlg:left="14" dlg:top="64" dlg:width="112" dlg:height="10" dlg:value="Начинать нумерацию сносок заново "/>
|
||||
<dlg:text dlg:id="configText2" dlg:tab-index="10" dlg:left="14" dlg:top="52" dlg:width="122" dlg:height="10" dlg:value="0 - возврат к стандартной нумерации"/>
|
||||
<dlg:text dlg:id="configText4" dlg:tab-index="7" dlg:left="14" dlg:top="78" dlg:width="58" dlg:height="10" dlg:value="после заголовков"/>
|
||||
<dlg:text dlg:id="configText5" dlg:tab-index="5" dlg:left="94" dlg:top="78" dlg:width="24" dlg:height="10" dlg:value="уровня"/>
|
||||
<dlg:text dlg:id="notesTypeLabel" dlg:tab-index="11" dlg:left="14" dlg:top="9" dlg:width="39" dlg:height="10" dlg:value="Тип сносок"/>
|
||||
<dlg:menulist dlg:id="lb_notes_types" dlg:tab-index="12" dlg:left="53" dlg:top="9" dlg:width="91" dlg:height="10" dlg:spin="true"/>
|
||||
<dlg:titledbox dlg:id="groupByHeadings" dlg:tab-index="13" dlg:left="11" dlg:top="24" dlg:width="134" dlg:height="69">
|
||||
<dlg:title dlg:value="По заголовкам"/>
|
||||
</dlg:titledbox>
|
||||
<dlg:titledbox dlg:id="groupByPages" dlg:tab-index="14" dlg:left="11" dlg:top="100" dlg:width="134" dlg:height="40">
|
||||
<dlg:title dlg:value="По страницам"/>
|
||||
</dlg:titledbox>
|
||||
<dlg:text dlg:id="PerPageRangeLabel" dlg:tab-index="15" dlg:left="14" dlg:top="113" dlg:width="109" dlg:height="10" dlg:value="Задайте диапазон страниц"/>
|
||||
<dlg:textfield dlg:style-id="0" dlg:id="pageRange" dlg:tab-index="16" dlg:left="14" dlg:top="126" dlg:width="70" dlg:height="10"/>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
|
@ -253,6 +253,24 @@ Function getRussian(identifier As String) As String
|
|||
Case "OutlineLinksFinished"
|
||||
getRussian = "Создание ссылок в оглавлении завершено. Если этому сообщению предшествовали предупреждения об ошибках, то после исправления ошибок запустите создание ссылок заново."
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogFootnotesName"
|
||||
getRussian = "Обычные сноски"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogEndnotesName"
|
||||
getRussian = "Концевые сноски"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesTypeLabel"
|
||||
getRussian = "Настроить"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesByHeadingsLabel"
|
||||
getRussian = "По заголовкам"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesPerPage"
|
||||
getRussian = "По страницам"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesPerPageRangeLabel"
|
||||
getRussian = "Введите диапазон страниц"
|
||||
Exit Function
|
||||
Case Else
|
||||
getRussian = "Перевод не найден"
|
||||
End Select
|
||||
|
@ -486,6 +504,24 @@ Function getEnglish(identifier As String) As String
|
|||
Case "OutlineLinksFinished"
|
||||
getEnglish = "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."
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogFootnotesName"
|
||||
getEnglish = "Footnotes"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogEndnotesName"
|
||||
getEnglish = "Endnotes"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesTypeLabel"
|
||||
getEnglish = "Set"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesByHeadingsLabel"
|
||||
getEnglish = "Per chapter"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesPerPage"
|
||||
getEnglish = "Per page"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesPerPageRangeLabel"
|
||||
getEnglish = "Enter the page range "
|
||||
Exit Function
|
||||
Case Else
|
||||
getEnglish = "No translation"
|
||||
End Select
|
||||
|
@ -718,6 +754,24 @@ Function getFrench(identifier As String) As String
|
|||
Case "OutlineLinksFinished"
|
||||
getFrench = "La création de liens dans la table des matières est terminée. Si ce message a été précédé d'avertissements d'erreur, après avoir corrigé les erreurs, recommencez à créer des liens."
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogFootnotesName"
|
||||
getFrench = "Notes de bas de page "
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogEndnotesName"
|
||||
getFrench = "Notes de fin "
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesTypeLabel"
|
||||
getFrench = "Ensemble "
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesByHeadingsLabel"
|
||||
getFrench = "Par chapitre"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesPerPage"
|
||||
getFrench = "Par page "
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesPerPageRangeLabel"
|
||||
getFrench = "Entrez la plage de pages "
|
||||
Exit Function
|
||||
Case Else
|
||||
getFrench = "No translation"
|
||||
End Select
|
||||
|
@ -950,6 +1004,24 @@ Function getCroatian(identifier As String) As String
|
|||
Case "OutlineLinksFinished"
|
||||
getCroatian = "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."
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogFootnotesName"
|
||||
getCroatian = "Fusnote "
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogEndnotesName"
|
||||
getCroatian = "Bilješke "
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesTypeLabel"
|
||||
getCroatian = "Postavi"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesByHeadingsLabel"
|
||||
getCroatian = "Po poglavlju"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesPerPage"
|
||||
getCroatian = "Po stranici "
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesPerPageRangeLabel"
|
||||
getCroatian = "Unesite raspon stranica "
|
||||
Exit Function
|
||||
Case Else
|
||||
getCroatian = "No translation"
|
||||
End Select
|
||||
|
@ -1182,6 +1254,24 @@ Function getSerbian(identifier As String) As String
|
|||
Case "OutlineLinksFinished"
|
||||
getSerbian = "Стварање веза у табели садржаја је завршено. Ако су овој поруци претходила упозорења о грешци, након исправљања грешака поново почните стварати везе."
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogFootnotesName"
|
||||
getSerbian = "Фусноте"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogEndnotesName"
|
||||
getSerbian = "Енднотес "
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesTypeLabel"
|
||||
getSerbian = "Комплет"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesByHeadingsLabel"
|
||||
getSerbian = "По поглављу"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesPerPage"
|
||||
getSerbian = "По страни "
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesPerPageRangeLabel"
|
||||
getSerbian = "Унесите опсег страница "
|
||||
Exit Function
|
||||
Case Else
|
||||
getSerbian = "No translation"
|
||||
End Select
|
||||
|
@ -1414,6 +1504,24 @@ Function getBosnian(identifier As String) As String
|
|||
Case "OutlineLinksFinished"
|
||||
getBosnian = "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."
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogFootnotesName"
|
||||
getBosnian = "Fusnote "
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogEndnotesName"
|
||||
getBosnian = "Bilješke "
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesTypeLabel"
|
||||
getBosnian = "Set"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesByHeadingsLabel"
|
||||
getBosnian = "Po poglavlju"
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesPerPage"
|
||||
getBosnian = "Po stranici "
|
||||
Exit Function
|
||||
Case "FootnotesConfigDialogNotesPerPageRangeLabel"
|
||||
getBosnian = "Unesite raspon stranica "
|
||||
Exit Function
|
||||
Case Else
|
||||
getBosnian = "No translation"
|
||||
End Select
|
||||
|
|
BIN
translations.ods
BIN
translations.ods
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue