https://bugs.freedesktop.org/show_bug.cgi?id=60878
Priority: medium
Bug ID: 60878
Assignee: [email protected]
Summary: Passing an address to MakePropertyValue() works on LO
3.5, breaks on LO 4.0.0.3
Severity: normal
Classification: Unclassified
OS: Mac OS X (All)
Reporter: [email protected]
Hardware: x86 (IA32)
Status: UNCONFIRMED
Version: 4.0.0.3 release
Component: BASIC
Product: LibreOffice
Created attachment 74856
--> https://bugs.freedesktop.org/attachment.cgi?id=74856&action=edit
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
--
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