https://bugs.freedesktop.org/show_bug.cgi?id=60371
Priority: medium
Bug ID: 60371
Keywords: regression
Assignee: [email protected]
Summary: BASIC: Cannot assign a struct to a struct in Basic
Severity: normal
Classification: Unclassified
OS: Linux (All)
Reporter: [email protected]
Hardware: Other
Whiteboard: BSA
Status: UNCONFIRMED
Version: 4.0.0.2 rc
Component: BASIC
Product: LibreOffice
This is a regression from the last release version. I have never had this not
work.
Problem description:
In a BASIC Macro, create a PropertyValue.
Create another struct (I tested with a Locale and a PropertyValue)
Assign that struct to the Value entry of the PropertyValue
The error is "Object Variable Not Set"
Steps to reproduce:
Run this macro:
Sub Main
Dim oPropertyValue As New com.sun.star.beans.PropertyValue
Dim noLocale As New com.sun.star.lang.Locale
Dim cName As String
cName = "name"
noLocale.Country = ""
noLocale.Language = "zxx"
oPropertyValue.Name = cName
oPropertyValue.Value = noLocale
End Sub
The error occurs at the line:
oPropertyValue.Value = noLocale
Note: I have only seen this error when i assign a struct to the value. If I
assign an UNO service or a string, there is no problem. In fact, this code will
work:
oPropertyValue.Value = ThisComponent
oPropertyValue.Value = noLocale
oPropertyValue.Value = ""
oPropertyValue.Value = noLocale
A temporary work around for my problem is demonstrated in this macro
Function CreateProperty( Optional cName As String, Optional uValue ) As
com.sun.star.beans.PropertyValue
Dim oPropertyValue As New com.sun.star.beans.PropertyValue
If Not IsMissing( cName ) Then
oPropertyValue.Name = cName
EndIf
If Not IsMissing( uValue ) Then
If IsUnoStruct(uValue) Then
oPropertyValue.Value = ThisComponent
End If
oPropertyValue.Value = uValue
EndIf
CreateProperty() = oPropertyValue
End Function
Operating System: Fedora
Version: 4.0.0.2 rc
Last worked in: 3.6.5.2 release
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs