Fixed status indicator on cleaning and disabled fixing hyphen between numbers

This commit is contained in:
Georgy Litvinov 2020-12-14 12:39:13 +01:00
parent 54aea6994a
commit bd840a6499

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 mark69
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark70
End Sub
@ -56,9 +56,9 @@ End Sub
Private Sub cleanAccordingTo(dialog As Object)
Dim statusIndicator as Object
statusIndicator = ThisComponent.getCurrentController.statusIndicator
dialog.setVisible(false)
saveDocument
statusIndicator = ThisComponent.getCurrentController.statusIndicator
statusIndicator.Start(getTranslation(&quot;statusStarted&quot;),100)
doNotTrack
If dialog.getControl(&quot;loadStandardStyles&quot;).state = 1 Then
@ -106,6 +106,8 @@ Private Sub cleanAccordingTo(dialog As Object)
fixDrawingAnchors
EndIf
If dialog.getControl(&quot;fixMistakes&quot;).state = 1 Then
saveAndreload()
statusIndicator = ThisComponent.getCurrentController.statusIndicator
statusIndicator.Start(getTranslation(&quot;statusFixFrequentMistakes&quot;),100)
fixFrequentMistakes
EndIf
@ -154,9 +156,10 @@ End Sub
Private Sub quietCleaning
Dim description As String
Dim statusIndicator As Object
statusIndicator = ThisComponent.getCurrentController.statusIndicator
saveDocument
saveAsDocAndBackToODT
statusIndicator = ThisComponent.getCurrentController.statusIndicator
statusIndicator.Start(getTranslation(&quot;statusStarted&quot;),100)
doNotTrack
statusIndicator.Start(getTranslation(&quot;statusReplaceFontsInStyles&quot;),100)
@ -177,6 +180,8 @@ Private Sub quietCleaning
fixTableWidth
statusIndicator.Start(getTranslation(&quot;statusConfigureImagesAnchors&quot;),100)
fixDrawingAnchors
saveAndreload()
statusIndicator = ThisComponent.getCurrentController.statusIndicator
statusIndicator.Start(getTranslation(&quot;statusFixFrequentMistakes&quot;),100)
fixFrequentMistakes
statusIndicator.Start(getTranslation(&quot;statusRemovePageBreakAtStart&quot;),100)
@ -428,7 +433,7 @@ Private Sub fixFrequentMistakes
AskAndReplace(&quot;(?&lt;=[:alpha:][:space:])[-‒—−](?=[:space:][:alpha:])&quot;,&quot;&quot;)
&apos;Между двумя цифрами и тире не долнжо быть пробелов. А также тире должно быть цифровым.
&apos;Также проверяем, что перед искомым тире нет DOI
AskAndReplace(&quot;(?&lt;!DOI[0-9. /XVI:-‒–—−-]{1,50})(?&lt;=[:digit:])(?:[:space:])?[-‒–—−](?:[:space:])?(?=[:digit:])&quot;,&quot;&quot;)
&apos;&apos;&apos;&apos;&apos;AskAndReplace(&quot;(?&lt;!DOI[0-9. /XVI:-‒–—−-]{1,50})(?&lt;=[:digit:])(?:[:space:])?[-‒–—−](?:[:space:])?(?=[:digit:])&quot;,&quot;&quot;)
&apos;Между двумя римскими цифрами и тире между ними не долнжо быть пробелов. А также тире должно быть средним
AskAndReplace(&quot;(?&lt;=[MDCLXVI])(?:[:space:])?[-‒–—−](?:[:space:])?(?=[MDCLXVI])&quot;,&quot;&quot;)
&apos;Между буквой и угловой открывающейся скобкой должен быть пробел