Added hyphen replacement in cleaning advanced mode

This commit is contained in:
Georgy Litvinov 2021-02-01 10:30:08 +01:00
parent d9b458210a
commit af0c775dd2
7 changed files with 56 additions and 8 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="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(&quot;configAnchors&quot;).Label = getTranslation(&quot;advancedMenuConfigAnchors&quot;)
dialog.getControl(&quot;fixMistakes&quot;).Label = getTranslation(&quot;advancedMenuFixMistakes&quot;)
dialog.getControl(&quot;fixDOI&quot;).Label = getTranslation(&quot;advancedMenuFixDOI&quot;)
dialog.getControl(&quot;replaceNumHyphen&quot;).Label = getTranslation(&quot;replaceNumHyphen&quot;)
dialog.getControl(&quot;removeInitPageBreak&quot;).Label = getTranslation(&quot;advancedMenuRemoveInitPageBreak&quot;)
dialog.getControl(&quot;removePageStyles&quot;).Label = getTranslation(&quot;advancedMenuRemovePageStyles&quot;)
dialog.getControl(&quot;loadStandardStyles&quot;).Label = getTranslation(&quot;advancedMenuLoadStandardStyles&quot;)
@ -118,6 +119,10 @@ Private Sub cleanAccordingTo(dialog As Object)
statusIndicator.Start(getTranslation(&quot;statusFixingDOI&quot;),100)
fixDOI
EndIf
If dialog.getControl(&quot;replaceNumHyphen&quot;).state = 1 Then
statusIndicator.Start(getTranslation(&quot;replaceNumHyphenStatus&quot;),100)
replaceNumHyphen
EndIf
If dialog.getControl(&quot;removeInitPageBreak&quot;).state = 1 Then
statusIndicator.Start(getTranslation(&quot;statusRemovePageBreakAtStart&quot;),100)
removeFirstElementPageBreak
@ -1952,4 +1957,16 @@ Sub resetChapterNumberingRules
Next i
End Sub
Private Sub replaceNumHyphen
StartTracking
replaceNumHyphenRegExp
StopTracking
showTrackedChanges
End Sub
Sub replaceNumHyphenRegExp
AskAndReplace(&quot;(?&lt;!DOI[0-9. /XVI:-‒–—−-]{1,50})(?&lt;=[:digit:])(?:[:space:])?[-‒–—−](?:[:space:])?(?=[:digit:])&quot;,&quot;&quot;)
End sub
</script:module>