[Libreoffice-bugs] [Bug 114038] Range operations setting the values of previously empty cells can not be undone

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Nov 24 23:15:33 UTC 2017


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

--- Comment #1 from Mátyás Jani <jzombi at gmail.com> ---
Workaround: set the target cells of the range to empty string before applying
the range operation. Do it in an undo context, to have enough undo steps to
undo the whole action in one.

Something like this:

        undo = ThisComponent.UndoManager
        undo.enterUndoContext("Copy range action")
        ' clear target range, undo workaround
        for row = 4 to 8
                for col = 0 to 1
                        sheet.getCellByPosition(col, row).string = ""
                next col
        next row
        copyRange = sheet.getCellRangeByName("A1:B4")
        pasteRange = sheet.getCellRangeByName("A5:B8")
        pasteRange.DataArray = copyRange.DataArray
        undo.leaveUndoContext

(Note, clearing the target range with range operation will not work.)

-- 
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/20171124/b50c8b11/attachment.html>


More information about the Libreoffice-bugs mailing list