Closed Bug 136774 Opened 24 years ago Closed 23 years ago

Can't create plaintext editor through embedding API

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.0.1

People

(Reporter: mcguirk, Assigned: mjudge)

References

Details

Attachments

(2 files, 2 obsolete files)

I'd like to create a plaintext editor using the embedding APIs, but this doesn't appear to be possible. (nsEditingSession::SetupEditorOnWindow has the HTML editor contract ID hardcoded.) I can create the HTML editor and then set the eEditorPlaintextMask flag using nsIEditor::SetFlags, but that's not the same thing.
Confirming.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 2000 → All
Hardware: PC → All
Reassigning.
Assignee: adamlock → sfraser
->saari
Assignee: sfraser → saari
-> mjudge
Assignee: saari → mjudge
moving to 1.01
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0.1
Blocks: 157104
changing component so this shows up in Syd's editor embedding queries
Component: Embedding: APIs → Editor: Core
patched from mozilla/editor/composer
Comment on attachment 102232 [details] [diff] [review] patch to flow through editortype to the actual editor flags as well as the classid if the string passed in is null, do we want to create html by default and return an error? Interestingly, in editorShell, a plaintext editor is never really created; it always creates an html editor The comment in the idl file should be changed to match up with the editor types we accept (htmlmail, textmail, html, text for now) We need to handle the case of "textmail" which is an htmleditor but has the mailmask flag (see editorshell). I don't see any need to add "aEditorType" to setupEditorOnWindow; it isn't used there.
Attachment #102232 - Flags: needs-work+
working with cmanske to fix this
fixes kathy's issues. adds smarts for textmail. Also leaves door open for further additions of different types of editors. Right now I still keep the mEditorType string in there even though they all use the same. This is because we may need to change this soon for embedders.
Attachment #102232 - Attachment is obsolete: true
Attachment #102240 - Attachment is obsolete: true
Comment on attachment 102282 [details] [diff] [review] patch from editor/composer >Index: src/nsEditingSession.cpp >=================================================================== >-nsEditingSession::MakeWindowEditable(nsIDOMWindow *aWindow, PRBool inDoAfterUriLoad) >+nsEditingSession::MakeWindowEditable(nsIDOMWindow *aWindow, const char *aEditorType, PRBool inDoAfterUriLoad) > { >+ PRBool htmlController = PR_FALSE; >+ mEditorType = nsnull; >+ mEditorFlags = 0; >+ mEditorType = "@mozilla.org/editor/htmleditor;1"; Maybe add a comment here that this is transitional. >+ const char *editortype = nsnull; Unused code? sr=jag with these nits addressed.
Attachment #102282 - Flags: superreview+
fixes stuff from jags comments. remove dead code and added a comment
Attachment #102282 - Attachment is obsolete: true
Comment on attachment 102284 [details] [diff] [review] patch from editor/composer carrying over SR
Attachment #102284 - Flags: superreview+
Comment on attachment 102282 [details] [diff] [review] patch from editor/composer why not use : mDoneSetup(PR_FALSE) , mEditorType(nsnull in the constructor? I wonder if you should call mEditorType something else since it's not the same as the passed in aEditorType ? mEditorComponent ?
Attachment #102282 - Attachment is obsolete: false
Attachment #102282 - Flags: needs-work+
ok no prob I will make changes before commiting.
Comment on attachment 102284 [details] [diff] [review] patch from editor/composer r=cmanske, but please consider the comments I mentioned in previous patch. Note that I actually tested this for Composer in an experimental build that has no editorShell. But my Mail tree is hosed so I couldn't test that part.
Attachment #102284 - Flags: review+
QA Contact: mdunn → depstein
resolving this as fixed since Mike says he checked it in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Patch verified against Mozilla 1.2b Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2b) Gecko/20021026 build. mEditorType is now mEditorClassString and (const char *editortype = null) line was removed.
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: