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"?>
|
<?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="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
|
End Sub
|
||||||
|
|
||||||
Sub rotatePageButton
|
Sub rotatePageButton
|
||||||
|
|
|
@ -128,8 +128,11 @@ sub convertIndesignPageBreaks
|
||||||
If NOT confirm(description) Then
|
If NOT confirm(description) Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
EndIf
|
EndIf
|
||||||
|
Dim document As Object
|
||||||
document = ThisComponent.CurrentController.Frame
|
document = ThisComponent.CurrentController.Frame
|
||||||
|
Dim dispatcher As Object
|
||||||
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
|
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
|
||||||
|
Dim oViewCursor As Object
|
||||||
oViewCursor = thisComponent.getCurrentController.getViewCursor
|
oViewCursor = thisComponent.getCurrentController.getViewCursor
|
||||||
oViewCursor.jumpToFirstPage
|
oViewCursor.jumpToFirstPage
|
||||||
Dim args(0) as new com.sun.star.beans.PropertyValue
|
Dim args(0) as new com.sun.star.beans.PropertyValue
|
||||||
|
@ -139,12 +142,12 @@ sub convertIndesignPageBreaks
|
||||||
args(0).Value = false
|
args(0).Value = false
|
||||||
dispatcher.executeDispatch(document, ".uno:TrackChanges", "", 0, args())
|
dispatcher.executeDispatch(document, ".uno:TrackChanges", "", 0, args())
|
||||||
|
|
||||||
Dim oSearch
|
Dim oSearch As Object
|
||||||
Dim oTextCursor
|
Dim oTextCursor As Object
|
||||||
Dim lineIndent
|
|
||||||
Dim firstLowercase As Boolean
|
Dim firstLowercase As Boolean
|
||||||
Dim charNum As Long
|
Dim charNum As Long
|
||||||
Dim character As String
|
Dim character As String
|
||||||
|
Dim oFound As Object
|
||||||
firstLowercase = false
|
firstLowercase = false
|
||||||
|
|
||||||
oSearch = ThisComponent.createSearchDescriptor()
|
oSearch = ThisComponent.createSearchDescriptor()
|
||||||
|
@ -202,7 +205,8 @@ Sub adjustFirstLine(oTextCursor)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Function isLowerCase(character)
|
Function isLowerCase(character) As Boolean
|
||||||
|
Dim charNum As Integer
|
||||||
If (character = "") Then
|
If (character = "") Then
|
||||||
charNum = ASC(""+0)
|
charNum = ASC(""+0)
|
||||||
Else
|
Else
|
||||||
|
|
|
@ -2,6 +2,67 @@
|
||||||
<!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="Books" script:language="StarBasic" script:moduleType="normal">Sub markBooks3
|
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Books" script:language="StarBasic" script:moduleType="normal">Sub markBooks3
|
||||||
End Sub
|
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
|
Sub setUniqPageStyles
|
||||||
Dim prevPageName As String
|
Dim prevPageName As String
|
||||||
Dim firstPageName As String
|
Dim firstPageName As String
|
||||||
|
@ -123,4 +184,27 @@ Function findFirstPageNumberWithStyle(pageStyleName)
|
||||||
Wend
|
Wend
|
||||||
findFirstPageNumberWithStyle = -1
|
findFirstPageNumberWithStyle = -1
|
||||||
End Function
|
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>
|
</script:module>
|
|
@ -33,6 +33,11 @@ End Sub
|
||||||
Private sub disableAutoHyph()
|
Private sub disableAutoHyph()
|
||||||
Dim propertySetInfo As Object
|
Dim propertySetInfo As Object
|
||||||
Dim oPositionOfMatch As Long
|
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
|
oFamilies = ThisComponent.StyleFamilies
|
||||||
sElements() = oFamilies.getElementNames()
|
sElements() = oFamilies.getElementNames()
|
||||||
oFamily = oFamilies.getByName(sElements(1))
|
oFamily = oFamilies.getByName(sElements(1))
|
||||||
|
@ -50,6 +55,8 @@ Private Sub convertHyphInText(textElement As Object)
|
||||||
Dim enum1 As Object
|
Dim enum1 As Object
|
||||||
Dim i As Integer
|
Dim i As Integer
|
||||||
Dim cell As Object
|
Dim cell As Object
|
||||||
|
Dim cellNames() As Object
|
||||||
|
Dim cellText As Object
|
||||||
enum1 = textElement.createEnumeration()
|
enum1 = textElement.createEnumeration()
|
||||||
While enum1.hasMoreElements
|
While enum1.hasMoreElements
|
||||||
enum1Element = enum1.nextElement
|
enum1Element = enum1.nextElement
|
||||||
|
@ -67,7 +74,7 @@ Private Sub convertHyphInText(textElement As Object)
|
||||||
Wend
|
Wend
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub convertParaHyphens(para)
|
Private Sub convertParaHyphens(para As Object)
|
||||||
Dim lineEnds() As Object
|
Dim lineEnds() As Object
|
||||||
Dim autoHyphens() As Object
|
Dim autoHyphens() As Object
|
||||||
Dim autoBreaks() As Object
|
Dim autoBreaks() As Object
|
||||||
|
@ -75,10 +82,13 @@ Private Sub convertParaHyphens(para)
|
||||||
' Dim lineShifts() As Integer
|
' Dim lineShifts() As Integer
|
||||||
Dim charNum as Integer
|
Dim charNum as Integer
|
||||||
Dim lineLength As Integer
|
Dim lineLength As Integer
|
||||||
|
Dim lineCursor As Object
|
||||||
Dim i As Integer
|
Dim i As Integer
|
||||||
Dim vCurs As Object
|
Dim vCurs As Object
|
||||||
Dim tCurs As Object
|
Dim tCurs As Object
|
||||||
Dim lineCurs As Object
|
Dim lineCurs As Object
|
||||||
|
Dim lastChar As String
|
||||||
|
Dim nextChar As String
|
||||||
'No hyphenation needed
|
'No hyphenation needed
|
||||||
If para.ParaIsHyphenation = false Then
|
If para.ParaIsHyphenation = false Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
|
@ -170,13 +180,13 @@ Private Sub insertBreak(tCursor As Object)
|
||||||
tCursor.String = ""
|
tCursor.String = ""
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function getPrevChar(tCurs As Object)
|
Private Function getPrevChar(tCurs As Object) As String
|
||||||
tCurs.goLeft(1,true)
|
tCurs.goLeft(1,true)
|
||||||
getPrevChar = tCurs.getString()
|
getPrevChar = tCurs.getString()
|
||||||
tCurs.goRight(1,false)
|
tCurs.goRight(1,false)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function getNextChar(tCurs As Object)
|
Private Function getNextChar(tCurs As Object) As String
|
||||||
tCurs.goRight(1,true)
|
tCurs.goRight(1,true)
|
||||||
getNextChar = tCurs.getString()
|
getNextChar = tCurs.getString()
|
||||||
tCurs.goLeft(1,false)
|
tCurs.goLeft(1,false)
|
||||||
|
@ -291,7 +301,7 @@ Private Sub stretchLine(tCurs As Object)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function getParaLineNumber(vCursor As Object)
|
Private Function getParaLineNumber(vCursor As Object) As Integer
|
||||||
Dim lineNumber As Integer
|
Dim lineNumber As Integer
|
||||||
Dim oSavePosition As Object
|
Dim oSavePosition As Object
|
||||||
Dim tCursor As Object
|
Dim tCursor As Object
|
||||||
|
@ -325,9 +335,9 @@ 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 charNumBefore as Integer
|
||||||
Dim charNumAfter as Integer
|
Dim charNumAfter as Integer
|
||||||
needHyphen = true
|
needHyphen = true
|
||||||
If lineLength < 2 Then
|
If lineLength < 2 Then
|
||||||
needHyphen = false
|
needHyphen = false
|
||||||
|
|
Loading…
Add table
Reference in a new issue