1 All paragraphs in tables:
4 0x2416 (sprmPFInTable) indicates a paragraph is in a table
5 0x6649 (sprmPTableDepth) demarks the nesting depth of the paragraph
7 paragraph at nesting depth 1:
10 end of row: 0x7 + sprm 0x2417(sprmFTtp)
12 the end of a row has its own 0x7
14 paragraphs at nesting depth > 1;
16 end of cell: 0xd + sprm 0x244b(sprmPCell)
17 end of row 0xd + sprm 0x244b(sprmPCell) + sprm 0x244c(sprmPRow)
19 the end of a row has its own 0xd
21 Algorithm to detect table structure:
27 // return number of cells in row
29 // get handle for start of cell i
31 // get handle for end off cell i
32 Properties getProperties()
33 // return properties of row
36 void addCell(Handle start, Handle end)
37 // insert cell starting at start and ending at end into the
39 void endRow(properties)
40 // end current row and save properties for that row, begin new row
42 // return number of rows in table
43 RowData<Handle> getRow(i)
47 depth in table hierarchy of previous paragraph
50 depth in table hierarchy of current paragraph
53 true if current paragraph is in a cell
56 true if current paragraph if the last paragraph of a cell
59 true if current paragraph is the end of a row
62 handle for current paragraph
65 create stack of TableData<Handle>
68 handle remaining TableData<Handle> on stack
70 creating StreamHandler:
71 push new TableData<Handle> on stack
73 destroying StreamHandler:
74 handle TableData<Handle> on top of stack
75 pop TableData<Handle> from stack
77 StreamHandler::substream:
78 push new TableData<Handle> on stack
79 handle TableData<Handle> on top of stack
80 pop TableData<Handle> from stack
82 starting paragraph group:
83 paragraphHandle = currentHandle;
88 ending paragraph group:
89 difference = curTableDepth - prevTableDepth
92 push difference new TableData<Handle> onto stack
93 else if (difference < 0)
95 repeat difference times
101 precTableDepth = curTableDepth
105 if (handleStart is null)
106 handleStart = paragraphHandle;
110 stack.top().addCell(handleStart, paragraphHandle);
116 stack.top().endRow(properties)
120 in StreamHandler::props:
123 PropertiesHandler::sprm:
125 save value in curTableDepth