Added hyphen replacement in cleaning advanced mode
This commit is contained in:
parent
d9b458210a
commit
af0c775dd2
7 changed files with 56 additions and 8 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="Clean" script:language="StarBasic">Sub mark76
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark77
|
||||
|
||||
End Sub
|
||||
|
||||
|
@ -37,6 +37,7 @@ Private Sub makerUpMenu
|
|||
dialog.getControl("configAnchors").Label = getTranslation("advancedMenuConfigAnchors")
|
||||
dialog.getControl("fixMistakes").Label = getTranslation("advancedMenuFixMistakes")
|
||||
dialog.getControl("fixDOI").Label = getTranslation("advancedMenuFixDOI")
|
||||
dialog.getControl("replaceNumHyphen").Label = getTranslation("replaceNumHyphen")
|
||||
dialog.getControl("removeInitPageBreak").Label = getTranslation("advancedMenuRemoveInitPageBreak")
|
||||
dialog.getControl("removePageStyles").Label = getTranslation("advancedMenuRemovePageStyles")
|
||||
dialog.getControl("loadStandardStyles").Label = getTranslation("advancedMenuLoadStandardStyles")
|
||||
|
@ -118,6 +119,10 @@ Private Sub cleanAccordingTo(dialog As Object)
|
|||
statusIndicator.Start(getTranslation("statusFixingDOI"),100)
|
||||
fixDOI
|
||||
EndIf
|
||||
If dialog.getControl("replaceNumHyphen").state = 1 Then
|
||||
statusIndicator.Start(getTranslation("replaceNumHyphenStatus"),100)
|
||||
replaceNumHyphen
|
||||
EndIf
|
||||
If dialog.getControl("removeInitPageBreak").state = 1 Then
|
||||
statusIndicator.Start(getTranslation("statusRemovePageBreakAtStart"),100)
|
||||
removeFirstElementPageBreak
|
||||
|
@ -1952,4 +1957,16 @@ Sub resetChapterNumberingRules
|
|||
Next i
|
||||
End Sub
|
||||
|
||||
Private Sub replaceNumHyphen
|
||||
StartTracking
|
||||
replaceNumHyphenRegExp
|
||||
StopTracking
|
||||
showTrackedChanges
|
||||
End Sub
|
||||
|
||||
|
||||
Sub replaceNumHyphenRegExp
|
||||
AskAndReplace("(?<!DOI[0-9. /XVI:-‒–—−-]{1,50})(?<=[:digit:])(?:[:space:])?[-‒–—−](?:[:space:])?(?=[:digit:])","‒")
|
||||
End sub
|
||||
|
||||
</script:module>
|
|
@ -1,10 +1,10 @@
|
|||
<?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="CleaningDialog" dlg:left="107" dlg:top="22" dlg:width="237" dlg:height="211" dlg:help-text="&21.CleaningDialog.HelpText" dlg:closeable="true" dlg:moveable="true" dlg:title="&22.CleaningDialog.Title">
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="CleaningDialog" dlg:left="107" dlg:top="22" dlg:width="237" dlg:height="218" dlg:help-text="&21.CleaningDialog.HelpText" dlg:closeable="true" dlg:moveable="true" dlg:title="&22.CleaningDialog.Title">
|
||||
<dlg:bulletinboard>
|
||||
<dlg:button dlg:id="Cancel" dlg:tab-index="0" dlg:left="28" dlg:top="197" dlg:width="40" dlg:height="12" dlg:value="Отмена" dlg:button-type="cancel"/>
|
||||
<dlg:button dlg:id="Cancel" dlg:tab-index="0" dlg:left="28" dlg:top="205" dlg:width="40" dlg:height="12" dlg:value="Отмена" dlg:button-type="cancel"/>
|
||||
<dlg:button dlg:id="CommandButton1" dlg:tab-index="1" dlg:left="24" dlg:top="170" dlg:width="2" dlg:height="0" dlg:value="CommandButton1"/>
|
||||
<dlg:button dlg:id="OK" dlg:tab-index="2" dlg:left="92" dlg:top="197" dlg:width="40" dlg:height="12" dlg:value="OK" dlg:button-type="ok"/>
|
||||
<dlg:button dlg:id="OK" dlg:tab-index="2" dlg:left="92" dlg:top="205" dlg:width="40" dlg:height="12" dlg:value="OK" dlg:button-type="ok"/>
|
||||
<dlg:checkbox dlg:id="fontsInStyles" dlg:tab-index="3" dlg:left="11" dlg:top="10" dlg:width="218" dlg:height="7" dlg:value="Заменить названия шрифтов в стилях" dlg:checked="false"/>
|
||||
<dlg:checkbox dlg:id="removeLinks" dlg:tab-index="6" dlg:left="11" dlg:top="50" dlg:width="218" dlg:height="7" dlg:value="Удалить гиперссылки" dlg:checked="false"/>
|
||||
<dlg:checkbox dlg:id="cleanFormatting" dlg:tab-index="5" dlg:left="11" dlg:top="30" dlg:width="218" dlg:height="7" dlg:value="Очистить форматирование" dlg:checked="false"/>
|
||||
|
@ -20,11 +20,12 @@
|
|||
<dlg:checkbox dlg:id="removeManualPageBreaks" dlg:tab-index="15" dlg:left="11" dlg:top="150" dlg:width="218" dlg:height="7" dlg:value="Удалить все разрывы страниц" dlg:checked="false"/>
|
||||
<dlg:checkbox dlg:id="replaceWhiteBackground" dlg:tab-index="16" dlg:left="11" dlg:top="40" dlg:width="218" dlg:height="7" dlg:value="Заменить белый фон символов на прозрачный" dlg:checked="false"/>
|
||||
<dlg:checkbox dlg:id="removeBasic" dlg:tab-index="17" dlg:left="11" dlg:top="160" dlg:width="218" dlg:height="7" dlg:value="Удалить макросы" dlg:checked="false"/>
|
||||
<dlg:button dlg:id="buttonLoad" dlg:tab-index="18" dlg:left="158" dlg:top="197" dlg:width="52" dlg:height="12" dlg:value="loadTemplate">
|
||||
<dlg:button dlg:id="buttonLoad" dlg:tab-index="18" dlg:left="158" dlg:top="205" dlg:width="52" dlg:height="12" dlg:value="loadTemplate">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Redaction.Configuration.setDeafultTemplate?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:checkbox dlg:id="removeAllFields" dlg:tab-index="19" dlg:left="11" dlg:top="170" dlg:width="218" dlg:height="7" dlg:value="Удалить все поля" dlg:checked="false"/>
|
||||
<dlg:checkbox dlg:id="fixDOI" dlg:tab-index="20" dlg:left="11" dlg:top="100" dlg:width="218" dlg:height="7" dlg:value="Исправить DOI" dlg:checked="false"/>
|
||||
<dlg:checkbox dlg:id="resetChapterNumberingRules" dlg:tab-index="21" dlg:left="11" dlg:top="180" dlg:width="218" dlg:height="7" dlg:value="Сбросить настройки нумерации глав" dlg:checked="false"/>
|
||||
<dlg:checkbox dlg:id="replaceNumHyphen" dlg:tab-index="22" dlg:left="11" dlg:top="190" dlg:width="218" dlg:height="7" dlg:value="Исправить тире между цифрами" dlg:checked="false"/>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
|
@ -1,7 +1,7 @@
|
|||
<?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="Configuration" script:language="StarBasic" script:moduleType="normal">Public Const redactionExtensionName As String = "cleanAndValidate"
|
||||
Public Const redactionExtensionVersion = "0.9.24"
|
||||
Public Const redactionExtensionVersion = "0.9.26"
|
||||
Function initRedactionConfiguration()
|
||||
On Error Goto exceptionHandler
|
||||
Dim regFactory As Object
|
||||
|
|
|
@ -278,6 +278,12 @@ Function getRussian(identifier As String) As String
|
|||
Case "dialogConfigMaxSubscript"
|
||||
getRussian = "Макс. длина текста в нижнем индексе"
|
||||
Exit Function
|
||||
Case "replaceNumHyphen"
|
||||
getRussian = "Заменить тире между цифрами на цифровые"
|
||||
Exit Function
|
||||
Case "replaceNumHyphenStatus"
|
||||
getRussian = "Заменяются тире между цифрами на цифровые"
|
||||
Exit Function
|
||||
Case Else
|
||||
getRussian = "Перевод не найден"
|
||||
End Select
|
||||
|
@ -538,6 +544,12 @@ Function getEnglish(identifier As String) As String
|
|||
Case "dialogConfigMaxSubscript"
|
||||
getEnglish = "Max line length in subscript"
|
||||
Exit Function
|
||||
Case "replaceNumHyphen"
|
||||
getEnglish = "Replace dashes between numbers with numeric dashes"
|
||||
Exit Function
|
||||
Case "replaceNumHyphenStatus"
|
||||
getEnglish = "Replacing dashes between numbers with numeric dashes"
|
||||
Exit Function
|
||||
Case Else
|
||||
getEnglish = "No translation"
|
||||
End Select
|
||||
|
@ -797,6 +809,12 @@ Function getCroatian(identifier As String) As String
|
|||
Case "dialogConfigMaxSubscript"
|
||||
getCroatian = "Maksimalna duljina retka u indeksu"
|
||||
Exit Function
|
||||
Case "replaceNumHyphen"
|
||||
getCroatian = "Zamijenite crtice između brojeva numeričkim crticama"
|
||||
Exit Function
|
||||
Case "replaceNumHyphenStatus"
|
||||
getCroatian = "Zamjena crtica između brojeva numeričkim crticama"
|
||||
Exit Function
|
||||
Case Else
|
||||
getCroatian = "No translation"
|
||||
End Select
|
||||
|
@ -1056,6 +1074,12 @@ Function getSerbian(identifier As String) As String
|
|||
Case "dialogConfigMaxSubscript"
|
||||
getSerbian = "Максимална дужина реда у индексу"
|
||||
Exit Function
|
||||
Case "replaceNumHyphen"
|
||||
getSerbian = "Цртице између бројева замените нумеричким цртицама"
|
||||
Exit Function
|
||||
Case "replaceNumHyphenStatus"
|
||||
getSerbian = "Замена цртица између бројева нумеричким цртицама"
|
||||
Exit Function
|
||||
Case Else
|
||||
getSerbian = "No translation"
|
||||
End Select
|
||||
|
@ -1315,6 +1339,12 @@ Function getBosnian(identifier As String) As String
|
|||
Case "dialogConfigMaxSubscript"
|
||||
getBosnian = "Maksimalna dužina retka u indeksu"
|
||||
Exit Function
|
||||
Case "replaceNumHyphen"
|
||||
getBosnian = "Zamijenite crtice između brojeva numeričkim crticama"
|
||||
Exit Function
|
||||
Case "replaceNumHyphenStatus"
|
||||
getBosnian = "Zamjena crtica između brojeva numeričkim crticama"
|
||||
Exit Function
|
||||
Case Else
|
||||
getBosnian = "No translation"
|
||||
End Select
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<description xmlns="http://openoffice.org/extensions/description/2006" xmlns:dep="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<identifier value="pro.litvinovg.Redaction"/>
|
||||
<version value="0.9.24"/>
|
||||
<version value="0.9.26"/>
|
||||
<platform value="all"/>
|
||||
<display-name>
|
||||
<name lang="en">Cleaning and validation documents for publishing in html and epub with pagination</name>
|
||||
|
|
|
@ -1 +1 @@
|
|||
version=0.9.24
|
||||
version=0.9.26
|
||||
|
|
BIN
translations.ods
BIN
translations.ods
Binary file not shown.
Loading…
Add table
Reference in a new issue