<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - Range operations setting the values of previously empty cells can not be undone"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=114038#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - Range operations setting the values of previously empty cells can not be undone"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=114038">bug 114038</a>
from <span class="vcard"><a class="email" href="mailto:jzombi@gmail.com" title="Mátyás Jani <jzombi@gmail.com>"> <span class="fn">Mátyás Jani</span></a>
</span></b>
<pre>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.)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>