Issue 126351 - Basic : Incorrect Redim for an array of structure
Summary: Basic : Incorrect Redim for an array of structure
Status: CONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: scripting (show other issues)
Version: 4.1.1
Hardware: All All
: P5 (lowest) Normal
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-03 08:49 UTC by bmarcelly
Modified: 2015-06-03 17:25 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bmarcelly 2015-06-03 08:49:15 UTC
Run the following code in the IDE
Set a breakpoint at or after the MsgBox and set a watch on variable props

Sub Test
Dim n As Long
Dim props(2) As New com.sun.star.beans.PropertyValue
n = 1
Redim props(n) As New com.sun.star.beans.PropertyValue
msgBox Ubound(props())
End Sub

MsgBox displays : 2 (should be 1)
Watch displays : props(0) is a Null Object (should be a PropertyValue)
Whatever the value of n, the array keeps the original dimension.

Same problem with any other API structure.
The bug seems very old.

Workaround : use Preserve
Redim preserve props(n) As New com.sun.star.beans.PropertyValue
Comment 1 oooforum (fr) 2015-06-03 13:04:33 UTC
Maybe a dup of issue 124154
Comment 2 mroe 2015-06-03 14:28:14 UTC
(In reply to oooforum from comment #1)
> Maybe a dup of issue 124154

No, it isn't.
Comment 3 Oliver Brinzing 2015-06-03 17:25:55 UTC
.