Closed Bug 78400 Opened 24 years ago Closed 24 years ago

Deleting row(s), doesn't delete all selected rows

Categories

(Core :: DOM: Editor, defect, P2)

defect

Tracking

()

VERIFIED WORKSFORME
mozilla0.9.1

People

(Reporter: scalkins, Assigned: cmanske)

Details

(Keywords: regression, Whiteboard: [nsbeta1+][behavior])

Attachments

(2 files)

See this on Win 2001-04-30-06Mtrunk Linux 2001-05-01-08Mtrunk Mac 2001-05-01-04Mtrunk Steps to repro: 1)Open a new compose page, Create a table of 2 columns and 5 rows. 2) Click and drag down from 2nd row to 4th row to select these rows. 3)Select the menu option Table-->Delete-->Row(s) Actual results: Only the first row gets deleted. The rest of the selected rows remain intact. Nominating nsbeta1 for implied functionality not present. We should either change the wording from Table-->Delete-->Row(s) to Table-->Delete-->Row or make this functionality actually available to users.
Keywords: nsbeta1
Summary: Deleting rows, page doesn't update dynamically → Deleting row(s), doesn't delete all selected rows
that's odd, the delete will only remove 1 row at a time, confirmed on win98 using the build from 2-May, this should be fixed for moz0.9.1
Assignee: beppe → cmanske
Keywords: correctness
Priority: -- → P2
Whiteboard: [nsbeta1+]
Target Milestone: --- → mozilla0.9.1
I know about this. Need to count number of rows or columns selected and use that number to delete them. The complication is: What if user has non-contiguous selection? I'm inclined to keep it simple and only delete the first contiguous block of selected rows/cols. We can get fancier in the next version.
Status: NEW → ASSIGNED
I don't think you should be able to select non-contiguous rows. It is very useful to be able to delete multiple rows selected.
Allowing deletion of rows won't interfere with being able to select non-contiguous rows. It will just igore rows after the first contiguous block. The table selection code is working and very "delicate", allowing drag-selection of contiguous blocks as well as non-contiguous blocks using Ctrl+Shift+click. I don't want to touch that code any more.
Attached patch FixSplinter Review
With the 5/10 patch, ALL rows that have one or more selected cell will be deleted, whether they are contiguous or not. Also fixes similar problem for deleting columns: all columns containing one or more deleted cells are deleted when "Delete -> Column" is used.
Keywords: patch, review
Whiteboard: [nsbeta1+] → [nsbeta1+] FIX IN HAND need r=, sr=
Can we delete all of the rows/columns that have selection (even if they are discontiguous)? What if we just deleted each row/column as we encountered a selected cell? Would that be too much of a performance hit?
I don't quite understance you question. The fix results in every column (or row) containing at least one selected cell being deleted, whether discontiguous or not.
I optimized for performance by utilizing the multiple-number capabilities that nsTableEditor::DeleteTable[Row | Column] provides. Thus the new "GetNumberOfContiguous..." methods in editor.js. So the new command loops through the selected cells and deletes in larger (contiguous)chunks.
r=mjudge
Whiteboard: [nsbeta1+] FIX IN HAND need r=, sr= → [nsbeta1+] FIX IN HAND need sr=
Loops would be more clearly written as: var rows = GetNumberOfContiguousSelectedRows(); if (!rows) rows = 1; while (rows) { window.editorShell.DeleteTableRow(rows); rows = GetNumberOfContiguousSelectedRows(); } Should try/catch around here. Maybe add batching in the command.
Why not Begin/EndBatchChanges outside of the try/catch?
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Whiteboard: [nsbeta1+] FIX IN HAND need sr= → [nsbeta1+]
Something strange happens when I undo/redo this. The data is getting corrupted. Reopening bug/removing target milestone.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Summary: Deleting row(s), doesn't delete all selected rows → Deleting row(s), doesn't delete all selected rows (undo/redo)
Target Milestone: mozilla0.9.1 → ---
Maybe I'm just seeing layout/rendering bug? Could someone else test this?
Using the original test case, I still see the same behavior too. Win32 2001-05-23-06trunk (classic on Nt)
It is the display redraw problem, not my code.
no, this is still there, I followed the original steps and only 1 row gets deleted
Whiteboard: [nsbeta1+] → [nsbeta1+][behavior]
Target Milestone: --- → mozilla0.9.1
Wait a minute: The original description of "Click and drag down from 2nd row to 4th row to select these rows" doesn't select rows, it selects *cell contents across cell boundaries*. This is not how you select rows and cells. You use Accel+Click to selecte cells, Accel+Click + drag to select multiple cells, or Shift+Accel+click then drag to select rows or columns. Thus in the described way of selecting, table selection only looks at the "anchor node" of the selection (the cell where drag-selecting began). If we want Delete Rows or Delete Columns to interpret what to delete from selected *text* (not complete rows or columns), then that is a future enhancement. I think we should file a new bug on that issue, and leave this one to cover the issue of deleting multiple rows/columns when *cells* are selected. If it is deemed important enough, this request might be possible in 0.9.2 timeframe. Sorry to not clarify that issue in previous comments to this bug. Resolving this bug as "worksforme"
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → WORKSFORME
Summary: Deleting row(s), doesn't delete all selected rows (undo/redo) → Deleting row(s), doesn't delete all selected rows
Bug id=82651 has been filed for the issue of using text selection to tell what cells to use with table commands.
verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: