ooo-build r14866 - trunk/doc



Author: michael
Date: Tue Dec 16 10:54:43 2008
New Revision: 14866
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14866&view=rev

Log:
first cut


Added:
   trunk/doc/sw.txt

Added: trunk/doc/sw.txt
==============================================================================
--- (empty file)
+++ trunk/doc/sw.txt	Tue Dec 16 10:54:43 2008
@@ -0,0 +1,110 @@
+How to understand the writer core:
+
+* What does a document look like ?
+
+	"Hello <b>World</b>\nParagraph 2\n"
+
+-------------------------- basics --------------------------
+
+* here goes:
+
+sw/inc/doc.hxx (class SwDoc):
+
+	SwNodes		aNodes;    - the contents of the document
+	SwAttrPool	aAttrPool; - default document properties; from SfxPoolItem
+	SwUndoNodes     aUndoNodes; - undo nodes.
+
+SwNodes -> BigPtrArray (inc/ndarr.hxx)
+
+sw/inc/node.hxx (SwNode):
+
+	+ then 'SwCntntNode' (content node)
+
+sw/inc/ndtxt.hxx (class SwTxtNode)
+	XubString	aText;   => "Hello World"
+	SwpHints	*pSwpHints;   (inc/ndhints.hxx)
+		+ "not a hint" - it's the real document attribute data.
+		+ means 'Attributes'
+		+ eg. (6,10, "bold")
+
+	friend of SwpHints::BuildPortions
+		+ a portion - something the layout does;
+			+ builds a portion; 
+
+Key concept:
+	+ Portion + - a uniform run of text with the same attributes
+		+ ie. 2 runs for "Hello", <b>"World"</b>
+
+	Another interesting impl.
+		+ SwpHints::Insert (SwTxtAttr *, SwTxtNode &, USHORT);
+		+ inserts tripples : this automatically merges sub-'Hints'
+
+
+-------------------------- problems --------------------------
+
+* 65k - for para length.
+	+ problems with line breaks. <shift>Enter
+		+ from HTML <br> instead of <p> - a nightmare.
+	+ extra logic for:
+		+ cursor extends before the 'H' of hello world; hit enter.
+		+ paragraph - split it to two;
+			+ SplitCntntNode ...
+			+ all kinds of magic - splitting the attributes too.
+				+ now consistent (?)
+
+* Undo:
+	+ as you change a node, copied to the aUndoNodes
+		+ implemented with copy/paste - same code.
+		+ select entire para, copy into undo, then split the para,
+		+ then keep a stack, of what need to do to undo.
+
+	+ There is a single huge "un-do document" lurking in the background.
+
+	* Try - turn on red-lining; want to track changes,
+		+ also want to see original document.
+		+ As you type: Writer copies in all the redlining; makes the
+		  modification; updates it; copies the differences back.
+			+ magic alert box - do something different...
+
+* Sections:
+	+ (inc/node.hxx) SwSectionNode derived from 'SwStartNode'
+		+ implemented when everyone wanted to be an HTML editor
+		+ web editor & web viewer - Brauer implementation +
+			+ like a <div> tag.
+	+ mutual pointers to each other.
+
+* Tables:
+	+ (inc/node.hxx) SwTableNode (an SwStartNode)
+		+ completed by the 'SwEndNode'
+		+ 'Frame' is a layout object ...
+			+ 'SwFrm' - everything based on this
+				+ ptr to child / parent / rectangle
+		+ design nightmare:
+			+ layout in model is necessary to do some
+			  internal navigation
+		+ the real table content appears just like a flat
+		  document between; *but*:
+
+	+ SwTable (inc/swtable.hxx):
+		+ this stores pointers to the underlying paragraphs
+		  for rows / columns.
+
+	+ 
+
+
+
+* Red-lining ...
+	+ have a copy of the document; 
+		+ the problem - splitting paragraphs; track that we split
+		  a paragraph
+		+ 
+
+
+-------------------------- problems --------------------------
+
+
+
+		+ BigPtrArray
+			+ 'SwNode' / 'SwDoc'
+			+ sw/inc/node.hxx -> sw/source/core/docnode/node.cxx
+			+ sw/inc/doc.hxx -> 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]