Added option for fonts to char styles conversion

This commit is contained in:
Georgy Litvinov 2021-04-30 14:13:32 +02:00
parent 717eccdc4a
commit 69f18b24c1
4 changed files with 25 additions and 5 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 mark79
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark80
End Sub
@ -44,6 +44,7 @@ Private Sub makerUpMenu
dialog.getControl(&quot;removeManualPageBreaks&quot;).Label = getTranslation(&quot;advancedMenuRemoveManualPageBreaks&quot;)
dialog.getControl(&quot;removeBasic&quot;).Label = getTranslation(&quot;advancedMenuRemoveBasic&quot;)
dialog.getControl(&quot;resetChapterNumberingRules&quot;).Label = getTranslation(&quot;advancedMenuResetChapterNumberingRules&quot;)
dialog.getControl(&quot;convertFontsToCharStyles&quot;).Label = getTranslation(&quot;advancedMenuconvertFontsToCharStyles&quot;)
dialog.getControl(&quot;Cancel&quot;).Label = getTranslation(&quot;buttonCancel&quot;)
dialog.getControl(&quot;OK&quot;).Label = getTranslation(&quot;buttonOK&quot;)
dialog.getControl(&quot;buttonLoad&quot;).Label = getTranslation(&quot;buttonLoad&quot;)
@ -148,6 +149,9 @@ Private Sub cleanAccordingTo(dialog As Object)
If dialog.getControl(&quot;resetChapterNumberingRules&quot;).state = 1 Then
resetChapterNumberingRules
EndIf
If dialog.getControl(&quot;convertFontsToCharStyles&quot;).state = 1 Then
convertFontsToCharStyles()
EndIf
statusIndicator.end()
saveAndreload()

View file

@ -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="218" dlg:help-text="&amp;21.CleaningDialog.HelpText" dlg:closeable="true" dlg:moveable="true" dlg:title="&amp;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="230" dlg:help-text="&amp;21.CleaningDialog.HelpText" dlg:closeable="true" dlg:moveable="true" dlg:title="&amp;22.CleaningDialog.Title">
<dlg:bulletinboard>
<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="Cancel" dlg:tab-index="0" dlg:left="28" dlg:top="215" 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="205" 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="215" 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,12 +20,13 @@
<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="205" dlg:width="52" dlg:height="12" dlg:value="loadTemplate">
<dlg:button dlg:id="buttonLoad" dlg:tab-index="18" dlg:left="158" dlg:top="215" 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&amp;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:checkbox dlg:id="convertFontsToCharStyles" dlg:tab-index="23" dlg:left="11" dlg:top="200" dlg:width="218" dlg:height="7" dlg:value="Конвертировать шрифты в стили символов" dlg:checked="false"/>
</dlg:bulletinboard>
</dlg:window>

View file

@ -284,6 +284,9 @@ Function getRussian(identifier As String) As String
Case &quot;replaceNumHyphenStatus&quot;
getRussian = &quot;Заменяются тире между цифрами на цифровые&quot;
Exit Function
Case &quot;advancedMenuconvertFontsToCharStyles&quot;
getRussian = &quot;Создать стили символов из найденных шрифтов&quot;
Exit Function
Case Else
getRussian = &quot;Перевод не найден&quot;
End Select
@ -550,6 +553,9 @@ Function getEnglish(identifier As String) As String
Case &quot;replaceNumHyphenStatus&quot;
getEnglish = &quot;Replacing dashes between numbers with numeric dashes&quot;
Exit Function
Case &quot;advancedMenuconvertFontsToCharStyles&quot;
getEnglish = &quot;Create character styles from found fonts &quot;
Exit Function
Case Else
getEnglish = &quot;No translation&quot;
End Select
@ -815,6 +821,9 @@ Function getCroatian(identifier As String) As String
Case &quot;replaceNumHyphenStatus&quot;
getCroatian = &quot;Zamjena crtica između brojeva numeričkim crticama&quot;
Exit Function
Case &quot;advancedMenuconvertFontsToCharStyles&quot;
getCroatian = &quot;Stvorite stilove znakova iz pronađenih fontova &quot;
Exit Function
Case Else
getCroatian = &quot;No translation&quot;
End Select
@ -1080,6 +1089,9 @@ Function getSerbian(identifier As String) As String
Case &quot;replaceNumHyphenStatus&quot;
getSerbian = &quot;Замена цртица између бројева нумеричким цртицама&quot;
Exit Function
Case &quot;advancedMenuconvertFontsToCharStyles&quot;
getSerbian = &quot;Створите стилове знакова од пронађених фонтова &quot;
Exit Function
Case Else
getSerbian = &quot;No translation&quot;
End Select
@ -1345,6 +1357,9 @@ Function getBosnian(identifier As String) As String
Case &quot;replaceNumHyphenStatus&quot;
getBosnian = &quot;Zamjena crtica između brojeva numeričkim crticama&quot;
Exit Function
Case &quot;advancedMenuconvertFontsToCharStyles&quot;
getBosnian = &quot;Stvorite stilove znakova iz pronađenih fontova &quot;
Exit Function
Case Else
getBosnian = &quot;No translation&quot;
End Select

Binary file not shown.