Code cleaning
This commit is contained in:
parent
52a5b70bbf
commit
dd90a5b726
6 changed files with 102 additions and 80 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="journals" script:language="StarBasic">Private sub journalsMark5
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="journals" script:language="StarBasic">Private sub journalsMark7
|
||||
End sub
|
||||
|
||||
Dim templateName As String
|
||||
|
@ -15,6 +15,16 @@ Dim sectionName As String
|
|||
Private Sub makeUpIssue
|
||||
turnOffTracking
|
||||
Dim description As String
|
||||
Dim i As Integer
|
||||
Dim statusIndicator as Object
|
||||
Dim oViewCursor As Object
|
||||
Dim oTextCursor As Object
|
||||
Dim articleEndPosition As Object
|
||||
Dim page As String
|
||||
Dim firstPage As String
|
||||
Dim tmp As String
|
||||
Dim nSections As Long
|
||||
|
||||
description = "Вы уверены, что хотите запустить сборку выпуска ?"
|
||||
If NOT confirm(description) Then
|
||||
Exit Sub
|
||||
|
@ -25,20 +35,9 @@ Private Sub makeUpIssue
|
|||
PQ = "ВФ"
|
||||
imagesRelativePath = "/Links/Header/"
|
||||
allImagesRelativePath = "/Links/Header-icons/"
|
||||
|
||||
Dim statusIndicator as Object
|
||||
statusIndicator = ThisComponent.getCurrentController.StatusIndicator
|
||||
Dim oViewCursor As Object
|
||||
Dim oTextCursor As Object
|
||||
Dim articleEndPosition As Object
|
||||
oViewCursor = ThisComponent.CurrentController.getViewCursor()
|
||||
Dim page As String
|
||||
Dim firstPage As String
|
||||
|
||||
Dim tmp As String
|
||||
|
||||
sectionName = ""
|
||||
Dim nSections As Long
|
||||
oFilename = ThisComponent.Location
|
||||
|
||||
'Exit if no sections in document or document not saved
|
||||
|
@ -60,11 +59,11 @@ Private Sub makeUpIssue
|
|||
|
||||
' Add article for each section
|
||||
'Go to article first page
|
||||
page = findFirstPageNumberWithStyle("Первая страница статьи")
|
||||
firstPage = page
|
||||
oViewCursor.jumpToPage(page)
|
||||
oTextCursor = oViewCursor.Text.createTextCursorByRange(oViewCursor)
|
||||
statusIndicator.Start("Сборка выпуска начата, подождите",30)
|
||||
page = findFirstPageNumberWithStyle("Первая страница статьи")
|
||||
firstPage = page
|
||||
oViewCursor.jumpToPage(page)
|
||||
oTextCursor = oViewCursor.Text.createTextCursorByRange(oViewCursor)
|
||||
statusIndicator.Start("Сборка выпуска начата, подождите",30)
|
||||
For i = 1 To 25
|
||||
'Find section file
|
||||
FilePath = findArticleFile(path,i)
|
||||
|
@ -166,14 +165,14 @@ Private Sub setPageNumbersDeprecated()
|
|||
|
||||
End Sub
|
||||
|
||||
Private Sub setAtricleVars(i)
|
||||
Private Sub setAtricleVars(i As Integer)
|
||||
'updateUserField("article" + i + "LastPage", CStr(getArticleLastPage()) )
|
||||
updateUserField("article" + i + "UDK", getUDK())
|
||||
updateUserField("author" + i + "Copyright", getCopyright() )
|
||||
'updateUserField("rightHeader" + i , getTitleHeader() )
|
||||
End Sub
|
||||
|
||||
Private Function lastPageNum(i)
|
||||
Private Function lastPageNum(i As Integer)
|
||||
Dim docLastPage As Integer
|
||||
Dim curPageNum As Integer
|
||||
Dim oViewCursor As Object
|
||||
|
@ -301,7 +300,7 @@ Private Function getArticleHeader()
|
|||
oViewCursor.goToRange(oSavePosition, false)
|
||||
End Function
|
||||
|
||||
Private Function getSectionX(section)
|
||||
Private Function getSectionX(section As String)
|
||||
Dim oViewCursor As Object
|
||||
Dim oSavePosition As Object
|
||||
Dim startPage As String
|
||||
|
@ -341,7 +340,7 @@ End Function
|
|||
|
||||
|
||||
|
||||
Private Sub setArticlePageStyles(i)
|
||||
Private Sub setArticlePageStyles(i As Integer)
|
||||
Dim oViewCursor As Object
|
||||
Dim oTextCursor As Object
|
||||
Dim oText As Object
|
||||
|
@ -387,7 +386,7 @@ Private Sub setArticlePageStyles(i)
|
|||
|
||||
End Sub
|
||||
|
||||
Private Sub setFirstPageMetadata(curStyle,i)
|
||||
Private Sub setFirstPageMetadata(curStyle As Object,i As Integer)
|
||||
Dim oViewCursor As Object
|
||||
Dim oSavePosition As Object
|
||||
Dim savePageName As String
|
||||
|
@ -414,7 +413,7 @@ Private Sub setFirstPageMetadata(curStyle,i)
|
|||
sendRM()
|
||||
End Sub
|
||||
|
||||
Private Sub setDefaultFirstPageMetadata(curStyle,i)
|
||||
Private Sub setDefaultFirstPageMetadata(curStyle As Object,i As Integer)
|
||||
Dim oViewCursor As Object
|
||||
Dim oHeaderTable As Object
|
||||
Dim oFooterTable As Object
|
||||
|
@ -453,7 +452,7 @@ Private Sub setDefaultFirstPageMetadata(curStyle,i)
|
|||
|
||||
End Sub
|
||||
|
||||
Private Sub setPHAFirstPageMetadata(curStyle,i)
|
||||
Private Sub setPHAFirstPageMetadata(curStyle As Object,i As Integer)
|
||||
Dim oViewCursor As Object
|
||||
Dim oHeader As Object
|
||||
Dim oFooterTable As Object
|
||||
|
@ -1018,7 +1017,7 @@ Private Sub updateLastPageFields
|
|||
Dim strPos As Integer
|
||||
Dim articleNum As Integer
|
||||
Dim curNum As Integer
|
||||
Dim pageNum As Integer
|
||||
Dim pageNum As String
|
||||
Dim textCursor As Object
|
||||
Dim lastPages%( 100 )
|
||||
For i = 0 to 100
|
||||
|
@ -1061,7 +1060,6 @@ Private Sub updateLastPageFields
|
|||
EndIf
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
EndIf
|
||||
'TODO:
|
||||
'OR enum1Element.supportsService("com.sun.star.text.TextTable")
|
||||
|
@ -1608,8 +1606,9 @@ Function getPageStyleNameFromEnum(enumElement)
|
|||
EndIf
|
||||
End Function
|
||||
|
||||
Function getPageNumber(cursor)
|
||||
Dim oField 'Field to insert
|
||||
Function getPageNumber(cursor As Object) As String
|
||||
Dim oField As Object
|
||||
Dim oTextCursor As Object
|
||||
oTextCursor = cursor.Text.createTextCursorByRange(cursor.Start)
|
||||
oField = ThisComponent.createInstance("com.sun.star.text.textfield.PageNumber")
|
||||
oField.NumberingType = 4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue