summaryrefslogtreecommitdiff
path: root/writerfilter/documentation/AddingTable.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'writerfilter/documentation/AddingTable.cxx')
-rw-r--r--writerfilter/documentation/AddingTable.cxx56
1 files changed, 56 insertions, 0 deletions
diff --git a/writerfilter/documentation/AddingTable.cxx b/writerfilter/documentation/AddingTable.cxx
new file mode 100644
index 000000000000..faa898a62350
--- /dev/null
+++ b/writerfilter/documentation/AddingTable.cxx
@@ -0,0 +1,56 @@
+void test()
+{
+ portion = appendPortion("text");
+ tableContext = new TableContext();
+ {
+ tableStack.push(tableContext);
+ portion = appendPortion("A1");
+ tableContext.addPortion(portion);
+ tableContext.endCell();
+ portion = appendPortion("B1");
+ tableContext.addPortion(portion);
+ tableContext.endCell();
+ portion = appendPortion("C1");
+ tableContext.addPortion(portion);
+ tableContext.endCell();
+ tableContext.endRow(rowProperties);
+ portion = appendPortion("A2");
+ tableContext.addPortion(portion);
+ tableContext.endCell();
+ tableContext = new TableContext();
+ {
+ tableStack.push(tableContext);
+ portion = appendPortion("B2A1");
+ tableContext.addPortion(portion);
+ tableContext.endCell();
+ portion = appendPortion("B2B1");
+ tableContext.addPortion(portion);
+ tableContext.endCell();
+ tableContext.endRow(rowProperties);
+ portion = appendPortion("B2A2");
+ tableContext.addPortion(portion);
+ tableContext.endCell();
+ portion = appendPortion("B2B2");
+ tableContext.addPortion(portion);
+ tableContext.endCell();
+ tableContext.endRow(rowProperties);
+ }
+ portion = createTable(tableContext);
+ tableContext = tableStack.pop();
+ tableContext.addPortion(portion);
+ portion = appendPortion("B2");
+ tableContext.addPortion(portion);
+ tableContext.endCell();
+ portion = appendPortion("C2");
+ tableContext.addPortion(portion);
+ tableContext.endCell();
+ tableContext.endRow(rowProperties);
+ }
+ portion = createTable(tableContext);
+ portion = appendPortion("text");
+}
+
+/*
+ tableContext.endCell:
+ merge text ranges of portions to one and add this range to ranges of row.
+ */