Kaydet (Commit) c4651bf0 authored tarafından Jean-Pierre Ledure's avatar Jean-Pierre Ledure

Access2Base - Fix index out of array range when no forms

In AllForms the manes and persistent names lists
must be stored in a fixed size array of strings
When # of forms = 0 lists array was left empty.

Change-Id: I9b98673688994730715bb7aeccce43a9ed4fa23d
üst e02c7b1b
......@@ -1540,14 +1540,12 @@ Private Function _CollectNames(ByRef poCollection As Object, ByVal psPrefix As S
' Result = 2 items array: (0) list of hierarchical names
' (1) list of persistent names
'
Dim oObject As Object, vNamesList() As Variant, vPersistentList As Variant, i As Integer, vCollect As Variant
Dim oObject As Object, vNamesList() As Variant, vPersistentList As Variant, i As Integer, sCollect(0 To 1) As String
Dim sName As String, sType As String, sPrefix As String
Const cstFormType = "application/vnd.oasis.opendocument.text"
Const cstSeparator = "\;"
_CollectNames = Array()
vCollect = Array()
ReDim vCollect(0 To 1)
_CollectNames = sCollect()
vPersistentList = Array()
With poCollection
......@@ -1564,9 +1562,9 @@ Const cstSeparator = "\;"
vNamesList(i) = psPrefix & vNamesList(i)
vPersistentList(i) = oObject.PersistentName
Case "" ' Folder
vCollect = _CollectNames(oObject, psPrefix & sName & "/")
vNamesList(i) = vCollect(0)
vPersistentList(i) = vCollect(1)
sCollect = _CollectNames(oObject, psPrefix & sName & "/")
vNamesList(i) = sCollect(0)
vPersistentList(i) = sCollect(1)
Case Else
End Select
Next i
......@@ -1574,9 +1572,9 @@ Const cstSeparator = "\;"
End With
Set oObject = Nothing
vCollect(0) = Join(vNamesList, cstSeparator)
vCollect(1) = Join(vPersistentList, cstSeparator)
_CollectNames = vCollect
sCollect(0) = Join(vNamesList, cstSeparator)
sCollect(1) = Join(vPersistentList, cstSeparator)
_CollectNames = sCollect()
End Function ' _CollectNames V6.2.0
......@@ -1749,4 +1747,4 @@ Public Sub _RootInit(Optional ByVal pbForce As Boolean)
End Sub ' _RootInit V1.1.0
</script:module>
</script:module>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment