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>
|
Loading…
Add table
Add a link
Reference in a new issue