52 Commits

Author SHA1 Message Date
mcafee%netscape.com
b65f92a67b Initializing some variables, protecting a null reference.
git-svn-id: svn://10.0.0.236/trunk@25983 18797224-902f-48f8-a5cc-f745e15eee43
1999-04-02 01:34:05 +00:00
sfraser%netscape.com
e51ed48fbd Call the new presshell->SetCaretEnabled() call to show the caret when
editing.


git-svn-id: svn://10.0.0.236/trunk@25956 18797224-902f-48f8-a5cc-f745e15eee43
1999-04-02 00:01:31 +00:00
buster%netscape.com
0fe8e1324d As a reminder, we decided to do this based strictly content. Some support for style-based text properties is written, but not used
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
1999-04-01 17:58:07 +00:00
rods%netscape.com
3d9eafaa3c Fixed up new ifdef'ed clipboard support
git-svn-id: svn://10.0.0.236/trunk@25848 18797224-902f-48f8-a5cc-f745e15eee43
1999-04-01 14:28:13 +00:00
rods%netscape.com
1e195c10d5 Minor changes to call to new clipboard
git-svn-id: svn://10.0.0.236/trunk@25220 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-26 15:49:28 +00:00
mcafee%netscape.com
78f453eef5 Renamed GetTransferable() to GetData()
git-svn-id: svn://10.0.0.236/trunk@25139 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-25 23:39:03 +00:00
mcafee%netscape.com
6a5c4e0f48 initializing a variable to zero.
git-svn-id: svn://10.0.0.236/trunk@24988 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-24 09:08:24 +00:00
mcafee%netscape.com
83d83ef5df Checking for null references on clipboard, trans (gtk/unix).
git-svn-id: svn://10.0.0.236/trunk@24940 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-24 01:43:46 +00:00
rods%netscape.com
f82195869f Added code for switching over Clipboard support to new classes
At the moment the are ifdef'ed out


git-svn-id: svn://10.0.0.236/trunk@24843 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-23 15:45:58 +00:00
buster%netscape.com
041f73c845 I fixed the content twiddling part of bug 3778. Mike has a fix for the display part of it in his tree, but determined the risk didn't
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
1999-03-17 06:13:46 +00:00
buster%netscape.com
8851e742d6 fixed join.
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
1999-03-16 16:38:09 +00:00
buster%netscape.com
506d9a9565 added WillUndo, DidUndo, WillRedo, DidRedo and some supporting code so
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
1999-03-15 05:08:30 +00:00
buster%netscape.com
ef5f3265cc added PlaceholderTxn. This is an aggregate transaction that sits on the undo stack
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
1999-03-15 00:57:32 +00:00
kostello%netscape.com
200ff1e40c Add HACKForceRedraw() to force a redraw until the drawing
problems are solved in Gecko


git-svn-id: svn://10.0.0.236/trunk@24088 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 00:31:35 +00:00
buster%netscape.com
c40ea0b1ef InsertBreak now works at the beginning of a line. Plus a trivial bug fix.
git-svn-id: svn://10.0.0.236/trunk@24057 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 05:31:22 +00:00
buster%netscape.com
b6be8ea31d deleting the last editable object in a document now causes a bogus placeholder <P>&nbsp;</P> to be added to the document. This node has the
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
1999-03-12 02:28:24 +00:00
akkana%netscape.com
5aedc09286 Change the reference to the global selection mgr to fix windows build
git-svn-id: svn://10.0.0.236/trunk@23608 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 00:08:10 +00:00
akkana%netscape.com
f28253683c Comment out debug prints
git-svn-id: svn://10.0.0.236/trunk@23595 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:50:51 +00:00
akkana%netscape.com
a6feb40744 Implement editor cut/copy/paste
git-svn-id: svn://10.0.0.236/trunk@23593 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:46:15 +00:00
sfraser%netscape.com
0a1636794b Add Cut, Copy and Paste to editor interfaces and classes, with a stub implemenatioon in nsEditor.
git-svn-id: svn://10.0.0.236/trunk@23571 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:29:41 +00:00
kin%netscape.com
dd9bfaeb94 Changed all occurences of NS_TRANSACTION_MANAGER_FACTORY_CID
and kCTransactionManagerFactoryCID to NS_TRANSACTIONMANAGER_CID
and kCTransactionManagerCID.


git-svn-id: svn://10.0.0.236/trunk@23570 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:27:02 +00:00
buster%netscape.com
d859f3e58c Implemented SelectAll.
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
1999-03-10 19:48:13 +00:00
cmanske%netscape.com
fc43b4f0d4 2nd try to get it right in get editor factory method
git-svn-id: svn://10.0.0.236/trunk@23400 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:06:16 +00:00
cmanske%netscape.com
70947d83ca Fixed editor registration and startup problems
git-svn-id: svn://10.0.0.236/trunk@23398 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:52:24 +00:00
warren%netscape.com
e082c74dc0 Backed out the nsService template stuff.
git-svn-id: svn://10.0.0.236/trunk@23320 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 11:49:41 +00:00
warren%netscape.com
0b33372d99 nsRepository -> nsIComponentManager changes.
git-svn-id: svn://10.0.0.236/trunk@23300 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 09:44:27 +00:00
cmanske%netscape.com
dea2088bcb Fixed editor classes to do autoregistration correctly and moved target directory to bin/components
git-svn-id: svn://10.0.0.236/trunk@23216 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 22:46:33 +00:00
cmanske%netscape.com
6987407539 Changed editor classes to inherited model. Fixed lots of destructor warnings.
git-svn-id: svn://10.0.0.236/trunk@22944 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:05:35 +00:00
scc%netscape.com
817f56596f rename |IID()| --> |GetIID()|
git-svn-id: svn://10.0.0.236/trunk@22744 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 19:48:57 +00:00
mjudge%netscape.com
86f2920385 fixes for selection code, batching at correct point
git-svn-id: svn://10.0.0.236/trunk@22674 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:51:59 +00:00
scc%netscape.com
84d4e393bc fixed for nsCOMPtr: no construction or assignment from raw COM interface pointers
git-svn-id: svn://10.0.0.236/trunk@22609 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 22:27:46 +00:00
buster%netscape.com
19e607046b implemented GetTextProperty -- only works for bold and italic now,
trivial to add more properties
finished first cut at SetTextProperty.  This triggers lots of crashes in
range/selection code where we're holding onto a stale frame pointer (at
least, that's my best guess.)
synched with Charlie's change-o-rama
added an assert in DeleteTextTxn::Init() checking aNumCharsToDelete vs.
0
  NS_ASSERTION(0!=aNumCharsToDelete, "bad arg, numCharsToDelete");
if the number of chars to delete is 0, we shouldn't be creating a
transaction at all.  I had never seen this condition arise before
Charlie's checkin, I don't know if he introduced it or if it was a
latent bug I just never tripped over before.


git-svn-id: svn://10.0.0.236/trunk@22543 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 07:52:41 +00:00
cmanske%netscape.com
202c5b89dc Implemented nsHTMLEditor. Changed prototypes to be use NS_IMETHOD and NS_IMETHODIMP. Started table editing transactions
git-svn-id: svn://10.0.0.236/trunk@22534 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 05:30:53 +00:00
ebina%netscape.com
f3c0c2ca83 Changing RegisterFactory to use the new API.
git-svn-id: svn://10.0.0.236/trunk@22111 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-26 15:59:52 +00:00
warren%netscape.com
49ed8e046f Changes for RDF component registration using nsRepository. Also changed args to NSGetFactory and friends.
git-svn-id: svn://10.0.0.236/trunk@22094 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-26 10:17:14 +00:00
buster%netscape.com
7218a4a579 added InsertElementTxn
added nsEditProperty
beginning of implementation for SetTextProperties.  Currently, it only works if the selection is entirely within a single text node.  Currently only
supports bold and italic (mapped to ctrl-b and ctrl-i for testing purposes.)
changed a bunch of interfaces to make things easier, like CreateElement now returns (as an out-param) the element created.


git-svn-id: svn://10.0.0.236/trunk@21760 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-24 17:24:37 +00:00
warren%netscape.com
cb10d9f3a0 Cleaned up nsICollection and nsIEnumerator. Broke out nsIBidirectionalEnumerator. Added ISupportsArray enumerator. Cleaned nsISupportsArray.
git-svn-id: svn://10.0.0.236/trunk@21585 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-23 08:10:24 +00:00
buster%netscape.com
fb7ad5c58c caught up to new ScrollIntoView changes.
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
1999-02-22 15:53:31 +00:00
mjudge%netscape.com
988ca9603d depricating the ScrollIntoView call. dont need it. the selection modification assures us of scrolling to view after batching.
git-svn-id: svn://10.0.0.236/trunk@21430 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-21 03:48:52 +00:00
buster%netscape.com
4df8a07f61 beginning work on ScrollToFrame
git-svn-id: svn://10.0.0.236/trunk@21408 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-20 21:29:27 +00:00
mcafee%netscape.com
92753a46b3 Solaris: adding do_QueryInterface() wrappers to finish scc's nsCOMPtr carpool. a=scc
git-svn-id: svn://10.0.0.236/trunk@21297 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-19 11:30:31 +00:00
mcafee%netscape.com
0434d32b61 Adding do_QueryInterface() wrapper for Solaris, this is the other part of scc's nsCOMPtr carpool
git-svn-id: svn://10.0.0.236/trunk@21232 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-18 23:18:56 +00:00
buster%netscape.com
0a8d990683 work in progress
git-svn-id: svn://10.0.0.236/trunk@21229 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-18 23:01:06 +00:00
buster%netscape.com
f62022c72f Highlights:
updated to new nsCOMPtr usage
nsTextEditor::InsertBreak() implemented
  splits the text node at the caret (deletes any extended selection to force a collapsed selection.)
  inserts a <BR> which I assume we'll convert to a CR when we write to a text stream.
  undo and redo work, except for the bug noted below

More stuff:
interface cleanup
strategic debugging code added
delete selection txn sets the collapses the selection...this is just a placeholder, but I needed it for undo/redo of InsertBreak.
join and split now work for text nodes as well as interior nodes


git-svn-id: svn://10.0.0.236/trunk@21009 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-17 19:42:29 +00:00
danm%netscape.com
9d9fe04c5a fixing compilation problems with new nsCOMPtr. part of the carpool.
git-svn-id: svn://10.0.0.236/trunk@20899 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-17 06:18:11 +00:00
mjudge%netscape.com
935f3ddcd6 new modifications to nsCOMPtr to explicitly change to QueryInterface
git-svn-id: svn://10.0.0.236/trunk@20849 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-17 01:59:56 +00:00
buster%netscape.com
0bda0d910f minor fixes and lots of comments
git-svn-id: svn://10.0.0.236/trunk@20730 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-15 18:25:30 +00:00
sfraser%netscape.com
971ead2abc Cause the caret to become visible in the presentation shell when instantiating an editor.
git-svn-id: svn://10.0.0.236/trunk@20658 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-13 04:48:09 +00:00
buster%netscape.com
bd7d899204 changed deleteSelection back to not use the range
git-svn-id: svn://10.0.0.236/trunk@20608 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-12 19:36:18 +00:00
buster%netscape.com
34595f93fb changed DeleteSelection back to using nsIDOMRange directly.
git-svn-id: svn://10.0.0.236/trunk@20572 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-12 18:09:38 +00:00