wizards/source/access2base/Application.xba |   20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

New commits:
commit c4651bf0b75e3178efa2ac472ec4ed225176bbfd
Author:     Jean-Pierre Ledure <j...@ledure.be>
AuthorDate: Tue Aug 21 17:26:05 2018 +0200
Commit:     Jean-Pierre Ledure <j...@ledure.be>
CommitDate: Tue Aug 21 17:26:05 2018 +0200

    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

diff --git a/wizards/source/access2base/Application.xba 
b/wizards/source/access2base/Application.xba
index 8483470a4529..38491772887a 100644
--- a/wizards/source/access2base/Application.xba
+++ b/wizards/source/access2base/Application.xba
@@ -1540,14 +1540,12 @@ Private Function _CollectNames(ByRef poCollection As 
Object, ByVal psPrefix As S
 &apos; Result = 2 items array:         (0) list of hierarchical names
 &apos;                                                         (1) list of 
persistent names
 &apos; 
-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 = &quot;application/vnd.oasis.opendocument.text&quot;
 Const cstSeparator = &quot;\;&quot;
 
-       _CollectNames = Array()
-       vCollect = Array()
-       ReDim vCollect(0 To 1)
+       _CollectNames = sCollect()
        vPersistentList = Array()
 
        With poCollection
@@ -1564,9 +1562,9 @@ Const cstSeparator = &quot;\;&quot;
                                        vNamesList(i) = psPrefix &amp; 
vNamesList(i)
                                        vPersistentList(i) = 
oObject.PersistentName
                                Case &quot;&quot;                               
&apos;  Folder
-                                       vCollect = _CollectNames(oObject, 
psPrefix &amp; sName &amp; &quot;/&quot;)
-                                       vNamesList(i) = vCollect(0)
-                                       vPersistentList(i) = vCollect(1)
+                                       sCollect = _CollectNames(oObject, 
psPrefix &amp; sName &amp; &quot;/&quot;)
+                                       vNamesList(i) = sCollect(0)
+                                       vPersistentList(i) = sCollect(1)
                                Case Else
                        End Select
                Next i
@@ -1574,9 +1572,9 @@ Const cstSeparator = &quot;\;&quot;
        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                   &apos;  _CollectNames   V6.2.0
 
@@ -1749,4 +1747,4 @@ Public Sub _RootInit(Optional ByVal pbForce As Boolean)
        
 End Sub                &apos;  _RootInit       V1.1.0
 
-</script:module>
+</script:module>
\ No newline at end of file
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to