Closed Bug 13933 Opened 25 years ago Closed 25 years ago

Initial editor page is marked "modified" without user input

Categories

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

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: sujay, Assigned: Brade)

Details

using 9/15 build of apprunner

1) launch apprunner
2) launch editor
3) type nothing
4) File | Close/Exit

the save prompt comes up. it shouldn't because you haven't typed anything..

compare to 4.x behavior..

all platforms.
Assignee: cmanske → sfraser
Summary: Initial editor page is marked "modified" without user input
My code calls
diskDoc->GetModCount(&modCount)
which is returning 1 even without typing anything.
So this is in Simon's code. Unless he intentionally is setting it to 1
just for the test document?
Status: NEW → ASSIGNED
no, I'm not setting it to one. Something is modifying the doc. Perhaps your
stylesheet application, charlie?
Target Milestone: M13
sounds like simple cleanup, can happen late in the cycle.
What's happening here is that the doc is being marked as modified by the
transaction that creates the bogus node. We need to call ResetDocModCount() at
an opportune time.
Here's a patch.

Index: nsEditor.cpp
===================================================================
RCS file: /cvsroot/mozilla/editor/base/nsEditor.cpp,v
retrieving revision 1.226
diff -r1.226 nsEditor.cpp
297a298,301
>   // nuke the modification count, so the doc appears unmodified
>   // do this before we notify listeners
>   ResetDocModCount();
>
Assignee: sfraser → brade
Status: ASSIGNED → NEW
reassign to myself; I'll check this in for Simon as we had discussed.
I checked in Simon's patch; should be able to test today (M13).
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
resolve fixed.
Status: RESOLVED → VERIFIED
verified in 12/21 build.
You need to log in before you can comment on or make changes to this bug.