Bug 60371 - BASIC: Cannot assign a struct to a struct in Basic
Summary: BASIC: Cannot assign a struct to a struct in Basic
Status: RESOLVED DUPLICATE of bug 60065
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
(earliest affected) rc
Hardware: Other Linux (All)
: medium normal
Assignee: Not Assigned
Whiteboard: BSA
Keywords: regression
Depends on:
Reported: 2013-02-06 15:08 UTC by Andrew Pitonyak
Modified: 2013-02-07 09:35 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pitonyak 2013-02-06 15:08:24 UTC
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
   If Not IsMissing( uValue ) Then
      If IsUnoStruct(uValue) Then
        oPropertyValue.Value = ThisComponent
      End If
      oPropertyValue.Value = uValue
   CreateProperty() = oPropertyValue
End Function 

Operating System: Fedora
Version: rc
Last worked in: release
Comment 1 Andrew Pitonyak 2013-02-07 02:01:04 UTC
Is this a duplicate of

Comment 2 Robinson Tryon (qubit) 2013-02-07 09:01:19 UTC
(Testing using on Ubuntu 12.04.2)

Running the macro as described by Pitonyak gives me an error on line 11:

  oPropertyValue.Value = noLocale

The error given is:

  BASIC runtime error.
  Object variable not set.

Result: I can reproduce Pitonyak's results using
Comment 3 Petr Mladek 2013-02-07 09:35:20 UTC
The fix for the bug #60065 helped here as well => closing as duplicate

*** This bug has been marked as a duplicate of bug 60065 ***