Access2Base - 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: I4bf790f8fee1f88def580dee7bac708b5620fbed
This commit is contained in:
@@ -690,21 +690,24 @@ Dim vRowSource() As Variant, iCount As Integer, i As Integer, j As integer, bFou
|
|||||||
For j = i To iCount - 1
|
For j = i To iCount - 1
|
||||||
vRowSource(j) = vRowSource(j + 1)
|
vRowSource(j) = vRowSource(j + 1)
|
||||||
Next j
|
Next j
|
||||||
ReDim Preserve vRowSource(0 To iCount - 1)
|
|
||||||
bFound = True
|
bFound = True
|
||||||
Exit For ' Remove only 1st occurrence of string
|
Exit For ' Remove only 1st occurrence of string
|
||||||
End If
|
End If
|
||||||
Next i
|
Next i
|
||||||
Case Else
|
Case Else
|
||||||
If pvIndex < 0 Or pvIndex > iCount Then Goto Error_Index
|
If pvIndex < 0 Or pvIndex > iCount Then Goto Error_Index
|
||||||
bFound = True
|
|
||||||
For i = pvIndex To iCount - 1
|
For i = pvIndex To iCount - 1
|
||||||
vRowSource(i) = vRowSource(i + 1)
|
vRowSource(i) = vRowSource(i + 1)
|
||||||
Next i
|
Next i
|
||||||
ReDim Preserve vRowSource(0 To iCount - 1)
|
bFound = True
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
If bFound Then
|
If bFound Then
|
||||||
|
If iCount > 0 Then ' https://forum.openoffice.org/en/forum/viewtopic.php?f=47&t=75008
|
||||||
|
ReDim Preserve vRowSource(0 To iCount - 1)
|
||||||
|
Else
|
||||||
|
vRowSource = Array()
|
||||||
|
End If
|
||||||
If _ParentType <> CTLPARENTISDIALOG Then
|
If _ParentType <> CTLPARENTISDIALOG Then
|
||||||
ControlModel.ListSource = vRowSource()
|
ControlModel.ListSource = vRowSource()
|
||||||
End If
|
End If
|
||||||
|
Reference in New Issue
Block a user