Auxiliary classes
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. ThecharList
field in theWordDocument
class is a list ofCharInfo
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 inWordDocument
is a list ofParagraph
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 ofLine
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...