fix: fixed text char height shrinking. Use initial value of characters instead of getting it from paragraph style

This commit is contained in:
Georgy Litvinov 2021-08-23 18:53:47 +02:00
parent d05aed70d6
commit 2b37cfe542
2 changed files with 5 additions and 3 deletions

View file

@ -463,4 +463,4 @@ Function isCustomEndnote(portion As Object) As Boolean
isCustomEndnote = false
End Function
</script:module>
</script:module>

View file

@ -1131,6 +1131,7 @@ sub backspace
dispatcher = createUnoService(&quot;com.sun.star.frame.DispatchHelper&quot;)
dispatcher.executeDispatch(document, &quot;.uno:SwBackspace&quot;, &quot;&quot;, 0, Array())
end Sub
Sub shrinkPageContent
Dim oViewCursor As Object &apos;View cursor
Dim oTextCursor As Object &apos;Text cursor
@ -1355,13 +1356,15 @@ Function shrinkCharHeight(oTextCursor,oViewCursor,iterations) As Boolean
Dim oSecEnum &apos;sections enumeration
Dim oParSection &apos;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(&quot;com.sun.star.text.Paragraph&quot;) Then
oPar.charHeight = roundHeight(oPar.charHeight) - 0.1
parCursor = oTextCursor.Text.createTextCursorByRange(oPar)
parCursor.charHeight = roundHeight(parCursor.charHeight) - 0.1
If pageNum &lt;&gt; 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 &apos;paragraph enumeration
Dim oPar &apos;current paragraph