Fixes
This commit is contained in:
parent
0cf66ed037
commit
e72ccdda16
4 changed files with 110 additions and 12 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="Album" script:language="StarBasic" script:moduleType="normal">Sub albumMark3
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Album" script:language="StarBasic" script:moduleType="normal">Sub albumMark4
|
||||
End Sub
|
||||
|
||||
Sub rotatePageButton
|
||||
|
|
|
@ -128,8 +128,11 @@ sub convertIndesignPageBreaks
|
|||
If NOT confirm(description) Then
|
||||
Exit Sub
|
||||
EndIf
|
||||
Dim document As Object
|
||||
document = ThisComponent.CurrentController.Frame
|
||||
Dim dispatcher As Object
|
||||
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
|
||||
Dim oViewCursor As Object
|
||||
oViewCursor = thisComponent.getCurrentController.getViewCursor
|
||||
oViewCursor.jumpToFirstPage
|
||||
Dim args(0) as new com.sun.star.beans.PropertyValue
|
||||
|
@ -139,12 +142,12 @@ sub convertIndesignPageBreaks
|
|||
args(0).Value = false
|
||||
dispatcher.executeDispatch(document, ".uno:TrackChanges", "", 0, args())
|
||||
|
||||
Dim oSearch
|
||||
Dim oTextCursor
|
||||
Dim lineIndent
|
||||
Dim oSearch As Object
|
||||
Dim oTextCursor As Object
|
||||
Dim firstLowercase As Boolean
|
||||
Dim charNum As Long
|
||||
Dim character As String
|
||||
Dim oFound As Object
|
||||
firstLowercase = false
|
||||
|
||||
oSearch = ThisComponent.createSearchDescriptor()
|
||||
|
@ -202,7 +205,8 @@ Sub adjustFirstLine(oTextCursor)
|
|||
End Sub
|
||||
|
||||
|
||||
Function isLowerCase(character)
|
||||
Function isLowerCase(character) As Boolean
|
||||
Dim charNum As Integer
|
||||
If (character = "") Then
|
||||
charNum = ASC(""+0)
|
||||
Else
|
||||
|
|
|
@ -2,6 +2,67 @@
|
|||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Books" script:language="StarBasic" script:moduleType="normal">Sub markBooks3
|
||||
End Sub
|
||||
|
||||
Sub makeUniquePages
|
||||
Dim pageStyleBreaks As Variant
|
||||
pageStyleBreaks = getPageStyleBreaks()
|
||||
Dim pageCount As Integer
|
||||
Dim i As Integer
|
||||
'Globalscope.BasicLibraries.LoadLibrary( "MRILib" )
|
||||
pageCount = thiscomponent.currentController.pageCount
|
||||
Dim styleNames(pageCount - 1) As String
|
||||
For i = 0 To pageCount - 1
|
||||
If i = 0 Then
|
||||
|
||||
EndIf
|
||||
Next i
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Function getPageStyleBreaks()
|
||||
|
||||
Dim enum1 As Object
|
||||
Dim enum1Element As Object
|
||||
Dim pageStyleName As String
|
||||
Dim pageNumber As Integer
|
||||
Dim pageName As String
|
||||
Dim oViewCursor As Object
|
||||
Dim anchor As Object
|
||||
Dim oSavePosition As Object
|
||||
Dim pageStyleBreaks(1) As Variant
|
||||
Dim pageStyleNames() As String
|
||||
Dim pageNumbers() As Integer
|
||||
oViewCursor = ThisComponent.CurrentController.getViewCursor()
|
||||
|
||||
enum1 = ThisComponent.Text.createEnumeration()
|
||||
Dim i As Integer
|
||||
i = 0
|
||||
Dim first As Boolean
|
||||
first = true
|
||||
While enum1.hasMoreElements
|
||||
enum1Element = enum1.nextElement
|
||||
If enum1Element.supportsService("com.sun.star.text.Paragraph") OR enum1Element.supportsService("com.sun.star.text.TextTable") Then
|
||||
If enum1Element.BreakType = com.sun.star.style.BreakType.PAGE_BEFORE AND NOT IsMissing(enum1Element.PageDescName) AND NOT IsNull(enum1Element.PageDescName) AND NOT IsEmpty(enum1Element.PageDescName) Then
|
||||
pageStyleName = enum1Element.PageStyleName
|
||||
addToArray(pageStyleNames(),pageStyleName)
|
||||
oViewCursor.goToRange(enum1Element.Anchor,false)
|
||||
addToArray(pageNumbers(),CInt(oViewCursor.Page))
|
||||
first = false
|
||||
ElseIf first Then
|
||||
addToArray(pageStyleNames(), enum1Element.PageStyleName)
|
||||
addToArray(pageNumbers(),1)
|
||||
first = false
|
||||
EndIf
|
||||
|
||||
EndIf
|
||||
i = i + 1
|
||||
Wend
|
||||
pageStyleBreaks(0) = pageStyleNames
|
||||
pageStyleBreaks(1) = pageNumbers
|
||||
getPageStyleBreaks = pageStyleBreaks
|
||||
End Function
|
||||
|
||||
Sub setUniqPageStyles
|
||||
Dim prevPageName As String
|
||||
Dim firstPageName As String
|
||||
|
@ -123,4 +184,27 @@ Function findFirstPageNumberWithStyle(pageStyleName)
|
|||
Wend
|
||||
findFirstPageNumberWithStyle = -1
|
||||
End Function
|
||||
|
||||
|
||||
sub testStyleCopy
|
||||
rem ----------------------------------------------------------------------
|
||||
rem define variables
|
||||
dim document as object
|
||||
dim dispatcher as object
|
||||
rem ----------------------------------------------------------------------
|
||||
rem get access to the document
|
||||
document = ThisComponent.CurrentController.Frame
|
||||
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
|
||||
|
||||
rem ----------------------------------------------------------------------
|
||||
dim args1(1) as new com.sun.star.beans.PropertyValue
|
||||
args1(0).Name = "Param"
|
||||
args1(0).Value = "alb2"
|
||||
args1(1).Name = "Family"
|
||||
args1(1).Value = 8
|
||||
|
||||
dispatcher.executeDispatch(document, ".uno:StyleNewByExample", "", 0, args1())
|
||||
|
||||
|
||||
end sub
|
||||
</script:module>
|
|
@ -33,6 +33,11 @@ End Sub
|
|||
Private sub disableAutoHyph()
|
||||
Dim propertySetInfo As Object
|
||||
Dim oPositionOfMatch As Long
|
||||
Dim oFamilies As Object
|
||||
Dim sElements() As String
|
||||
Dim oFamily As Object
|
||||
Dim oStyle As Object
|
||||
Dim j As Integer
|
||||
oFamilies = ThisComponent.StyleFamilies
|
||||
sElements() = oFamilies.getElementNames()
|
||||
oFamily = oFamilies.getByName(sElements(1))
|
||||
|
@ -50,6 +55,8 @@ Private Sub convertHyphInText(textElement As Object)
|
|||
Dim enum1 As Object
|
||||
Dim i As Integer
|
||||
Dim cell As Object
|
||||
Dim cellNames() As Object
|
||||
Dim cellText As Object
|
||||
enum1 = textElement.createEnumeration()
|
||||
While enum1.hasMoreElements
|
||||
enum1Element = enum1.nextElement
|
||||
|
@ -67,7 +74,7 @@ Private Sub convertHyphInText(textElement As Object)
|
|||
Wend
|
||||
End Sub
|
||||
|
||||
Private Sub convertParaHyphens(para)
|
||||
Private Sub convertParaHyphens(para As Object)
|
||||
Dim lineEnds() As Object
|
||||
Dim autoHyphens() As Object
|
||||
Dim autoBreaks() As Object
|
||||
|
@ -75,10 +82,13 @@ Private Sub convertParaHyphens(para)
|
|||
' Dim lineShifts() As Integer
|
||||
Dim charNum as Integer
|
||||
Dim lineLength As Integer
|
||||
Dim lineCursor As Object
|
||||
Dim i As Integer
|
||||
Dim vCurs As Object
|
||||
Dim tCurs As Object
|
||||
Dim lineCurs As Object
|
||||
Dim lastChar As String
|
||||
Dim nextChar As String
|
||||
'No hyphenation needed
|
||||
If para.ParaIsHyphenation = false Then
|
||||
Exit Sub
|
||||
|
@ -170,13 +180,13 @@ Private Sub insertBreak(tCursor As Object)
|
|||
tCursor.String = ""
|
||||
End Sub
|
||||
|
||||
Private Function getPrevChar(tCurs As Object)
|
||||
Private Function getPrevChar(tCurs As Object) As String
|
||||
tCurs.goLeft(1,true)
|
||||
getPrevChar = tCurs.getString()
|
||||
tCurs.goRight(1,false)
|
||||
End Function
|
||||
|
||||
Private Function getNextChar(tCurs As Object)
|
||||
Private Function getNextChar(tCurs As Object) As String
|
||||
tCurs.goRight(1,true)
|
||||
getNextChar = tCurs.getString()
|
||||
tCurs.goLeft(1,false)
|
||||
|
@ -291,7 +301,7 @@ Private Sub stretchLine(tCurs As Object)
|
|||
|
||||
End Sub
|
||||
|
||||
Private Function getParaLineNumber(vCursor As Object)
|
||||
Private Function getParaLineNumber(vCursor As Object) As Integer
|
||||
Dim lineNumber As Integer
|
||||
Dim oSavePosition As Object
|
||||
Dim tCursor As Object
|
||||
|
@ -325,7 +335,7 @@ End Sub
|
|||
|
||||
|
||||
|
||||
Private Function needHyphen(before As String, after As String,lineLength As Integer)
|
||||
Private Function needHyphen(before As String, after As String,lineLength As Integer) As boolean
|
||||
Dim charNumBefore as Integer
|
||||
Dim charNumAfter as Integer
|
||||
needHyphen = true
|
||||
|
|
Loading…
Add table
Reference in a new issue