Forum > FPSpreadsheet

BUG Cells unmerged when press delete key

(1/1)

Tavr:
When I press DELETE key in merged cells - cells unmerged.
In addition, another problem, when editing merged cells Editor shown only in first cell of merged cells (EditorLineMode=elmMultiLine)


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TsWorksheet.EraseCell(ACell: PCell; AKeepFormat: Boolean = false);var  r, c: Cardinal;begin  if ACell <> nil then begin    r := ACell^.Row;    c := ACell^.Col;     // Unmerge range if the cell is the base of a merged block    if IsMergeBase(ACell) then      UnmergeCells(r, c);    

wp:

--- Quote from: Tavr on June 03, 2021, 09:47:03 am ---When I press DELETE key in merged cells - cells unmerged.

--- End quote ---
I modified the EraseCell method so that the KeepFormat parameter is respected also for merged cells.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TsWorksheet.EraseCell(ACell: PCell; AKeepFormat: Boolean = false);...    // Unmerge range if the cell is the base of a merged block    if IsMergeBase(ACell) and not AKeepFormat then      UnmergeCells(r, c);...

--- Quote from: Tavr on June 03, 2021, 09:47:03 am ---In addition, another problem, when editing merged cells Editor shown only in first cell of merged cells (EditorLineMode=elmMultiLine)
--- End quote ---
This is by design. I always was confused by Excel treating all cells of a merged block equally although only the left/upper cell can be modified and carries the format of the block.

Navigation

[0] Message Index

Go to full version