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)
Tracking
()
RESOLVED
FIXED
People
(Reporter: Brade, Assigned: Brade)
Details
Attachments
(1 file)
1.40 KB,
patch
|
glazou
:
review+
kinmoz
:
superreview+
asa
:
approval1.7+
|
Details | Diff | Splinter Review |
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.
Assignee | ||
Comment 1•21 years ago
|
||
note: I believe the fix should go in nsEditor::Undo(PRUint32 aCount)
Assignee | ||
Updated•21 years ago
|
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)
Assignee | ||
Comment 2•21 years ago
|
||
Assignee | ||
Updated•21 years ago
|
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+
Assignee | ||
Comment 5•21 years ago
|
||
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
Updated•21 years ago
|
Attachment #144240 -
Flags: approval1.7?
Comment 6•21 years ago
|
||
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+
Assignee | ||
Comment 7•21 years ago
|
||
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.
Description
•