-
Book Overview & Buying
-
Table Of Contents
C++ Windows Programming
By :
A document in this application is made up of pages, paragraphs, lines, and characters. Let me try to explain how it all hangs together:
First of all, the document is made up of a list of characters. Each character has its own font and pointers to the paragraph and line it belongs to. The character information is stored in objects of the CharInfo class. The charList field in the WordDocument class is a list of CharInfo objects.
The characters are divided into paragraphs. A paragraph does not hold its own character list. Instead, it holds the indexes in the character list of its first and last characters. The paragraphList field in WordDocument is a list of Paragraph objects. The last character of each paragraph is always a newline.
Each paragraph is divided into a list of lines. The Paragraph class below holds a list of Line objects. A line holds the indexes of its first and last characters relative to the beginning of the paragraph.
Finally, the document is also divided into...