Created menu for cleaning control
This commit is contained in:
parent
66915ccd38
commit
b76d5ca142
3 changed files with 92 additions and 4 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 mark24
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark26
|
||||
|
||||
End Sub
|
||||
|
||||
|
@ -11,11 +11,78 @@ Sub cleanButton
|
|||
quietCleaning()
|
||||
Else
|
||||
makerUpMenu()
|
||||
EndIf
|
||||
|
||||
EndIf
|
||||
End Sub
|
||||
|
||||
Sub makerUpMenu()
|
||||
Private Sub makerUpMenu
|
||||
Dim dialog As Object
|
||||
DialogLibraries.LoadLibrary("Redaction")
|
||||
dialog = CreateUnoDialog(DialogLibraries.Redaction.CleaningDialog)
|
||||
dialog.setVisible(true)
|
||||
Select Case dialog.Execute()
|
||||
Case 1
|
||||
cleanAccordingTo(dialog)
|
||||
Case 0
|
||||
End Select
|
||||
dialog.dispose()
|
||||
Exit sub
|
||||
End Sub
|
||||
|
||||
Private Sub cleanAccordingTo(dialog)
|
||||
Dim statusIndicator as Object
|
||||
statusIndicator = ThisComponent.getCurrentController.statusIndicator
|
||||
dialog.setVisible(false)
|
||||
saveDocument
|
||||
statusIndicator.Start("Чистка документа начата, подождите",100)
|
||||
doNotTrack
|
||||
If dialog.getControl("fontsInStyles").state = 1 Then
|
||||
statusIndicator.Start("Заменяем шрифты в стилях",100)
|
||||
replaceStyleFonts
|
||||
EndIf
|
||||
If dialog.getControl("symbolsConversion").state = 1 Then
|
||||
statusIndicator.Start("Конвертируем символы в целевые шрифты",100)
|
||||
unicodeSymbolsConversion
|
||||
EndIf
|
||||
If dialog.getControl("cleanFormatting").state = 1 Then
|
||||
statusIndicator.Start("Чистим ручное форматирование",100)
|
||||
cleanFormatting
|
||||
EndIf
|
||||
If dialog.getControl("removeLinks").state = 1 Then
|
||||
statusIndicator.Start("Удаляем гиперссылки",100)
|
||||
removeHyperlinks
|
||||
EndIf
|
||||
If dialog.getControl("removeBookmarks").state = 1 Then
|
||||
statusIndicator.Start("Удаляем закладки",100)
|
||||
disposeAllBookmarks
|
||||
EndIf
|
||||
If dialog.getControl("configTables").state = 1 Then
|
||||
statusIndicator.Start("Настраиваем таблицы",100)
|
||||
fixTableWidth
|
||||
EndIf
|
||||
If dialog.getControl("configAnchors").state = 1 Then
|
||||
statusIndicator.Start("Настраиваем привязку изображений",100)
|
||||
fixDrawingAnchors
|
||||
EndIf
|
||||
If dialog.getControl("fixMistakes").state = 1 Then
|
||||
statusIndicator.Start("Исправляем часто встречающиеся ошибки",100)
|
||||
fixFrequentMistakes
|
||||
EndIf
|
||||
If dialog.getControl("removeInitPageBreak").state = 1 Then
|
||||
statusIndicator.Start("Удаляем разрыв страницы, если он задан в начале документа",100)
|
||||
removeFirstElementPageBreak
|
||||
EndIf
|
||||
If dialog.getControl("removePageStyles").state = 1 Then
|
||||
statusIndicator.Start("Удаляем пользовательские стили страниц",100)
|
||||
removeUserPageStyles
|
||||
EndIf
|
||||
If dialog.getControl("loadStandardStyles").state = 1 Then
|
||||
statusIndicator.Start("Загружаем стили из шаблона",100)
|
||||
loadArticleStyles
|
||||
EndIf
|
||||
statusIndicator.end()
|
||||
saveAndreload()
|
||||
MsgBox "Чистка завершена."
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub quietCleaning
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue