Created attachment 149895 [details] example for redim with and without Perserve-flag and own types It‘s not longer possible to ReDim arrays declared with own types but with the flag „preserve“ it still works. Example: Type myType sType As String aValue As Variant iNo As Integer iRange As Integer oColour As Object End Type Sub Test Dim aType(10) As myType ReDim aType(20) As myType print Str(uBound(aType)) 'result: 10 ReDim Preserve aType(20) As myType print Str(uBound(aType)) 'result: 20 End Sub
What result do you get ? I get 10 and 20 in Version: 6.3.0.0.alpha0+ Build ID: 033e1130a65ec7f0fa9c46e5124adc9d8bf724ba CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US Calc: threaded and LibreOffice 3.3.0 OOO330m19 (Build:6) tag libreoffice-3.3.0.4
With "ReDim" arrays are reduced or enlarged. The flag "Preserve" only ensures that old contents are preserved. Without flag "Preserve" previous content will be deleted. However, resizing arrays with their own data types works only with the "Preserve" flag. Without the "Preserve" flag, redimensioning is ignored. This does not correspond to the description of the "ReDim" command and can lead to unwelcome behavior in the further course of the program. It is expected that the resizing of arrays will work with their own data types. Whether the flag "Preserved" is set or not.
When you said "It‘s not longer possible to ReDim arrays declared with own types" does it mean it worked in the past? which version?
I think it was 5.4.3 ReDim was working with own types.
[Automated Action] NeedInfo-To-Unconfirmed
Reproducible with バージョン: 6.4.0.0.alpha0+ (x64) Build ID: 0fb2927a8fe06e6c3255544b8e4c4c9c0f5a67d3 CPU threads: 4; OS:Windows 10.0; UI render: default; VCL: win; TinderBox: Win-x86_64@62-TDF, Branch:master, Time: 2019-08-27_22:13:47 ロケール: ja-JP (ja_JP); UI-Language: ja-JP Calc: CL However, just a bit weirdly, on my private build with experimental patch on https://gerrit.libreoffice.org/#/c/67585/, which failed to pass at least one unittest/smoketest , the code given by the reporter resulted in two 20s. (Honestly speaking, I lazily tried building on gerrit rather than on my local machine, and left several tens of crappy modifications for typos. This is embarrassing.)
(In reply to himajin100000 from comment #6) > Reproducible with > > バージョン: 6.4.0.0.alpha0+ (x64) > Build ID: 0fb2927a8fe06e6c3255544b8e4c4c9c0f5a67d3 > CPU threads: 4; OS:Windows 10.0; UI render: default; VCL: win; > TinderBox: Win-x86_64@62-TDF, Branch:master, Time: 2019-08-27_22:13:47 > ロケール: ja-JP (ja_JP); UI-Language: ja-JP > Calc: CL > > However, just a bit weirdly, on my private build with experimental patch on > https://gerrit.libreoffice.org/#/c/67585/, which failed to pass at least one > unittest/smoketest , the code given by the reporter resulted in two 20s. > > (Honestly speaking, I lazily tried building on gerrit rather than on my > local machine, and left several tens of crappy modifications for typos. This > is embarrassing.) Moving to NEW then...
(In reply to F. Tremmel from comment #0) > It‘s not longer possible to ReDim arrays declared with own types > but with the flag „preserve“ it still works. with AOO 4.1.5 i get 10 and 20 too -> setting: Inherited From OOo
Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/0426748927919dbfd4cf5c0bb904e21a90d6c9d7 tdf#136755, tdf#124008 - delete the variable beforehand REDIM It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.