https://issues.apache.org/ooo/show_bug.cgi?id=97539

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
            Version|OOo 3.0                     |AOO 3.4.1

--- Comment #4 from [email protected] ---
Sadly, this is not yet fixed. Although the macro as shown does indeed cause a
crash, something strange is occurring, because a slight change still causes
this to crash. For example, change the first crashMe subroutine to a function
and access oMerged(2) twice, and things still crash AOO. I ran this test on
64-bit Fedora Linux and it crashed. 

REM  *****  BASIC  *****
Option explicit

' This crashes OOo
Function crashMe() As Variant 
    dim oMerged()
    oMerged = getMergedArea(0, 0)
    msgbox (oMerged(2) - 0)
    crashMe() = oMerged(2) - 0
end Function

' If you save oMerged(2) in a variable first, it works
sub working1()
    dim oMerged()
    dim value%
    oMerged = getMergedArea(0, 0)
    value = oMerged(2)
    msgbox (value - 0)
end sub

' If you remove the "substract 0" part, it works
sub working2()
    dim oMerged()
    oMerged = getMergedArea(0, 0)
    msgbox (oMerged(2))
end sub

Function getMergedArea (iCol as integer, iRow as integer)
    dim oCursor, oRangeAddress, oCell, oSheet
    oSheet = ThisComponent.CurrentController.getActiveSheet
    oCell = oSheet.getCellByPosition(iCol, iRow)
    oCursor = oSheet.createCursorByRange(oCell)
    oCursor.collapseToMergedArea()
    oRangeAddress = oCursor.getRangeAddress()
    ' Return {startCol, startRow, endCol, endRow} as array
    getMergedArea = array (oRangeAddress.StartColumn, _
                            oRangeAddress.StartRow, _
                            oRangeAddress.EndColumn, _
                            oRangeAddress.EndRow)
End Function

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to