nsI*Editor::OutputText(nsString& aOutputString);
nsI*Editor::OutputHTML(nsString& aOutputString);
These methods always returns back a Unicode version of whatever is in the content model. It is the
responsibility of the caller then to call whatever converter is required to convert to the appropriate
charset.
Added:
nsI*Editor::OutputText(nsIOutputStream* aOutputStream, nsString* aCharsetOverride = nsnull)
nsI*Editor::OutputHTML(nsIOutputStream* aOutputStream, nsString* aCharsetOverride = nsnull)
These methods output the the current content model to aOutputStream. The document is encoded using the
document defined charset or if the user passes in a non-null value for aCharsetOverride then this
encoding overrides the encoding used by the document.
git-svn-id: svn://10.0.0.236/trunk@29967 18797224-902f-48f8-a5cc-f745e15eee43
* added TextEditorTest.cpp, a unit test module for nsTextEditor. It's use is actually commented out since my checkin is happening so late due
to all-day build bustage, and I don't have a Mac handy to verify. With someone's Mac help tomorrow, I can turn it on.
* some minor bug fixes to property handling
git-svn-id: svn://10.0.0.236/trunk@27556 18797224-902f-48f8-a5cc-f745e15eee43
Split nsEditor::DeleteSelectionAndCreateNode into two parts,
so that routines like InsertImage which need to set attributes
on the new node before inserting into the tree can do so.
This is somewhat temporary, since the current method isn't undo-able;
undo will be implemented after M4.
git-svn-id: svn://10.0.0.236/trunk@26766 18797224-902f-48f8-a5cc-f745e15eee43
added aFirst out param to GetTextProperty, so the caller can know if the first character has the property in the case of aAny=true and aAll=false.
fixed a bunch of places where result was being used incorrectly as a return val from do_QueryInterface
some minor undo/redo fixes to split and join of interior nodes.
git-svn-id: svn://10.0.0.236/trunk@26218 18797224-902f-48f8-a5cc-f745e15eee43
anywhere any more.
* Cleaned up split and join undo/redo.
* Added TypeInState, a data struct that remembers things about text properties for collapsed selections, so you can type
* Ctrl-B with an insertion point and the next character will be bold.
* Added all the logic to handle inline vs. block elements when setting text properties.
* Added some support for italic and underline as well. Adding these things is pretty easy now. Ctrl-B, Ctrl-I, Ctrl-U for testing bold, italic, underline.
* Added all the logic to make sure we only add style tags where they're needed, so you should never get the same style tag nested within itself, except as needed for block elements.
* Added methods for testing a node to see if a particular style is set. This isn't 100% done yet, but with very little work we could have toolbar buttons that respond to selection changed notification that show the state of bold, italic, underline, etc. in real time. Supports tri-state: whole selection is bold, some of selection is bold, none of selection is bold, ...
* Fully undoable and redoable.
* Added some debug printfs to transactions and editors. all controlled by a gNoisy static in each module. helps me track down undo/redo problems. if the output bugs people enough, I'll shut it off and re-enable it in my local tree.
Noticably missing: make un-bold, make un-italic, etc. This is coming soon.
git-svn-id: svn://10.0.0.236/trunk@25869 18797224-902f-48f8-a5cc-f745e15eee43
justify the benefit. This is partly true because he and I would have had to integrate tonight before checking in, which we thought
presented some additional risk. In any event, this bug is fixed for all cases except when the user hits enter at the end of the
document. That is the only case in text editing when the selection will not render correctly.
Some related problems got fixed as a side benefit of my code changes. I filed bug 3896.
git-svn-id: svn://10.0.0.236/trunk@24254 18797224-902f-48f8-a5cc-f745e15eee43
made a special case for typing with BR as the selection (as after an InsertBreak.)
made DEL and BACKSPACE at the beginning and end of a text node
fixes bugs 3742 and 3756 (with permission from choff and gkostello)
git-svn-id: svn://10.0.0.236/trunk@24209 18797224-902f-48f8-a5cc-f745e15eee43
the text edit rule object can maintain it's own state more efficiently and correctly.
git-svn-id: svn://10.0.0.236/trunk@24160 18797224-902f-48f8-a5cc-f745e15eee43
and merges in subsequent transactions indiscriminately until it's told to stop.
It also gives the last transaction in its child list a chance to merge the
next transaction.
All this is in support of complex transactions that result in text insertion
being able to collapse into a single undoable event.
Also improved tracking of bogus content node used when document is empty.
git-svn-id: svn://10.0.0.236/trunk@24151 18797224-902f-48f8-a5cc-f745e15eee43
attribute MOZ_EDITOR_BOGUS_NODE set to TRUE. this solves the problem of when you do a SelectAll then a DEL, you don't have a cursor
or any way to set selection in the document. You do still have the problem that the nbsp is pretty narrow and the frame containing it is hard to hit
with the mouse. We really need the "set selection to frame nearest the mouse down point" operation.
the intent is for all inserts to look for this node, and if found delete it before the insert. likewise, all deletes will be no-ops if this node is found.
git-svn-id: svn://10.0.0.236/trunk@23836 18797224-902f-48f8-a5cc-f745e15eee43
and kCTransactionManagerFactoryCID to NS_TRANSACTIONMANAGER_CID
and kCTransactionManagerCID.
git-svn-id: svn://10.0.0.236/trunk@23570 18797224-902f-48f8-a5cc-f745e15eee43
Added nsEditor::DoInitialInsert() for doing first insert into an empty document. Try typing into <html><body></body></html>
Added some smarts to DeleteSelectionAndCreateNode() so it only splits the selected node when appropriate (when the selection is not at offset 0 or max)
CreateElementTxn now creates text nodes as well as DOM elements
git-svn-id: svn://10.0.0.236/trunk@23540 18797224-902f-48f8-a5cc-f745e15eee43