Closed Bug 237834 Opened 21 years ago Closed 21 years ago

undo is able to dirty editor when command should be disabled (also redo)

Categories

(Core :: DOM: Editor, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: Brade, Assigned: Brade)

Details

Attachments

(1 file)

The undo command in composer has a bug. If it is called when CanUndo returns false, it does do some things which cause the editor to be marked "dirty." To see this in Composer: * open a new composer window * press accel-Z (note: menu command is disabled but keybindings still trigger) * close window Observe that you are prompted to save. Expectation: window should close with no prompting.
note: I believe the fix should go in nsEditor::Undo(PRUint32 aCount)
Summary: undo is able to dirty editor when command should be disabled → undo is able to dirty editor when command should be disabled (also redo)
Attachment #144240 - Flags: review?(daniel)
Comment on attachment 144240 [details] [diff] [review] checks for CanUndo and CanRedo r=daniel@glazman.org
Attachment #144240 - Flags: review?(daniel) → review+
Comment on attachment 144240 [details] [diff] [review] checks for CanUndo and CanRedo sr=kin@netscape.com Is there a reason why Redo() doesn't also call ForceCompositionEnd()? Also, there is no longer a need to check: if ((nsITransactionManager *)nsnull!=mTxnMgr.get()) since that was already done in the Can*() methods, and you already have the result in |hasTxnMgr|. If you decide to switch to using |hasTxnMgr|, don't forget to init it. ;-)
Attachment #144240 - Flags: superreview+
Redo doesn't need to do the IME ForceCompositionEnd call because the previous action wasn't an IME action (it would've been Undo). I did test various IME actions and didn't find a problem. I decided not to change the core part of Undo and Redo because it is too close to the end of the cycle and I didn't want to risk a regression. For the record, checking hasTxnMgr wouldn't be needed because you can't "hasTxn" without a transaction manager but it could be checked if we wanted to be overly paranoid that CanUndo/CanRedo were somehow seriously broken.
Status: NEW → ASSIGNED
Attachment #144240 - Flags: approval1.7?
Comment on attachment 144240 [details] [diff] [review] checks for CanUndo and CanRedo a=asa (on behalf of drivers) for checkin to 1.7
Attachment #144240 - Flags: approval1.7? → approval1.7+
fix landed
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: