xref: /AOO41X/main/writerfilter/documentation/AddingTable.cxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 void test()
2 {
3     portion = appendPortion("text");
4     tableContext = new TableContext();
5     {
6         tableStack.push(tableContext);
7         portion = appendPortion("A1");
8         tableContext.addPortion(portion);
9         tableContext.endCell();
10         portion = appendPortion("B1");
11         tableContext.addPortion(portion);
12         tableContext.endCell();
13         portion = appendPortion("C1");
14         tableContext.addPortion(portion);
15         tableContext.endCell();
16         tableContext.endRow(rowProperties);
17         portion = appendPortion("A2");
18         tableContext.addPortion(portion);
19         tableContext.endCell();
20         tableContext = new TableContext();
21         {
22             tableStack.push(tableContext);
23             portion = appendPortion("B2A1");
24             tableContext.addPortion(portion);
25             tableContext.endCell();
26             portion = appendPortion("B2B1");
27             tableContext.addPortion(portion);
28             tableContext.endCell();
29             tableContext.endRow(rowProperties);
30             portion = appendPortion("B2A2");
31             tableContext.addPortion(portion);
32             tableContext.endCell();
33             portion = appendPortion("B2B2");
34             tableContext.addPortion(portion);
35             tableContext.endCell();
36             tableContext.endRow(rowProperties);
37         }
38         portion = createTable(tableContext);
39         tableContext = tableStack.pop();
40         tableContext.addPortion(portion);
41         portion = appendPortion("B2");
42         tableContext.addPortion(portion);
43         tableContext.endCell();
44         portion = appendPortion("C2");
45         tableContext.addPortion(portion);
46         tableContext.endCell();
47         tableContext.endRow(rowProperties);
48     }
49     portion = createTable(tableContext);
50     portion = appendPortion("text");
51 }
52 
53 /*
54   tableContext.endCell:
55     merge text ranges of portions to one and add this range to ranges of row.
56  */
57