1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
test()22 void test()
23 {
24     portion = appendPortion("text");
25     tableContext = new TableContext();
26     {
27         tableStack.push(tableContext);
28         portion = appendPortion("A1");
29         tableContext.addPortion(portion);
30         tableContext.endCell();
31         portion = appendPortion("B1");
32         tableContext.addPortion(portion);
33         tableContext.endCell();
34         portion = appendPortion("C1");
35         tableContext.addPortion(portion);
36         tableContext.endCell();
37         tableContext.endRow(rowProperties);
38         portion = appendPortion("A2");
39         tableContext.addPortion(portion);
40         tableContext.endCell();
41         tableContext = new TableContext();
42         {
43             tableStack.push(tableContext);
44             portion = appendPortion("B2A1");
45             tableContext.addPortion(portion);
46             tableContext.endCell();
47             portion = appendPortion("B2B1");
48             tableContext.addPortion(portion);
49             tableContext.endCell();
50             tableContext.endRow(rowProperties);
51             portion = appendPortion("B2A2");
52             tableContext.addPortion(portion);
53             tableContext.endCell();
54             portion = appendPortion("B2B2");
55             tableContext.addPortion(portion);
56             tableContext.endCell();
57             tableContext.endRow(rowProperties);
58         }
59         portion = createTable(tableContext);
60         tableContext = tableStack.pop();
61         tableContext.addPortion(portion);
62         portion = appendPortion("B2");
63         tableContext.addPortion(portion);
64         tableContext.endCell();
65         portion = appendPortion("C2");
66         tableContext.addPortion(portion);
67         tableContext.endCell();
68         tableContext.endRow(rowProperties);
69     }
70     portion = createTable(tableContext);
71     portion = appendPortion("text");
72 }
73 
74 /*
75   tableContext.endCell:
76     merge text ranges of portions to one and add this range to ranges of row.
77  */
78