feat: predefined templates provided

This commit is contained in:
Georgy Litvinov 2021-07-29 11:43:13 +02:00
parent 65dee0354c
commit 52e00175a2
12 changed files with 200 additions and 54 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 mark83
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark85
End Sub
@ -13,6 +13,9 @@ Sub cleanButton
MsgBox(getTranslation(&quot;documentIsReadOnly&quot;))
Exit Sub
EndIf
If config.getPropertyValue(&quot;predefined_template&quot;) = &quot;false&quot; Then
configureStyleFileDialog()
EndIf
If config.getPropertyValue(&quot;complexity&quot;) = &quot;user&quot; then
quietStartDialog()
Else
@ -531,17 +534,17 @@ Private Sub loadArticleStyles
Dim dispatcher As Object
Dim filePath As String
Dim fileTest As Object
Dim fileName As String
Dim predefined As String
Dim aArgs(0) As New com.sun.star.beans.PropertyValue
Dim config As Object
config = initRedactionConfiguration()
fileName = config.getPropertyValue(&quot;defaultTemplate&quot;)
filePath = getTemplatePath() &amp; &quot;/&quot; &amp; fileName
predefined = config.getPropertyValue(&quot;predefined_template&quot;)
filePath = getTemplateFile(predefined)
fileTest = CreateUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
If NOT fileTest.exists(filePath) Then
noStylesFileDialog()
fileName = config.getPropertyValue(&quot;defaultTemplate&quot;)
filePath = getTemplatePath() &amp; &quot;/&quot; &amp; fileName
configureStyleFileDialog()
predefined = config.getPropertyValue(&quot;predefined_template&quot;)
filePath = getTemplateFile(predefined)
If NOT fileTest.exists(filePath) Then
&apos;MsgBox &quot;Файл стилей &quot; &amp; fileName &amp; &quot; не добавлен в Мои шаблоны. Не могу загрузить стили в текущий файл.&quot;
Exit Sub
@ -2097,4 +2100,4 @@ Function fixColoredBackgroundInDoc() As Boolean
EndIf
End Function
</script:module>
</script:module>