This is actually a major reworking of how the low level editor txns perturb selection. There is a mode now for telling the txns not to disturb the selection. There is also a fix for unlisting lists (sometimes list items got merged unintentionally when unlisting).
git-svn-id: svn://10.0.0.236/trunk@56714 18797224-902f-48f8-a5cc-f745e15eee43
added some assertions and error checking to nsEditor::Do, no bug #, r=kin
fixed bug 14898 (implemented type-in state for any context), r=jfrancis
git-svn-id: svn://10.0.0.236/trunk@50004 18797224-902f-48f8-a5cc-f745e15eee43
Added some comments of the form "// XXX: ERROR_HANDLING <explanation>"
wherever I saw a potential error but wasn't 100% sure of the intention of the code.
Fixed a few bugs along the way.
git-svn-id: svn://10.0.0.236/trunk@43590 18797224-902f-48f8-a5cc-f745e15eee43
NS_DEFINE_IID macros in favor of GetCID() wherever I could.
plus some minor bug fixes.
git-svn-id: svn://10.0.0.236/trunk@39546 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
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
most transactions now properly set selection after modifying content, for Do, Undo, Redo.
lots of cleanup and minor bug fixes.
git-svn-id: svn://10.0.0.236/trunk@21466 18797224-902f-48f8-a5cc-f745e15eee43
* the TxnMgr is invoked by the editor via nsRepository
* editor.h|cpp have been renamed nsEditor.h|cpp for consistency
* editorInterfaces.h|cpp have been renamed nsEditorEventListeners.c|hpp
* added nsITextEditor.h, nsTextEditor.h|cpp. The text editor is a placeholder for the rules unique to text
editing. It invokes the nsIEditor to do core editing operations.
* reworked nsIEditor and related interfaces as per emerging design.
* nsEditor::BeginTransaction and EndTransaction call nsTransactionManager::BeginBatch and EndBatch.
git-svn-id: svn://10.0.0.236/trunk@20562 18797224-902f-48f8-a5cc-f745e15eee43
external interface for selection (to be IDL-ified later).
Fix some editor bugs:
- Advance the cursor on text insert (so text is inserted in the right order)
- Make DeleteSelection in the editor call the actual selection
- Make DeleteSelection update the frames' notion of the selection
git-svn-id: svn://10.0.0.236/trunk@19029 18797224-902f-48f8-a5cc-f745e15eee43
this needs to get beefed up to handle offsets within elements, which we'll
do as soon as selection is set properly following an insertion.
git-svn-id: svn://10.0.0.236/trunk@18931 18797224-902f-48f8-a5cc-f745e15eee43
* added DeleteSelection to editor. Doesn't work very well yet because selection is giving me random offsets into text content.
* lots of work in the various transactions.
git-svn-id: svn://10.0.0.236/trunk@18122 18797224-902f-48f8-a5cc-f745e15eee43