LibreOffice 4 was finally released, and it is in many ways improved over the previous version 3. Unfortunately, it also introduces a bug that seriously affects me, and it may, or may not, affect you.
I wrote an add-on that adds color to source code and XML. Consider the subroutine shown below:
'****************************************************************
'** Create and return a PropertyValue structure.
'****************************************************************
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
oPropertyValue.Value = uValue
EndIf
CreateProperty() = oPropertyValue
End Function
The above code fails....... This has already been fixed for the 4.0.1 release of LO. Note that the code below allows the code to run. See the difference? There is something about assigning a struct to a field in a struct if there is not already a value there. Thanks to Noel Power for fixing this so quickly, but alas, it was not found fast enough to make it into 4.0.
'****************************************************************
'** Create and return a PropertyValue structure.
'****************************************************************
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