Fixed getting footnote sign in footnote conversion for archive

This commit is contained in:
Georgy Litvinov 2021-05-21 00:18:29 +02:00
parent df65b5efe1
commit 097883c65a
2 changed files with 20 additions and 13 deletions

View file

@ -613,8 +613,7 @@ Sub convertLinkToFootnote(forwardLink,backwardLink)
forward = bookmarks.getByName(forwardLink) forward = bookmarks.getByName(forwardLink)
backward = bookmarks.getByName(backwardLink) backward = bookmarks.getByName(backwardLink)
oViewCursor.goToRange(forward.Anchor,false) oViewCursor.goToRange(forward.Anchor,false)
footNoteSign = oViewCursor.getString() footNoteSign = getTextInFootnote
removeTextInFootnote()
oTextCursor = oViewCursor.Text.createTextCursorByRange(oViewCursor) oTextCursor = oViewCursor.Text.createTextCursorByRange(oViewCursor)
oTextCursor.gotoEndOfParagraph(false) oTextCursor.gotoEndOfParagraph(false)
oTextCursor.gotoStartOfParagraph(true) oTextCursor.gotoStartOfParagraph(true)
@ -632,13 +631,21 @@ End Sub
Sub removeTextInFootnote Function getTextInFootnote As String
Dim oViewCursor As Object Dim oViewCursor As Object
Dim oTextCursor As Object
Dim character As String Dim character As String
getTextInFootnote = ""
oViewCursor = ThisComponent.CurrentController.getViewCursor() oViewCursor = ThisComponent.CurrentController.getViewCursor()
oTextCursor = oViewCursor.Text.createTextCursorByRange(oViewCursor)
oTextCursor.goToStartOfParagraph(false)
oViewCursor.goToRange(oTextCursor,false)
oViewCursor.goRight(1,true) oViewCursor.goRight(1,true)
character = oViewCursor.String character = oViewCursor.String
Do While isLinkCharacter(character) Do While isLinkCharacter(character)
If IsNumeric(character) Then
getTextInFootnote = getTextInFootnote & character
EndIf
oViewCursor.String = "" oViewCursor.String = ""
oViewCursor.goRight(1,true) oViewCursor.goRight(1,true)
character = oViewCursor.String character = oViewCursor.String
@ -648,6 +655,13 @@ Sub removeTextInFootnote
Else Else
oViewCursor.goLeft(1,false) oViewCursor.goLeft(1,false)
EndIf EndIf
End Function
Sub removeFootnoteSignInText
Dim oViewCursor As Object
Dim character As String
oViewCursor = ThisComponent.CurrentController.getViewCursor()
oViewCursor.String = ""
oViewCursor.goLeft(1,true) oViewCursor.goLeft(1,true)
character = oViewCursor.String character = oViewCursor.String
Do While isLinkCharacter(character) Do While isLinkCharacter(character)
@ -655,18 +669,11 @@ Sub removeTextInFootnote
oViewCursor.goLeft(1,true) oViewCursor.goLeft(1,true)
character = oViewCursor.String character = oViewCursor.String
Loop Loop
oViewCursor.goRight(1,false) oViewCursor.goRight(1,true)
End Sub
Sub removeFootnoteSignInText
Dim oViewCursor As Object
Dim character As String
oViewCursor = ThisComponent.CurrentController.getViewCursor()
oViewCursor.goLeft(1,true)
character = oViewCursor.String character = oViewCursor.String
Do While isLinkCharacter(character) Do While isLinkCharacter(character)
oViewCursor.String = "" oViewCursor.String = ""
oViewCursor.goLeft(1,true) oViewCursor.goRight(1,true)
character = oViewCursor.String character = oViewCursor.String
Loop Loop
oViewCursor.goRight(1,false) oViewCursor.goRight(1,false)

View file

@ -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="Footnotes" script:language="StarBasic" script:moduleType="normal">sub footMark6 <script:module xmlns:script="http://openoffice.org/2000/script" script:name="Footnotes" script:language="StarBasic" script:moduleType="normal">sub footMark7
End Sub End Sub
Sub openFootNotesDialog Sub openFootNotesDialog