Page styles config working
This commit is contained in:
parent
23f8834361
commit
c3f28049e7
6 changed files with 1665 additions and 1557 deletions
|
@ -5,24 +5,25 @@
|
||||||
<dlg:style dlg:style-id="0" dlg:border="none"/>
|
<dlg:style dlg:style-id="0" dlg:border="none"/>
|
||||||
</dlg:styles>
|
</dlg:styles>
|
||||||
<dlg:bulletinboard>
|
<dlg:bulletinboard>
|
||||||
<dlg:textfield dlg:style-id="0" dlg:id="pageHeight" dlg:tab-index="11" dlg:left="11" dlg:top="141" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
<dlg:textfield dlg:style-id="0" dlg:id="pageHeight" dlg:tab-index="12" dlg:left="11" dlg:top="141" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
||||||
<dlg:textfield dlg:style-id="0" dlg:id="pageWidth" dlg:tab-index="7" dlg:left="99" dlg:top="281" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
<dlg:textfield dlg:style-id="0" dlg:id="pageWidth" dlg:tab-index="8" dlg:left="99" dlg:top="281" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
||||||
<dlg:textfield dlg:style-id="0" dlg:id="leftPageMargin" dlg:tab-index="6" dlg:left="32" dlg:top="1" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
<dlg:textfield dlg:style-id="0" dlg:id="leftPageMargin" dlg:tab-index="7" dlg:left="32" dlg:top="1" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
||||||
<dlg:textfield dlg:style-id="0" dlg:id="topPageMargin" dlg:tab-index="2" dlg:left="193" dlg:top="29" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
<dlg:textfield dlg:style-id="0" dlg:id="topPageMargin" dlg:tab-index="3" dlg:left="193" dlg:top="29" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
||||||
<dlg:textfield dlg:style-id="0" dlg:id="headerHeight" dlg:tab-index="3" dlg:left="193" dlg:top="42" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
<dlg:textfield dlg:style-id="0" dlg:id="headerHeight" dlg:tab-index="4" dlg:left="193" dlg:top="42" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
||||||
<dlg:textfield dlg:style-id="0" dlg:id="headerOffset" dlg:tab-index="4" dlg:left="193" dlg:top="59" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
<dlg:textfield dlg:style-id="0" dlg:id="headerOffset" dlg:tab-index="5" dlg:left="193" dlg:top="59" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
||||||
<dlg:textfield dlg:style-id="0" dlg:id="footerHeight" dlg:tab-index="9" dlg:left="193" dlg:top="259" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
<dlg:textfield dlg:style-id="0" dlg:id="footerHeight" dlg:tab-index="10" dlg:left="193" dlg:top="259" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
||||||
<dlg:textfield dlg:style-id="0" dlg:id="footerOffset" dlg:tab-index="8" dlg:left="193" dlg:top="242" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
<dlg:textfield dlg:style-id="0" dlg:id="footerOffset" dlg:tab-index="9" dlg:left="193" dlg:top="242" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
||||||
<dlg:textfield dlg:style-id="0" dlg:id="footnoteAreaHeight" dlg:tab-index="5" dlg:left="193" dlg:top="229" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
<dlg:textfield dlg:style-id="0" dlg:id="footnoteAreaHeight" dlg:tab-index="6" dlg:left="193" dlg:top="229" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
||||||
<dlg:textfield dlg:style-id="0" dlg:id="footnoteAreaOffset" dlg:tab-index="1" dlg:left="193" dlg:top="202" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
<dlg:textfield dlg:style-id="0" dlg:id="footnoteAreaOffset" dlg:tab-index="2" dlg:left="193" dlg:top="202" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
||||||
<dlg:text dlg:id="description" dlg:tab-index="12" dlg:left="229" dlg:top="6" dlg:width="155" dlg:height="42" dlg:value="Label1"/>
|
<dlg:text dlg:id="description" dlg:tab-index="13" dlg:left="229" dlg:top="6" dlg:width="155" dlg:height="42" dlg:value="Label1" dlg:multiline="true"/>
|
||||||
<dlg:button dlg:id="Cancel" dlg:tab-index="14" dlg:left="314" dlg:top="290" dlg:width="58" dlg:height="13" dlg:value="Cancel" dlg:button-type="cancel"/>
|
<dlg:button dlg:id="Cancel" dlg:tab-index="15" dlg:left="314" dlg:top="290" dlg:width="60" dlg:height="13" dlg:value="Cancel" dlg:button-type="cancel"/>
|
||||||
<dlg:button dlg:id="Ok" dlg:tab-index="13" dlg:left="241" dlg:top="290" dlg:width="58" dlg:height="13" dlg:value="Ok" dlg:button-type="cancel"/>
|
<dlg:button dlg:id="Ok" dlg:tab-index="14" dlg:left="241" dlg:top="290" dlg:width="60" dlg:height="13" dlg:value="Ok" dlg:toggled="1">
|
||||||
<dlg:menulist dlg:id="ListBox2" dlg:tab-index="16" dlg:left="286" dlg:top="15" dlg:width="2" dlg:height="0"/>
|
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ePublishing.PageStyles.applyPageStyleConfiguration?language=Basic&location=application" script:language="Script"/>
|
||||||
<dlg:menulist dlg:id="slylesList" dlg:tab-index="17" dlg:left="293" dlg:top="95" dlg:width="0" dlg:height="2"/>
|
</dlg:button>
|
||||||
<dlg:img dlg:style-id="0" dlg:id="ImageControl1" dlg:tab-index="18" dlg:left="11" dlg:top="8" dlg:width="214" dlg:height="291" dlg:scale-mode="isotropic"/>
|
<dlg:img dlg:style-id="0" dlg:id="ImageControl1" dlg:tab-index="17" dlg:left="11" dlg:top="8" dlg:width="214" dlg:height="291" dlg:scale-mode="isotropic"/>
|
||||||
<dlg:menulist dlg:id="pageStyles" dlg:tab-index="15" dlg:left="229" dlg:top="50" dlg:width="155" dlg:height="230" dlg:multiselection="true"/>
|
<dlg:menulist dlg:id="pageStyles" dlg:tab-index="16" dlg:left="229" dlg:top="50" dlg:width="155" dlg:height="230" dlg:multiselection="true"/>
|
||||||
<dlg:textfield dlg:style-id="0" dlg:id="rightPageMargin" dlg:tab-index="0" dlg:left="168" dlg:top="1" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
<dlg:textfield dlg:style-id="0" dlg:id="rightPageMargin" dlg:tab-index="1" dlg:left="168" dlg:top="1" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
||||||
<dlg:textfield dlg:style-id="0" dlg:id="bottomPageMargin" dlg:tab-index="10" dlg:left="193" dlg:top="277" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
<dlg:textfield dlg:style-id="0" dlg:id="bottomPageMargin" dlg:tab-index="11" dlg:left="193" dlg:top="277" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
||||||
|
<dlg:textfield dlg:style-id="0" dlg:id="textToLine" dlg:tab-index="0" dlg:left="193" dlg:top="186" dlg:width="16" dlg:height="10" dlg:value="1000"/>
|
||||||
</dlg:bulletinboard>
|
</dlg:bulletinboard>
|
||||||
</dlg:window>
|
</dlg:window>
|
|
@ -1,14 +1,15 @@
|
||||||
<?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="PageStyles" script:language="StarBasic" script:moduleType="normal">Sub pageStylesDialog
|
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="PageStyles" script:language="StarBasic" script:moduleType="normal"> Dim pDialog As Object
|
||||||
DialogLibraries.LoadLibrary("ePublishing")
|
Sub pageStylesDialog
|
||||||
Dim dialog As Object
|
|
||||||
Dim listBox As Object
|
Dim listBox As Object
|
||||||
Dim oStyles As Object
|
Dim oStyles As Object
|
||||||
Dim pageStyles As Object
|
Dim pageStyles As Object
|
||||||
Dim pageStyleNames() As String
|
Dim pageStyleNames() As String
|
||||||
Dim imageURL As String
|
Dim imageURL As String
|
||||||
Dim pageStyle As Object
|
Dim pageStyle As Object
|
||||||
|
Dim i As Integer
|
||||||
oStyles = ThisComponent.StyleFamilies
|
oStyles = ThisComponent.StyleFamilies
|
||||||
pageStyles = oStyles.getByName(oStyles.elementNames(2))
|
pageStyles = oStyles.getByName(oStyles.elementNames(2))
|
||||||
pageStyleNames = pageStyles.getElementNames
|
pageStyleNames = pageStyles.getElementNames
|
||||||
|
@ -18,31 +19,19 @@
|
||||||
displayPageStyleNames(i) = pageStyle.displayName
|
displayPageStyleNames(i) = pageStyle.displayName
|
||||||
Next i
|
Next i
|
||||||
subShellSort(displayPageStyleNames)
|
subShellSort(displayPageStyleNames)
|
||||||
|
DialogLibraries.LoadLibrary("ePublishing")
|
||||||
dialog = CreateUnoDialog( DialogLibraries.ePublishing.PageConfig )
|
pDialog = CreateUnoDialog( DialogLibraries.ePublishing.PageConfig )
|
||||||
Globalscope.BasicLibraries.LoadLibrary( "MRILib" )
|
|
||||||
imageURL = convertToURL(getExtensionPath() + "/images/panel.svg")
|
imageURL = convertToURL(getExtensionPath() + "/images/panel.svg")
|
||||||
dialog.getControl("ImageControl1").model.imageURL = imageURL
|
pDialog.getControl("ImageControl1").model.imageURL = imageURL
|
||||||
dialog.getControl("description").setText(getTranslation("PageConfigDialogTranslations"))
|
pDialog.getControl("description").setText(getTranslation("PageConfigDialogTranslations"))
|
||||||
|
cleanPageSettings()
|
||||||
dialog.getControl("pageHeight").setText("")
|
pDialog.getControl("Cancel").Label = getTranslation("PageConfigDialogCancelButton")
|
||||||
dialog.getControl("pageWidth").setText("")
|
pDialog.getControl("Ok").Label = getTranslation("PageConfigDialogOkButton")
|
||||||
dialog.getControl("leftPageMargin").setText("")
|
listBox = pDialog.getControl("pageStyles")
|
||||||
dialog.getControl("topPageMargin").setText("")
|
|
||||||
dialog.getControl("rightPageMargin").setText("")
|
|
||||||
dialog.getControl("bottomPageMargin").setText("")
|
|
||||||
dialog.getControl("headerHeight").setText("")
|
|
||||||
dialog.getControl("headerOffset").setText("")
|
|
||||||
dialog.getControl("footerHeight").setText("")
|
|
||||||
dialog.getControl("footerOffset").setText("")
|
|
||||||
dialog.getControl("footnoteAreaHeight").setText("")
|
|
||||||
dialog.getControl("footnoteAreaOffset").setText("")
|
|
||||||
dialog.getControl("Cancel").Label = getTranslation("PageConfigDialogCancelButton")
|
|
||||||
dialog.getControl("Ok").Label = getTranslation("PageConfigDialogOkButton")
|
|
||||||
listBox = dialog.getControl("pageStyles")
|
|
||||||
listBox.addItems(displayPageStyleNames, 0)
|
listBox.addItems(displayPageStyleNames, 0)
|
||||||
dialog.Title = getTranslation("PageConfigDialogTitle")
|
pDialog.Title = getTranslation("PageConfigDialogTitle")
|
||||||
dialog.Execute()
|
pDialog.Execute()
|
||||||
|
pDialog.dispose()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Function getExtensionPath As String
|
Function getExtensionPath As String
|
||||||
|
@ -54,7 +43,128 @@ Function getExtensionPath As String
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Sub setDimensions
|
Sub applyPageStyleConfiguration()
|
||||||
|
|
||||||
|
Dim styles As Object
|
||||||
|
Dim selectedItems() As String
|
||||||
|
Dim oStyles As Object
|
||||||
|
Dim pageStyles As Object
|
||||||
|
Dim pageStyleNames() As String
|
||||||
|
Dim pageStyleName As String
|
||||||
|
Dim pageStyleDisplayName As String
|
||||||
|
Dim pageStyle As Object
|
||||||
|
Dim style As Object
|
||||||
|
Dim i As Integer
|
||||||
|
Dim foundIndex As Integer
|
||||||
|
pDialog.getControl("Ok").Model.State = 0
|
||||||
|
styles = pDialog.getControl("pageStyles")
|
||||||
|
'Mri styles
|
||||||
|
selectedItems = styles.getSelectedItems
|
||||||
|
If Ubound(selectedItems) < 0 Then
|
||||||
|
MsgBox getTranslation("pageStylesNoStyleSelected")
|
||||||
|
Exit sub
|
||||||
|
EndIf
|
||||||
|
If noPageSettings() Then
|
||||||
|
MsgBox getTranslation("pageStylesNoSettingsSet")
|
||||||
|
Exit sub
|
||||||
|
EndIf
|
||||||
|
oStyles = ThisComponent.StyleFamilies
|
||||||
|
pageStyles = oStyles.getByName(oStyles.elementNames(2))
|
||||||
|
pageStyleNames = pageStyles.getElementNames
|
||||||
|
Dim displayPageStyleNames(Ubound(pageStyleNames))
|
||||||
|
For i = LBound(displayPageStyleNames) To Ubound(displayPageStyleNames)
|
||||||
|
pageStyle = pageStyles.getByName(pageStyleNames(i))
|
||||||
|
displayPageStyleNames(i) = pageStyle.displayName
|
||||||
|
Next i
|
||||||
|
|
||||||
|
For i = LBound(selectedItems) To Ubound(selectedItems)
|
||||||
|
pageStyleDisplayName = selectedItems(i)
|
||||||
|
foundIndex = getIndex(displayPageStyleNames, pageStyleDisplayName)
|
||||||
|
pageStyleName = pageStyleNames(foundIndex)
|
||||||
|
pageStyle = pageStyles.getByName(pageStyleName)
|
||||||
|
applyPageSettings(pageStyle)
|
||||||
|
Next i
|
||||||
|
MsgBox getTranslation("PageConfigSettingsApplied")
|
||||||
|
cleanPageSettings()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Sub cleanPageSettings()
|
||||||
|
pDialog.getControl("pageHeight").setText("")
|
||||||
|
pDialog.getControl("pageWidth").setText("")
|
||||||
|
pDialog.getControl("leftPageMargin").setText("")
|
||||||
|
pDialog.getControl("topPageMargin").setText("")
|
||||||
|
pDialog.getControl("rightPageMargin").setText("")
|
||||||
|
pDialog.getControl("bottomPageMargin").setText("")
|
||||||
|
pDialog.getControl("headerHeight").setText("")
|
||||||
|
pDialog.getControl("headerOffset").setText("")
|
||||||
|
pDialog.getControl("footerHeight").setText("")
|
||||||
|
pDialog.getControl("footerOffset").setText("")
|
||||||
|
pDialog.getControl("footnoteAreaHeight").setText("")
|
||||||
|
pDialog.getControl("footnoteAreaOffset").setText("")
|
||||||
|
pDialog.getControl("textToLine").setText("")
|
||||||
|
'Globalscope.BasicLibraries.LoadLibrary( "MRILib" )
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Function noPageSettings() As Boolean
|
||||||
|
Dim setting As String
|
||||||
|
noPageSettings = true
|
||||||
|
setting = pDialog.getControl("pageHeight").getText()
|
||||||
|
If Len(setting) > 0 Then
|
||||||
|
noPageSettings = false
|
||||||
|
EndIf
|
||||||
|
setting = pDialog.getControl("pageWidth").getText()
|
||||||
|
If Len(setting) > 0 Then
|
||||||
|
noPageSettings = false
|
||||||
|
EndIf
|
||||||
|
setting = pDialog.getControl("leftPageMargin").getText()
|
||||||
|
If Len(setting) > 0 Then
|
||||||
|
noPageSettings = false
|
||||||
|
EndIf
|
||||||
|
setting = pDialog.getControl("topPageMargin").getText()
|
||||||
|
If Len(setting) > 0 Then
|
||||||
|
noPageSettings = false
|
||||||
|
EndIf
|
||||||
|
setting = pDialog.getControl("rightPageMargin").getText()
|
||||||
|
If Len(setting) > 0 Then
|
||||||
|
noPageSettings = false
|
||||||
|
EndIf
|
||||||
|
setting = pDialog.getControl("bottomPageMargin").getText()
|
||||||
|
If Len(setting) > 0 Then
|
||||||
|
noPageSettings = false
|
||||||
|
EndIf
|
||||||
|
setting = pDialog.getControl("headerHeight").getText()
|
||||||
|
If Len(setting) > 0 Then
|
||||||
|
noPageSettings = false
|
||||||
|
EndIf
|
||||||
|
setting = pDialog.getControl("headerOffset").getText()
|
||||||
|
If Len(setting) > 0 Then
|
||||||
|
noPageSettings = false
|
||||||
|
EndIf
|
||||||
|
setting = pDialog.getControl("footerHeight").getText()
|
||||||
|
If Len(setting) > 0 Then
|
||||||
|
noPageSettings = false
|
||||||
|
EndIf
|
||||||
|
setting = pDialog.getControl("footerOffset").getText()
|
||||||
|
If Len(setting) > 0 Then
|
||||||
|
noPageSettings = false
|
||||||
|
EndIf
|
||||||
|
setting = pDialog.getControl("footnoteAreaHeight").getText()
|
||||||
|
If Len(setting) > 0 Then
|
||||||
|
noPageSettings = false
|
||||||
|
EndIf
|
||||||
|
setting = pDialog.getControl("footnoteAreaOffset").getText()
|
||||||
|
If Len(setting) > 0 Then
|
||||||
|
noPageSettings = false
|
||||||
|
EndIf
|
||||||
|
setting = pDialog.getControl("textToLine").getText()
|
||||||
|
If Len(setting) > 0 Then
|
||||||
|
noPageSettings = false
|
||||||
|
EndIf
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Sub applyPageSettings(targetStyle As Object)
|
||||||
Dim oStyles As Object
|
Dim oStyles As Object
|
||||||
Dim curStyle As Object
|
Dim curStyle As Object
|
||||||
Dim inputHeight As String
|
Dim inputHeight As String
|
||||||
|
@ -66,6 +176,9 @@ Sub setDimensions
|
||||||
Dim inputFooterBodyDistance As String
|
Dim inputFooterBodyDistance As String
|
||||||
Dim inputFootnoteLineDistance As String
|
Dim inputFootnoteLineDistance As String
|
||||||
Dim inputFootnoteLineTextDistance As String
|
Dim inputFootnoteLineTextDistance As String
|
||||||
|
Dim inputFooterHeight As String
|
||||||
|
Dim inputHeaderHeight As String
|
||||||
|
Dim inputFootnoteArea As String
|
||||||
|
|
||||||
Dim newWidth As Long
|
Dim newWidth As Long
|
||||||
Dim newHeight As Long
|
Dim newHeight As Long
|
||||||
|
@ -81,85 +194,112 @@ Sub setDimensions
|
||||||
Dim footnoteLineTextDistance As Long
|
Dim footnoteLineTextDistance As Long
|
||||||
|
|
||||||
oStyles = ThisComponent.StyleFamilies.getByName("PageStyles")
|
oStyles = ThisComponent.StyleFamilies.getByName("PageStyles")
|
||||||
inputWidth = InputBox("Введите ширину страниц (в мм):", "Установка ширины всех страниц документа", "")
|
inputWidth = pDialog.getControl("pageWidth").getText()
|
||||||
inputHeight = InputBox("Введите высоту страниц (в мм):", "Установка высоты всех страниц документа", "")
|
inputHeight = pDialog.getControl("pageHeight").getText()
|
||||||
inputTopMargin = InputBox("Введите размер верхнего поля (в мм):", "Установка размера верхнего поля для всех страниц", "")
|
inputTopMargin = pDialog.getControl("topPageMargin").getText()
|
||||||
inputBottomMargin = InputBox("Введите резмер нижнего поля (в мм):", "Установка размера нижнего поля для всех страниц", "")
|
inputBottomMargin = pDialog.getControl("bottomPageMargin").getText()
|
||||||
inputLeftMargin = InputBox("Введите размер левого поля (в мм):", "Установка размера левого поля для всех страниц", "")
|
inputLeftMargin = pDialog.getControl("leftPageMargin").getText()
|
||||||
inputRightMargin = InputBox("Введите размер правого поля (в мм):", "Установка размера правого поля для всех страниц", "")
|
inputRightMargin = pDialog.getControl("rightPageMargin").getText()
|
||||||
inputHeaderBodyDistance = InputBox("Введите расстояние от верхнего колонтитула до текста (в сотых долях мм):", "Установка расстояния от верхнего колонтитула до текста", "")
|
inputHeaderBodyDistance = pDialog.getControl("headerOffset").getText()
|
||||||
inputFooterBodyDistance = InputBox("Введите расстояние от нижнего колонтитула до текста (в сотых долях мм):", "Установка расстояния от нижнего колонтитула до текста ", "")
|
inputFooterBodyDistance = pDialog.getControl("footerOffset").getText()
|
||||||
inputFootnoteLineTextDistance = InputBox("Введите расстояние от текста страницы до линии сноски (в сотых долях мм):", "Установка расстояния от текста страницы до линии сноски ", "")
|
|
||||||
inputFootnoteLineDistance = InputBox("Введите расстояние от линии сноски до текста сноски (в сотых долях мм):", "Установка расстояния от линии сноски до текста сноски ", "")
|
|
||||||
|
|
||||||
For i = 0 to oStyles.Count - 1
|
inputFooterHeight = pDialog.getControl("footerHeight").getText()
|
||||||
curStyle = oStyles.getByIndex(i)
|
inputHeaderHeight = pDialog.getControl("headerHeight").getText()
|
||||||
|
inputFootnoteArea = pDialog.getControl("footnoteAreaHeight").getText()
|
||||||
|
|
||||||
|
inputFootnoteLineTextDistance = pDialog.getControl("textToLine").getText()
|
||||||
|
'InputBox("Введите расстояние от текста страницы до линии сноски (в сотых долях мм):", "Установка расстояния от текста страницы до линии сноски ", "")
|
||||||
|
inputFootnoteLineDistance = pDialog.getControl("footnoteAreaOffset").getText()
|
||||||
|
'InputBox("Введите расстояние от линии сноски до текста сноски (в сотых долях мм):", "Установка расстояния от линии сноски до текста сноски ", "")
|
||||||
|
|
||||||
|
|
||||||
|
curStyle = targetStyle
|
||||||
|
'Mri curStyle
|
||||||
newWidth = curStyle.Width
|
newWidth = curStyle.Width
|
||||||
newHeight = curStyle.height
|
newHeight = curStyle.height
|
||||||
newTopMargin = curStyle.TopMargin
|
newTopMargin = curStyle.TopMargin
|
||||||
newBottomMargin = curStyle.BottomMargin
|
newBottomMargin = curStyle.BottomMargin
|
||||||
newLeftMargin = curStyle.LeftMargin
|
newLeftMargin = curStyle.LeftMargin
|
||||||
newRightMargin = curStyle.RightMargin
|
newRightMargin = curStyle.RightMargin
|
||||||
|
If covertMMtoLong(inputFootnoteArea) > 0 Then
|
||||||
|
Dim footnoteArea As Long
|
||||||
|
footnoteArea = covertMMtoLong(inputFootnoteArea)
|
||||||
|
curStyle.FootnoteHeight = footnoteArea
|
||||||
|
EndIf
|
||||||
|
|
||||||
If CLng(inputHeaderBodyDistance) > 0 Then
|
If covertMMtoLong(inputHeaderBodyDistance) > 0 Then
|
||||||
headerBodyDistance = CLng(inputHeaderBodyDistance)
|
headerBodyDistance = covertMMtoLong(inputHeaderBodyDistance)
|
||||||
curStyle.HeaderBodyDistance = headerBodyDistance
|
curStyle.HeaderBodyDistance = headerBodyDistance
|
||||||
EndIf
|
EndIf
|
||||||
If CLng(inputFooterBodyDistance) > 0 Then
|
If covertMMtoLong(inputFooterBodyDistance) > 0 Then
|
||||||
footerBodyDistance = CLng(inputFooterBodyDistance)
|
footerBodyDistance = covertMMtoLong(inputFooterBodyDistance)
|
||||||
curStyle.FooterBodyDistance = footerBodyDistance
|
curStyle.FooterBodyDistance = footerBodyDistance
|
||||||
EndIf
|
EndIf
|
||||||
|
If covertMMtoLong(inputFootnoteLineDistance) > 0 Then
|
||||||
If CLng(inputFootnoteLineDistance) > 0 Then
|
footnoteLineDistance = covertMMtoLong(inputFootnoteLineDistance)
|
||||||
footnoteLineDistance = CLng(inputFootnoteLineDistance)
|
|
||||||
curStyle.FootnoteLineDistance = footnoteLineDistance
|
curStyle.FootnoteLineDistance = footnoteLineDistance
|
||||||
EndIf
|
EndIf
|
||||||
If CLng(inputFootnoteLineTextDistance) > 0 Then
|
If covertMMtoLong(inputFootnoteLineTextDistance) > 0 Then
|
||||||
footnoteLineTextDistance = CLng(inputFootnoteLineTextDistance)
|
footnoteLineTextDistance = covertMMtoLong(inputFootnoteLineTextDistance)
|
||||||
curStyle.FootnoteLineTextDistance = footnoteLineTextDistance
|
curStyle.FootnoteLineTextDistance = footnoteLineTextDistance
|
||||||
EndIf
|
EndIf
|
||||||
'Globalscope.BasicLibraries.LoadLibrary( "MRILib" )
|
|
||||||
'Mri curStyle
|
If covertMMtoLong(inputFooterHeight) > 0 Then
|
||||||
|
Dim footerHeight As Long
|
||||||
|
footerHeight = covertMMtoLong(inputFooterHeight)
|
||||||
|
curStyle.FooterIsOn = true
|
||||||
|
curStyle.FooterIsDynamicHeight = false
|
||||||
|
curStyle.FooterHeight = footerHeight + curStyle.FooterBodyDistance
|
||||||
|
EndIf
|
||||||
|
|
||||||
|
If covertMMtoLong(inputHeaderHeight) > 0 Then
|
||||||
|
Dim headerHeight As Long
|
||||||
|
headerHeight = covertMMtoLong(inputHeaderHeight)
|
||||||
|
curStyle.HeaderIsOn = true
|
||||||
|
curStyle.HeaderIsDynamicHeight = false
|
||||||
|
curStyle.HeaderHeight = headerHeight + curStyle.HeaderBodyDistance
|
||||||
|
EndIf
|
||||||
|
|
||||||
|
|
||||||
If curstyle.IsLandscape Then
|
If curstyle.IsLandscape Then
|
||||||
If CLng(inputHeight) > 0 Then
|
If covertMMtoLong(inputHeight) > 0 Then
|
||||||
newWidth = CLng(inputHeight + "00")
|
newWidth = covertMMtoLong(inputHeight)
|
||||||
EndIf
|
EndIf
|
||||||
If CLng(inputWidth) > 0 Then
|
If covertMMtoLong(inputWidth) > 0 Then
|
||||||
newHeight = CLng(inputWidth + "00")
|
newHeight = covertMMtoLong(inputWidth)
|
||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
If CLng(inputLeftMargin) > 0 Then
|
If covertMMtoLong(inputLeftMargin) > 0 Then
|
||||||
newTopMargin = CLng(inputLeftMargin + "00")
|
newTopMargin = covertMMtoLong(inputLeftMargin)
|
||||||
EndIf
|
EndIf
|
||||||
If CLng(inputRightMargin) > 0 Then
|
If covertMMtoLong(inputRightMargin) > 0 Then
|
||||||
newBottomMargin = CLng(inputRightMargin + "00")
|
newBottomMargin = covertMMtoLong(inputRightMargin)
|
||||||
EndIf
|
EndIf
|
||||||
If CLng(inputTopMargin) > 0 Then
|
If covertMMtoLong(inputTopMargin) > 0 Then
|
||||||
newLeftMargin = CLng(inputTopMargin + "00")
|
newLeftMargin = covertMMtoLong(inputTopMargin)
|
||||||
EndIf
|
EndIf
|
||||||
If CLng(inputBottomMargin) > 0 Then
|
If covertMMtoLong(inputBottomMargin) > 0 Then
|
||||||
newRightMargin = CLng(inputBottomMargin + "00")
|
newRightMargin = covertMMtoLong(inputBottomMargin)
|
||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
Else
|
Else
|
||||||
If CLng(inputWidth) > 0 Then
|
If covertMMtoLong(inputWidth) > 0 Then
|
||||||
newWidth = CLng(inputWidth + "00")
|
newWidth = covertMMtoLong(inputWidth)
|
||||||
EndIf
|
EndIf
|
||||||
If CLng(inputHeight) > 0 Then
|
If covertMMtoLong(inputHeight) > 0 Then
|
||||||
newHeight = CLng(inputHeight + "00")
|
newHeight = covertMMtoLong(inputHeight)
|
||||||
EndIf
|
EndIf
|
||||||
If CLng(inputTopMargin) > 0 Then
|
If covertMMtoLong(inputTopMargin) > 0 Then
|
||||||
newTopMargin = CLng(inputTopMargin + "00")
|
newTopMargin = covertMMtoLong(inputTopMargin)
|
||||||
EndIf
|
EndIf
|
||||||
If CLng(inputBottomMargin) > 0 Then
|
If covertMMtoLong(inputBottomMargin) > 0 Then
|
||||||
newBottomMargin = CLng(inputBottomMargin + "00")
|
newBottomMargin = covertMMtoLong(inputBottomMargin)
|
||||||
EndIf
|
EndIf
|
||||||
If CLng(inputLeftMargin) > 0 Then
|
If covertMMtoLong(inputLeftMargin) > 0 Then
|
||||||
newLeftMargin = CLng(inputLeftMargin + "00")
|
newLeftMargin = covertMMtoLong(inputLeftMargin)
|
||||||
EndIf
|
EndIf
|
||||||
If CLng(inputRightMargin) > 0 Then
|
If covertMMtoLong(inputRightMargin) > 0 Then
|
||||||
newRightMargin = CLng(inputRightMargin + "00")
|
newRightMargin = covertMMtoLong(inputRightMargin)
|
||||||
EndIf
|
EndIf
|
||||||
End If
|
End If
|
||||||
textFieldWidth = newWidth - newLeftMargin - newRightMargin
|
textFieldWidth = newWidth - newLeftMargin - newRightMargin
|
||||||
|
@ -175,8 +315,35 @@ Sub setDimensions
|
||||||
curStyle.TopMargin = newTopMargin
|
curStyle.TopMargin = newTopMargin
|
||||||
curStyle.BottomMargin = newBottomMargin
|
curStyle.BottomMargin = newBottomMargin
|
||||||
EndIf
|
EndIf
|
||||||
Next
|
|
||||||
|
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Function covertMMtoLong(dimension As String) As Long
|
||||||
|
If Len(dimension) < 1 Then
|
||||||
|
convertMMtoLong = -1
|
||||||
|
Exit Function
|
||||||
|
EndIf
|
||||||
|
dimension = customReplace(dimension, ",", ".")
|
||||||
|
If Not IsNumeric(dimension) Then
|
||||||
|
convertMMtoLong = -1
|
||||||
|
Exit Function
|
||||||
|
EndIf
|
||||||
|
Dim value As Double
|
||||||
|
value = CDbl(dimension)
|
||||||
|
If value < 0 Then
|
||||||
|
convertMMtoLong = -1
|
||||||
|
Exit Function
|
||||||
|
EndIf
|
||||||
|
value = value * 100
|
||||||
|
covertMMtoLong = CLng(value)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Function customReplace(Source As String, Search As String, NewPart As String) As String
|
||||||
|
Dim Result As String
|
||||||
|
Result = join(split(Source, Search), NewPart)
|
||||||
|
customReplace = Result
|
||||||
|
End Function
|
||||||
|
|
||||||
</script:module>
|
</script:module>
|
|
@ -172,6 +172,27 @@ Function getRussian(identifier As String) As String
|
||||||
Case "compileJournalIssueInitialsAuthorDummyText"
|
Case "compileJournalIssueInitialsAuthorDummyText"
|
||||||
getRussian = "И.О. Фамилия"
|
getRussian = "И.О. Фамилия"
|
||||||
Exit Function
|
Exit Function
|
||||||
|
Case "PageConfigDialogTranslations"
|
||||||
|
getRussian = "Размеры задаются в мм. Выберите стили страниц для изменения и укажите в целевых полях размеры в формате 12.34"
|
||||||
|
Exit Function
|
||||||
|
Case "PageConfigDialogTitle"
|
||||||
|
getRussian = "Массовая настройка стилей страниц"
|
||||||
|
Exit Function
|
||||||
|
Case "PageConfigDialogCancelButton"
|
||||||
|
getRussian = "Закрыть"
|
||||||
|
Exit Function
|
||||||
|
Case "PageConfigDialogOkButton"
|
||||||
|
getRussian = "Применить"
|
||||||
|
Exit Function
|
||||||
|
Case "pageStylesNoStyleSelected"
|
||||||
|
getRussian = "Ни одного стиля страниц не выбрано"
|
||||||
|
Exit Function
|
||||||
|
Case "pageStylesNoSettingsSet"
|
||||||
|
getRussian = "Настройки не заданы"
|
||||||
|
Exit Function
|
||||||
|
Case "PageConfigSettingsApplied"
|
||||||
|
getRussian = "Настройки применены"
|
||||||
|
Exit Function
|
||||||
Case Else
|
Case Else
|
||||||
getRussian = "Перевод не найден"
|
getRussian = "Перевод не найден"
|
||||||
End Select
|
End Select
|
||||||
|
@ -336,6 +357,27 @@ Function getEnglish(identifier As String) As String
|
||||||
Case "compileJournalIssueInitialsAuthorDummyText"
|
Case "compileJournalIssueInitialsAuthorDummyText"
|
||||||
getEnglish = "И.О. Фамилия"
|
getEnglish = "И.О. Фамилия"
|
||||||
Exit Function
|
Exit Function
|
||||||
|
Case "PageConfigDialogTranslations"
|
||||||
|
getEnglish = "Dimensions are set in mm. Choose page styles and fill in target fields in format 12.34"
|
||||||
|
Exit Function
|
||||||
|
Case "PageConfigDialogTitle"
|
||||||
|
getEnglish = "Page styles batch settings"
|
||||||
|
Exit Function
|
||||||
|
Case "PageConfigDialogCancelButton"
|
||||||
|
getEnglish = "Cancel"
|
||||||
|
Exit Function
|
||||||
|
Case "PageConfigDialogOkButton"
|
||||||
|
getEnglish = "Ok"
|
||||||
|
Exit Function
|
||||||
|
Case "pageStylesNoStyleSelected"
|
||||||
|
getEnglish = "No page styles selected. Select at least one."
|
||||||
|
Exit Function
|
||||||
|
Case "pageStylesNoSettingsSet"
|
||||||
|
getEnglish = "No settings set. Set at least one."
|
||||||
|
Exit Function
|
||||||
|
Case "PageConfigSettingsApplied"
|
||||||
|
getEnglish = "Settings saved."
|
||||||
|
Exit Function
|
||||||
Case Else
|
Case Else
|
||||||
getEnglish = "No translation"
|
getEnglish = "No translation"
|
||||||
End Select
|
End Select
|
||||||
|
|
|
@ -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="journals" script:language="StarBasic">Private sub journalsMark16
|
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="journals" script:language="StarBasic">Private sub journalsMark18
|
||||||
End sub
|
End sub
|
||||||
|
|
||||||
Dim templateName As String
|
Dim templateName As String
|
||||||
|
|
2486
images/panel.svg
2486
images/panel.svg
File diff suppressed because it is too large
Load diff
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 87 KiB |
BIN
translations.ods
BIN
translations.ods
Binary file not shown.
Loading…
Add table
Reference in a new issue