From 2b37cfe542eabf0e51ddc5a06159f03c6f64b743 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Mon, 23 Aug 2021 18:53:47 +0200 Subject: [PATCH] fix: fixed text char height shrinking. Use initial value of characters instead of getting it from paragraph style --- ePublishing/Endnotes.xba | 2 +- ePublishing/journals.xba | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ePublishing/Endnotes.xba b/ePublishing/Endnotes.xba index 978a6e6..dc279f0 100644 --- a/ePublishing/Endnotes.xba +++ b/ePublishing/Endnotes.xba @@ -463,4 +463,4 @@ Function isCustomEndnote(portion As Object) As Boolean isCustomEndnote = false End Function - + \ No newline at end of file diff --git a/ePublishing/journals.xba b/ePublishing/journals.xba index e0b3d38..1770c8a 100644 --- a/ePublishing/journals.xba +++ b/ePublishing/journals.xba @@ -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