fix: fixed text char height shrinking. Use initial value of characters instead of getting it from paragraph style
This commit is contained in:
parent
d05aed70d6
commit
2b37cfe542
2 changed files with 5 additions and 3 deletions
|
@ -463,4 +463,4 @@ Function isCustomEndnote(portion As Object) As Boolean
|
|||
isCustomEndnote = false
|
||||
End Function
|
||||
|
||||
</script:module>
|
||||
</script:module>
|
|
@ -1131,6 +1131,7 @@ sub backspace
|
|||
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
|
||||
dispatcher.executeDispatch(document, ".uno:SwBackspace", "", 0, Array())
|
||||
end Sub
|
||||
|
||||
Sub shrinkPageContent
|
||||
Dim oViewCursor As Object 'View cursor
|
||||
Dim oTextCursor As Object 'Text cursor
|
||||
|
@ -1355,13 +1356,15 @@ Function shrinkCharHeight(oTextCursor,oViewCursor,iterations) As Boolean
|
|||
Dim oSecEnum 'sections enumeration
|
||||
Dim oParSection 'paragraph text section
|
||||
Dim pageNum As Integer
|
||||
Dim parCursor As Object
|
||||
pageNum = oViewCursor.getPage()
|
||||
For i = 1 To iterations Step 1
|
||||
oParEnum = oTextCursor.createEnumeration()
|
||||
Do While oParEnum.hasMoreElements()
|
||||
oPar = oParEnum.nextElement()
|
||||
If oPar.supportsService("com.sun.star.text.Paragraph") Then
|
||||
oPar.charHeight = roundHeight(oPar.charHeight) - 0.1
|
||||
parCursor = oTextCursor.Text.createTextCursorByRange(oPar)
|
||||
parCursor.charHeight = roundHeight(parCursor.charHeight) - 0.1
|
||||
If pageNum <> oViewCursor.getPage() Then
|
||||
shrinkCharHeight = true
|
||||
Exit Function
|
||||
|
@ -1388,7 +1391,6 @@ Function roundHeight(nHeight)
|
|||
roundHeight=lHeight
|
||||
End Function
|
||||
|
||||
|
||||
Function shrinkIntervalHeight(oTextCursor,oViewCursor,iterations) As Boolean
|
||||
Dim oParEnum 'paragraph enumeration
|
||||
Dim oPar 'current paragraph
|
||||
|
|
Loading…
Add table
Reference in a new issue