wizards/source/access2base/Control.xba |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit aafb2fd9c7580a0de98f2d60657576c62175a5ee
Author: Jean-Pierre Ledure <j...@ledure.be>
Date:   Sun Feb 1 15:00:08 2015 +0100

    Access2Base - Patch#2 Bug in Control.RemoveItem
    
    Removing last item of a Listbox produces an "Index out of rande" run-time 
error
    Bug reported in user forum 
https://forum.openoffice.org/en/forum/viewtopic.php?f=47&t=75008
    
    Change-Id: Iee760d1910db193ad53908141cbfa2920afb52fe
    Reviewed-on: https://gerrit.libreoffice.org/14270
    Reviewed-by: Lionel Elie Mamane <lio...@mamane.lu>
    Tested-by: Lionel Elie Mamane <lio...@mamane.lu>

diff --git a/wizards/source/access2base/Control.xba 
b/wizards/source/access2base/Control.xba
index 66705d9..d150c87 100644
--- a/wizards/source/access2base/Control.xba
+++ b/wizards/source/access2base/Control.xba
@@ -690,21 +690,24 @@ Dim vRowSource() As Variant, iCount As Integer, i As 
Integer, j As integer, bFou
                                        For j = i To iCount - 1
                                                vRowSource(j) = vRowSource(j + 
1)
                                        Next j
-                                       ReDim Preserve vRowSource(0 To iCount - 
1)
                                        bFound = True
                                        Exit For        &apos;  Remove only 1st 
occurrence of string
                                End If
                        Next i
                Case Else
                        If pvIndex &lt; 0 Or pvIndex &gt; iCount Then Goto 
Error_Index
-                       bFound = True
                        For i = pvIndex To iCount - 1
                                vRowSource(i) = vRowSource(i + 1)
                        Next i
-                       ReDim Preserve vRowSource(0 To iCount - 1)
+                       bFound = True
                End Select
                        
        If bFound Then
+               If iCount &gt; 0 Then                   &apos;  
https://forum.openoffice.org/en/forum/viewtopic.php?f=47&amp;t=75008
+                       ReDim Preserve vRowSource(0 To iCount - 1)
+               Else
+                       vRowSource = Array()
+               End If
                If _ParentType &lt;&gt; CTLPARENTISDIALOG Then
                        ControlModel.ListSource = vRowSource()
                End If
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to