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