Closed
Bug 184719
Opened 22 years ago
Closed 22 years ago
midas needs a command for toggling read-only/writable
Categories
(Core :: DOM: Editor, defect)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
mozilla1.3beta
People
(Reporter: Brade, Assigned: Brade)
Details
(Whiteboard: midas)
Attachments
(3 obsolete files)
Midas needs a command for toggling read-only and writeable modes
| Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Whiteboard: midas
Target Milestone: --- → mozilla1.3beta
| Assignee | ||
Comment 1•22 years ago
|
||
Charley reminds me of these things:
>be sure to implement it as another "nsSetDocumentStateCommand" command if it
>supports setting a state param. and use nsDocumentStateCommand if it simply
>reports state
I would guess that this is setting a state rather than reporting a state.| Assignee | ||
Comment 2•22 years ago
|
||
| Assignee | ||
Comment 3•22 years ago
|
||
Comment on attachment 111432 [details] [diff] [review] split document commands off into a separate file; add readonly cmd sfraser--can you look this over and give me some feedback? Note: much of the new file is copy/pasted from old file so some cleanup may be needed.
Attachment #111432 -
Flags: superreview?(sfraser)
Comment 4•22 years ago
|
||
+ // Should we fail if this param wasn't set?
+ // I'm not sure we should be that strict
+ if (NS_FAILED(rv))
+ return NS_OK;
I think if you're going to not do what the user asked, then you should return an
error value.
+ if (NS_SUCCEEDED(aParams->GetBooleanValue(STATE_ATTRIBUTE, &isReadOnly)))
+ {
+ PRUint32 flags;
+ editor->GetFlags(&flags);
+ if (isReadOnly)
+ flags |= nsIPlaintextEditor::eEditorReadonlyMask;
+ else
+ flags &= ~(nsIPlaintextEditor::eEditorReadonlyMask);
+
+ return NS_OK;
+ }
+
+ return NS_ERROR_FAILURE;
Don't you need to set the flags back on the editor? An early return would be
cleaner here too (return failure if GetBooleanValue() fails).
+ {
+
+ PRUint32 editorStatus = nsIEditingSession::eEditorErrorUnknown;
extra line.
+ nsCOMPtr<nsIEditingSession> editingSession = do_QueryInterface(refCon);
Need to say why the refcon for this command is an editingSession, and for the
other commands is an nsIEditor (see below).
+ // refCon is initially set to nsIEditingSession until editor
+ // is successfully created and source doc is loaded
Oh, there it is. Move the
+ nsCOMPtr<nsIEditingSession> editingSession = do_QueryInterface(refCon);
inside that scope.
| Assignee | ||
Comment 5•22 years ago
|
||
Attachment #111432 -
Attachment is obsolete: true
| Assignee | ||
Updated•22 years ago
|
Attachment #111432 -
Flags: superreview?(sfraser)
| Assignee | ||
Updated•22 years ago
|
Attachment #111627 -
Flags: review?(mkaply)
| Assignee | ||
Comment 6•22 years ago
|
||
Comment on attachment 111627 [details] [diff] [review] revised diff with fixes suggested by smfr mkaply--please review. note: commented out ifdefs will be removed once I've confirmed they build on windows/linux.
Comment 7•22 years ago
|
||
Comment on attachment 111627 [details] [diff] [review] revised diff with fixes suggested by smfr fyi this builds on windows with a Makefile.in change
Attachment #111627 -
Flags: superreview?(sfraser)
Attachment #111627 -
Flags: review?(mkaply)
Attachment #111627 -
Flags: review+
Updated•22 years ago
|
Attachment #111627 -
Flags: superreview?(sfraser) → superreview+
| Assignee | ||
Comment 8•22 years ago
|
||
obsoleting previous patch because it was checked in
Attachment #111627 -
Attachment is obsolete: true
| Assignee | ||
Comment 9•22 years ago
|
||
Comment on attachment 111792 [details] [diff] [review] add command registration seek reviews for missing command registration
Attachment #111792 -
Flags: superreview?(sfraser)
Attachment #111792 -
Flags: review?(mkaply)
Updated•22 years ago
|
Attachment #111792 -
Flags: superreview?(sfraser) → superreview+
Updated•22 years ago
|
Attachment #111792 -
Flags: review?(mkaply) → review+
| Assignee | ||
Comment 10•22 years ago
|
||
Comment on attachment 111792 [details] [diff] [review] add command registration obsoleting patch which is now checked in
Attachment #111792 -
Attachment is obsolete: true
| Assignee | ||
Comment 11•22 years ago
|
||
fixed
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•