In a spreadsheet leave A1 empty, write something in A2, select both cells and click Merge and Center Cells. => The usual dialog appears. (Some cells are not empty. etc.) As long as only a single merged cell is not empty, there's only one meaningful action: to move its content to the first cell (this is the first option in the dialog). No need for the dialog in this case. This change is somewhere between a bug and an enhancement. The current behavior is there in 3.3.0 and 5.3.2.2 as well.
Currently the only case when there's no confirmation dialog if the top-left cell is the non-empty one.
Confirmed in Version: 5.4.0.0.alpha0+ Build ID: 7635e0c1c7f821a1081f8e3868f641ae74a172d6 CPU threads: 4; OS: Linux 4.8; UI render: default; VCL: gtk3; Locale: ca-ES (ca_ES.UTF-8); Calc: group
Code pointer: http://opengrok.libreoffice.org/xref/core/sc/source/ui/view/viewfun2.cxx#1098
What seems to be tricky here is that checking if a block is empty is straightforward, but checking if it contains at most one cell with data (or getting the number of empty cells in a block), not so much.
I can take care of this.
You are right about one thing though; implementing this is not trivial.
I gave this a bit of thought when Julien posted the code pointer, and the idea I had on how to find if only a single cell has data is to iteratively bisect the cell block and call IsBlockEmpty() on the halves until the block size is exactly 1 cell or the halves both yield false. Just throwing it out there, if it's unhelpful, don't mind me.
(In reply to Aron Budea from comment #7) > I gave this a bit of thought when Julien posted the code pointer, and the > idea I had on how to find if only a single cell has data is to iteratively > bisect the cell block and call IsBlockEmpty() on the halves until the block > size is exactly 1 cell or the halves both yield false. > > Just throwing it out there, if it's unhelpful, don't mind me. FYI, I already have my implementation locally. :-) The intent of my comment was it became a bit more complex than I had initially anticipated. The best approach is to touch the underlying mdds structure directly for best performance. Otherwise the code may function correctly, but it may not scale.
Kohei Yoshida committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=93f5cb55349e6de5003182462bfee434dc51f6ad tdf#107255: detect whether the range has only one data cell. It will be available in 5.4.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Kohei Yoshida committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=5233a2c9009533e454a734ac57c764e15f92a229 tdf#107255: add test case for the multi-cell query method. It will be available in 5.4.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Fixed.