提交 8ad743b5 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Do not hardcode number of elements in LevelFormat

上级 10ba7102
...@@ -92,11 +92,15 @@ sub H2Pdf ...@@ -92,11 +92,15 @@ sub H2Pdf
dim linkStart(0) As New com.sun.star.beans.PropertyValue dim linkStart(0) As New com.sun.star.beans.PropertyValue
dim linkEnd(0) As New com.sun.star.beans.PropertyValue dim linkEnd(0) As New com.sun.star.beans.PropertyValue
For i = 1 To 4 for i = 1 To 4
oLevel = toc.LevelFormat.getByIndex(i) oLevel = toc.LevelFormat.getByIndex(i)
x = DimArray(5) bound = UBound(oLevel)
x = Array(linkStart, oLevel(0), oLevel(1), oLevel(2), oLevel(3), linkEnd) x = DimArray(bound + 2)
old = oLevel(0) x(0) = linkStart
for j = 0 to bound
x(j + 1) = oLevel(j)
next
x(bound + 2) = linkEnd
linkStart(0).Name = "TokenType" linkStart(0).Name = "TokenType"
linkStart(0).Value = "TokenHyperlinkStart" linkStart(0).Value = "TokenHyperlinkStart"
linkStart(0).Handle = -1 linkStart(0).Handle = -1
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论