-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to merge cell text #539
Conversation
83b1ad8
to
d610857
Compare
Like I said in the other PR, this is a bit or a weird operation: "That is simpler, but also not so useful.. there is already a function to copy merged text, so the user can simply just use that to do the operation manually, copy the text, delete, and insert." There's also the issue of UI clutter.. the Edit menu keeps growing, and now we have 2 operations that do almost the same thing, and are both quite specialized/niche. |
Well I do slightly disagree: |
Hmm, maybe we can try it, but lets use a clearer name for it, maybe "Collapse Cells", to make it clearer cells will be modified. |
cb7dfa0
to
54a0d25
Compare
Hello Wouter |
f1e176d
to
bd904a0
Compare
src/document.h
Outdated
case A_COLLAPSE: { | ||
if (selected.xs * selected.ys == 1) return _(L"More than one cell must be selected."); | ||
auto fc = selected.GetFirst(); | ||
if (!fc->HasContent()) return _(L"The first cell in selection must have content."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this? even if this cell has no content, aren't you adding the text of all other cells to it below?
What I meant was I wasn't sure if MultiCellDeleteSub
keeps this cell, but I guess it does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem arises when you have cells in the selection that all have no content (stupid case but can happen) and the selection is surrounded by cells without content. Then MultiCellDeleteSub will also delete the row/column of the first cell, leading to a crash because of the dangling fc pointer...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right we can check after collecting the text. If there is still no content, then leave the routine...
LGTM! |
Merci :-) |
This adds a option to merge cells.