Summary: |
Passing an address to MakePropertyValue() works on LO 3.5, breaks on LO 4.0.0.3 |
Product: |
LibreOffice
|
Reporter: |
Andrew Beattie <andrew> |
Component: |
BASIC | Assignee: |
Not Assigned <libreoffice-bugs> |
Status: |
RESOLVED
DUPLICATE
|
QA Contact: |
|
Severity: |
normal
|
|
|
Priority: |
medium
|
CC: |
jmadero.dev, nopower
|
Version: |
4.0.0.3 release | |
|
Hardware: |
x86 (IA32) | |
|
OS: |
Mac OS X (All) | |
|
Whiteboard: |
|
i915 platform:
|
|
i915 features:
|
|
Attachments: |
Spreadsheet that fails in LO 4.0
|
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
Created attachment 74856 [details] Spreadsheet that fails in LO 4.0 This sample code silently completes on LO Calc 3.5 but fails on 4.0.0.3 We pass an address in the second argument to MakePropertyValue() in 3.5, this works. In 4.0, the address is empty. The comments in-line help to explain. Sub Main Rem This script is designed to work on the default, empty spreadsheet oSheet = ThisComponent.Sheets.getByName("Sheet1") Dim aAddress as New com.sun.star.table.CellAddress rem get the address of a cell (any cell): aAddress = oSheet.getCellByPosition(5, 5).getCellAddress() Rem prove that the address is valid Msgbox "Address of this cell: Column=" & aAddress.Column & "; Row=" & aAddress.Row & "; Sheet=" + aAddress.Sheet Rem Call a popular function with the address MakePropertyValue( "SourcePosition", aAddress ) End Sub Rem MakePropertyValue() is a common function used by many Rem in 4.0, the stack trace shows that the second argument is an address but it has no value Function MakePropertyValue( 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 Rem This is where things go wrong. In 4.0, uValue is not missing (it is an address) but it has no value: If Not IsMissing( uValue ) Then Rem in 4.0 the script stops here with the error "Object Variable not set" oPropertyValue.Value = uValue EndIf MakePropertyValue() = oPropertyValue End Function