Fixed conversion links to footnotes
This commit is contained in:
parent
edeef39f82
commit
df65b5efe1
1 changed files with 92 additions and 7 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="Archive" script:language="StarBasic" script:moduleType="normal">Sub archMark19
|
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Archive" script:language="StarBasic" script:moduleType="normal">Sub archMark20
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
@ -445,7 +445,7 @@ End Sub
|
||||||
Sub adjustLastLine(anchor As Object)
|
Sub adjustLastLine(anchor As Object)
|
||||||
anchor.ParaAdjust = 2
|
anchor.ParaAdjust = 2
|
||||||
'anchor.ParaLastLineAdjust = 2
|
'anchor.ParaLastLineAdjust = 2
|
||||||
'balancePara(anchor)
|
balancePara(anchor)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub adjustFirstLine(anchor As Object)
|
Sub adjustFirstLine(anchor As Object)
|
||||||
|
@ -614,9 +614,7 @@ Sub convertLinkToFootnote(forwardLink,backwardLink)
|
||||||
backward = bookmarks.getByName(backwardLink)
|
backward = bookmarks.getByName(backwardLink)
|
||||||
oViewCursor.goToRange(forward.Anchor,false)
|
oViewCursor.goToRange(forward.Anchor,false)
|
||||||
footNoteSign = oViewCursor.getString()
|
footNoteSign = oViewCursor.getString()
|
||||||
backspace
|
removeTextInFootnote()
|
||||||
backspace
|
|
||||||
SendRM
|
|
||||||
oTextCursor = oViewCursor.Text.createTextCursorByRange(oViewCursor)
|
oTextCursor = oViewCursor.Text.createTextCursorByRange(oViewCursor)
|
||||||
oTextCursor.gotoEndOfParagraph(false)
|
oTextCursor.gotoEndOfParagraph(false)
|
||||||
oTextCursor.gotoStartOfParagraph(true)
|
oTextCursor.gotoStartOfParagraph(true)
|
||||||
|
@ -624,13 +622,100 @@ Sub convertLinkToFootnote(forwardLink,backwardLink)
|
||||||
unoCut()
|
unoCut()
|
||||||
SendRM
|
SendRM
|
||||||
oViewCursor.goToRange(backward.Anchor,false)
|
oViewCursor.goToRange(backward.Anchor,false)
|
||||||
backspace
|
removeFootnoteSignInText
|
||||||
createFootnote
|
createFootnote
|
||||||
unoPaste()
|
unoPaste()
|
||||||
oViewCursor.getText.setLabel(footNoteSign)
|
oViewCursor.getText.setLabel(footNoteSign)
|
||||||
forward.dispose()
|
forward.dispose()
|
||||||
backward.dispose()
|
backward.dispose()
|
||||||
End sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Sub removeTextInFootnote
|
||||||
|
Dim oViewCursor As Object
|
||||||
|
Dim character As String
|
||||||
|
oViewCursor = ThisComponent.CurrentController.getViewCursor()
|
||||||
|
oViewCursor.goRight(1,true)
|
||||||
|
character = oViewCursor.String
|
||||||
|
Do While isLinkCharacter(character)
|
||||||
|
oViewCursor.String = ""
|
||||||
|
oViewCursor.goRight(1,true)
|
||||||
|
character = oViewCursor.String
|
||||||
|
Loop
|
||||||
|
If oViewCursor.String = " " Then
|
||||||
|
oViewCursor.String = ""
|
||||||
|
Else
|
||||||
|
oViewCursor.goLeft(1,false)
|
||||||
|
EndIf
|
||||||
|
oViewCursor.goLeft(1,true)
|
||||||
|
character = oViewCursor.String
|
||||||
|
Do While isLinkCharacter(character)
|
||||||
|
oViewCursor.String = ""
|
||||||
|
oViewCursor.goLeft(1,true)
|
||||||
|
character = oViewCursor.String
|
||||||
|
Loop
|
||||||
|
oViewCursor.goRight(1,false)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub removeFootnoteSignInText
|
||||||
|
Dim oViewCursor As Object
|
||||||
|
Dim character As String
|
||||||
|
oViewCursor = ThisComponent.CurrentController.getViewCursor()
|
||||||
|
oViewCursor.goLeft(1,true)
|
||||||
|
character = oViewCursor.String
|
||||||
|
Do While isLinkCharacter(character)
|
||||||
|
oViewCursor.String = ""
|
||||||
|
oViewCursor.goLeft(1,true)
|
||||||
|
character = oViewCursor.String
|
||||||
|
Loop
|
||||||
|
oViewCursor.goRight(1,false)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Function isLinkCharacter(character As String) As Boolean
|
||||||
|
Select Case character
|
||||||
|
Case "["
|
||||||
|
isLinkCharacter = true
|
||||||
|
Exit Function
|
||||||
|
Case "]"
|
||||||
|
isLinkCharacter = true
|
||||||
|
Exit Function
|
||||||
|
Case "0"
|
||||||
|
isLinkCharacter = true
|
||||||
|
Exit Function
|
||||||
|
Case "1"
|
||||||
|
isLinkCharacter = true
|
||||||
|
Exit Function
|
||||||
|
Case "2"
|
||||||
|
isLinkCharacter = true
|
||||||
|
Exit Function
|
||||||
|
Case "3"
|
||||||
|
isLinkCharacter = true
|
||||||
|
Exit Function
|
||||||
|
Case "4"
|
||||||
|
isLinkCharacter = true
|
||||||
|
Exit Function
|
||||||
|
Case "5"
|
||||||
|
isLinkCharacter = true
|
||||||
|
Exit Function
|
||||||
|
Case "6"
|
||||||
|
isLinkCharacter = true
|
||||||
|
Exit Function
|
||||||
|
Case "7"
|
||||||
|
isLinkCharacter = true
|
||||||
|
Exit Function
|
||||||
|
Case "8"
|
||||||
|
isLinkCharacter = true
|
||||||
|
Exit Function
|
||||||
|
Case "9"
|
||||||
|
isLinkCharacter = true
|
||||||
|
Exit Function
|
||||||
|
Case Else
|
||||||
|
isLinkCharacter = false
|
||||||
|
End Select
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sub unoCut
|
sub unoCut
|
||||||
|
|
Loading…
Add table
Reference in a new issue