[Libreoffice-bugs] [Bug 132073] New: Undo causes crash in Calc if Selection Changed sheet event writes to cell in another sheet

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Sun Apr 12 18:56:48 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=132073

            Bug ID: 132073
           Summary: Undo causes crash in Calc if Selection Changed sheet
                    event writes to cell in another sheet
           Product: LibreOffice
           Version: 6.3.5.2 release
          Hardware: x86-64 (AMD64)
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: ggordon at oz.net

Description:
If a value is entered in a cell, control goes to the next cell.  Normally Undo
will undo the change in the previous cell.  However if the sheet has the
Selection Changed event linked to a macro that writes a value to a cell
somewhere in the spreadsheet, Undo ends up taking control to the cell that was
written by the Selection Changed event handler instead of the "last" modified
cell.  If the Selection Changed event handler writes to a cell in a different
sheet, sometimes Undo takes control to the cell in the other sheet and other
times the spreadsheet just crashes.  It appears that when Undo is hit, it first
tries to go back to the previous cell to change it back to its previous state,
but the change in the selected cell then causes the Selection Changed handler
to start execution before Undo can make its change.  The Selection Changed
handler takes control to the cell where it does its write and control then goes
back to Undo.  However, at this point it looks like Undo gets confused because
it is now in a different cell, and the situation appears to be worse if that
cell is on a different sheet.

Steps to Reproduce:
1. Create a spreadsheet with two sheets, Sheet 1, and Sheet 2
2. Create this macro in Sheet 1

Sub CrashTest (Event As Variant)

        Dim cell as object

        cell = thisComponent.sheets.getByName("Sheet 2").getCellByPosition(2,2)
        cell.value = 4

End Sub 

3. Create a Selection Changed sheet event in Sheet 1 that is linked to
CrashTest.
4. Enter a value in a cell in Sheet 1 and then Undo

Actual Results:
Either control goes to cell C3 in Sheet 2 or crash.

Expected Results:
Selection Changed event does not get triggered and instead the previous value
entered is undone.


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Version: 6.3.5.2 (x64)
Build ID: dd0751754f11728f69b42ee2af66670068624673
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: CL

We are seeing this problem on Windows and Linux running several different
versions of LibreOffice.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200412/4730a7c7/attachment-0001.htm>


More information about the Libreoffice-bugs mailing list