]> granicus.if.org Git - multimarkdown/commitdiff
ADDED: Add TOC support to ODF
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 4 Mar 2017 14:15:13 +0000 (09:15 -0500)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 4 Mar 2017 14:15:13 +0000 (09:15 -0500)
Sources/libMultiMarkdown/odf.c
tests/MMD6Tests/Table of Contents.fodt [new file with mode: 0644]
tests/MMD6Tests/Tables.fodt [new file with mode: 0644]

index 46b9626dc80d1195ebb07f82a45eebf5ab244163..5a349d57aef0f28cee4d451a5f84176690cd2704 100644 (file)
@@ -547,6 +547,149 @@ void mmd_export_token_odf(DString * out, const char * source, token * t, scratch
                        print_const("</text:p>");
                        scratch->padded = 0;
                        break;
+               case BLOCK_TABLE:
+                       pad(out, 2, scratch);
+                       print_const("<table:table>\n");
+
+                       scratch->padded = 2;
+                       read_table_column_alignments(source, t, scratch);
+
+                       for (int i = 0; i < scratch->table_column_count; ++i)
+                       {
+                               print_const("<table:table-column/>\n");
+//                             switch (scratch->table_alignment[i]) {
+//                                     case 'l':
+//                                             print_const("<col style=\"text-align:left;\"/>\n");
+//                                             break;
+//                                     case 'L':
+//                                             print_const("<col style=\"text-align:left;\" class=\"extended\"/>\n");
+//                                             break;
+//                                     case 'r':
+//                                             print_const("<col style=\"text-align:right;\"/>\n");
+//                                             break;
+//                                     case 'R':
+//                                             print_const("<col style=\"text-align:right;\" class=\"extended\"/>\n");
+//                                             break;
+//                                     case 'c':
+//                                             print_const("<col style=\"text-align:center;\"/>\n");
+//                                             break;
+//                                     case 'C':
+//                                             print_const("<col style=\"text-align:center;\" class=\"extended\"/>\n");
+//                                             break;
+//                                     default:
+//                                             print_const("<col />\n");
+//                                             break;
+//                             }
+                       }
+                       scratch->padded = 1;
+
+                       mmd_export_token_tree_odf(out, source, t->child, scratch);
+                       pad(out, 1, scratch);
+                       print_const("</table:table>\n");
+
+                       // Are we followed by a caption?
+                       if (table_has_caption(t)) {
+                               temp_token = t->next->child;
+
+                               if (temp_token->next &&
+                                       temp_token->next->type == PAIR_BRACKET) {
+                                       temp_token = temp_token->next;
+                               }
+
+                               temp_char = label_from_token(source, temp_token);
+                               printf("<text:p><text:bookmark text:name=\"%s\"/>Table <text:sequence text:name=\"Table\" text:formula=\"ooow:Table+1\" style:num-format=\"1\"> Update Fields to calculate numbers</text:sequence>:", temp_char);
+
+                               t->next->child->child->type = TEXT_EMPTY;
+                               t->next->child->child->mate->type = TEXT_EMPTY;
+                               mmd_export_token_tree_odf(out, source, t->next->child->child, scratch);
+
+                               printf("<text:bookmark-end text:name=\"%s\"/></text:p>\n", temp_char);
+
+                               free(temp_char);
+                               temp_short = 1;
+                       } else {
+                               temp_short = 0;
+                       }
+
+                       scratch->padded = 0;
+                       scratch->skip_token = temp_short;
+
+                       break;
+               case BLOCK_TABLE_HEADER:
+                       pad(out, 2, scratch);
+                       scratch->in_table_header = 1;
+                       mmd_export_token_tree_odf(out, source, t->child, scratch);
+                       scratch->in_table_header = 0;
+                       scratch->padded = 1;
+                       break;
+               case BLOCK_TABLE_SECTION:
+                       pad(out, 2, scratch);
+                       scratch->padded = 2;
+                       mmd_export_token_tree_odf(out, source, t->child, scratch);
+                       scratch->padded = 0;
+                       break;
+               case BLOCK_TOC:
+                       temp_short = 0;
+                       temp_short2 = 0;
+                       pad(out, 2, scratch);
+
+                       for (int i = 0; i < scratch->header_stack->size; ++i)
+                       {
+                               temp_token = stack_peek_index(scratch->header_stack, i);
+
+                               if (temp_token->type == temp_short2) {
+                                       // Same level -- close list item
+                                       print_const("</text:list-item>\n");
+                               }
+
+                               if (temp_short == 0) {
+                                       // First item
+                                       print_const("\n<text:list text:style-name=\"L1\">\n");
+                                       temp_short = temp_token->type;
+                                       temp_short2 = temp_short;
+                               }
+
+                               // Indent?
+                               if (temp_token->type == temp_short2) {
+                                       // Same level -- NTD
+                               } else if (temp_token->type == temp_short2 + 1) {
+                                       // Indent
+                                       print_const("\n\n<text:list text:style-name=\"L1\">\n");
+                                       temp_short2++;
+                               } else if (temp_token->type < temp_short2) {
+                                       // Outdent
+                                       print_const("</text:list-item>\n");
+                                       while (temp_short2 > temp_token->type) {
+                                               if (temp_short2 > temp_short)
+                                                       print_const("</text:list></text:list-item>\n");
+                                               else
+                                                       temp_short = temp_short2 - 1;
+
+                                               temp_short2--;
+                                       }
+                               } else {
+                                       // Skipped more than one level -- ignore
+                                       continue;
+                               }
+
+                               temp_char = label_from_header(source, temp_token);
+
+                               printf("<text:list-item><text:p text:style-name=\"P1\"><text:a xlink:type=\"simple\" xlink:href=\"#%s\">", temp_char);
+                               mmd_export_token_tree_odf(out, source, temp_token->child, scratch);
+                               print_const("</text:a></text:p>");
+                               free(temp_char);
+                       }
+
+                       while (temp_short2 > (temp_short)) {
+                               print_const("</text:list>\n");
+                               temp_short2--;
+                       }
+                       
+                       if (temp_short)
+                               print_const("</text:list-item>\n</text:list>\n");
+
+                       scratch->padded = 1;
+                       break;
                case BLOCK_TERM:
                        pad(out, 2, scratch);
                        print_const("<text:p><text:span text:style-name=\"MMD-Bold\">");
@@ -1150,6 +1293,55 @@ void mmd_export_token_odf(DString * out, const char * source, token * t, scratch
                                print_const("^");
                        }       
                        break;
+               case TABLE_CELL:
+                       print_const("<table:table-cell");
+
+                       if (t->next && t->next->type == TABLE_DIVIDER) {
+                               if (t->next->len > 1) {
+                                       printf(" table:number-columns-spanned=\"%d\"", t->next->len);
+                               }
+                       }
+
+                       if (scratch->in_table_header) {
+                               print_const(">\n<text:p text:style-name=\"Table_20_Heading\"");
+                       } else {
+                               print_const(">\n<text:p");
+                               switch (scratch->table_alignment[scratch->table_cell_count]) {
+                                       case 'l':
+                                       case 'L':
+                                       default:
+                                               print_const(" text:style-name=\"MMD-Table\"");
+                                               break;
+                                       case 'r':
+                                       case 'R':
+                                               print_const(" text:style-name=\"MMD-Table-Right\"");
+                                               break;
+                                       case 'c':
+                                       case 'C':
+                                               print_const(" text:style-name=\"MMD-Table-Center\"");
+                                               break;
+                               }
+                       }
+
+                       print_const(">");
+                       mmd_export_token_tree_odf(out, source, t->child, scratch);
+
+                       print_const("</text:p>\n</table:table-cell>\n");
+
+                       if (t->next)
+                               scratch->table_cell_count += t->next->len;
+                       else
+                               scratch->table_cell_count++;
+                       
+                       break;
+               case TABLE_DIVIDER:
+                       break;
+               case TABLE_ROW:
+                       print_const("<table:table-row>\n");
+                       scratch->table_cell_count = 0;
+                       mmd_export_token_tree_odf(out, source, t->child, scratch);
+                       print_const("</table:table-row>\n");
+                       break;
                case TEXT_EMPTY:
                        break;
                case TEXT_LINEBREAK:
diff --git a/tests/MMD6Tests/Table of Contents.fodt b/tests/MMD6Tests/Table of Contents.fodt
new file mode 100644 (file)
index 0000000..606111b
--- /dev/null
@@ -0,0 +1,321 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
+     xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
+     xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+     xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+     xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+     xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
+     xmlns:xlink="http://www.w3.org/1999/xlink"
+     xmlns:dc="http://purl.org/dc/elements/1.1/"
+     xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
+     xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
+     xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
+     xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+     xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+     xmlns:math="http://www.w3.org/1998/Math/MathML"
+     xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
+     xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
+     xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
+     xmlns:ooo="http://openoffice.org/2004/office"
+     xmlns:ooow="http://openoffice.org/2004/writer"
+     xmlns:oooc="http://openoffice.org/2004/calc"
+     xmlns:dom="http://www.w3.org/2001/xml-events"
+     xmlns:xforms="http://www.w3.org/2002/xforms"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+     xmlns:rpt="http://openoffice.org/2005/report"
+     xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"
+     xmlns:xhtml="http://www.w3.org/1999/xhtml"
+     xmlns:grddl="http://www.w3.org/2003/g/data-view#"
+     xmlns:tableooo="http://openoffice.org/2009/table"
+     xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"
+     xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
+     xmlns:css3t="http://www.w3.org/TR/css3-text/"
+     office:version="1.2"
+     grddl:transformation="http://docs.oasis-open.org/office/1.2/xslt/odf2rdf.xsl"
+     office:mimetype="application/vnd.oasis.opendocument.text">
+<office:font-face-decls>
+   <style:font-face style:name="Courier New" svg:font-family="'Courier New'"
+                    style:font-adornments="Regular"
+                    style:font-family-generic="modern"
+                    style:font-pitch="fixed"/>
+</office:font-face-decls>
+<office:styles>
+<style:style style:name="Standard" style:family="paragraph" style:class="text">
+      <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.15in"     fo:text-align="justify" style:justify-single-word="false"/>
+   </style:style>
+<style:style style:name="Preformatted_20_Text" style:display-name="Preformatted Text"
+             style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="html">
+   <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" fo:text-align="start"
+                               style:justify-single-word="false"/>
+   <style:text-properties style:font-name="Courier New" fo:font-size="11pt"
+                          style:font-name-asian="Courier New"
+                          style:font-size-asian="11pt"
+                          style:font-name-complex="Courier New"
+                          style:font-size-complex="11pt"/>
+</style:style>
+<style:style style:name="Source_20_Text" style:display-name="Source Text"
+             style:family="text">
+   <style:text-properties style:font-name="Courier New" style:font-name-asian="Courier New"
+                          style:font-name-complex="Courier New"
+                          fo:font-size="11pt"/>
+</style:style>
+<style:style style:name="List" style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="list">
+   <style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+   <style:text-properties style:font-size-asian="12pt"/>
+</style:style>
+<style:style style:name="Quotations" style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="html">
+   <style:paragraph-properties fo:margin-left="0.3937in" fo:margin-right="0.3937in" fo:margin-top="0in"
+                               fo:margin-bottom="0.1965in"
+                               fo:text-align="justify"                               style:justify-single-word="false"                               fo:text-indent="0in"
+                               style:auto-text-indent="false"/>
+</style:style>
+<style:style style:name="Table_20_Heading" style:display-name="Table Heading"
+             style:family="paragraph"
+             style:parent-style-name="Table_20_Contents"
+             style:class="extra">
+   <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"
+                               text:number-lines="false"
+                               text:line-number="0"/>
+   <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold"
+                          style:font-weight-complex="bold"/>
+</style:style>
+<style:style style:name="Horizontal_20_Line" style:display-name="Horizontal Line"
+             style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="html">
+   <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.1965in"
+                               style:border-line-width-bottom="0.0008in 0.0138in 0.0008in"
+                               fo:padding="0in"
+                               fo:border-left="none"
+                               fo:border-right="none"
+                               fo:border-top="none"
+                               fo:border-bottom="0.0154in double #808080"
+                               text:number-lines="false"
+                               text:line-number="0"
+                               style:join-border="false"/>
+   <style:text-properties fo:font-size="6pt" style:font-size-asian="6pt" style:font-size-complex="6pt"/>
+</style:style>
+<style:style style:name="Footnote_20_anchor" style:display-name="Footnote anchor"              style:family="text">    <style:text-properties style:text-position="super 58%"/> </style:style>
+  <text:notes-configuration text:note-class="footnote" text:default-style-name="Footnote" text:citation-style-name="Footnote_20_Symbol" text:citation-body-style-name="Footnote_20_anchor" text:master-page-name="Footnote" style:num-format="a" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="page"/>
+  <text:notes-configuration text:note-class="endnote" text:default-style-name="Endnote" text:citation-style-name="Endnote_20_Symbol" text:citation-body-style-name="Endnote_20_anchor" text:master-page-name="Endnote" style:num-format="1" text:start-value="0"/>
+</office:styles>
+<office:automatic-styles>   <style:style style:name="MMD-Italic" style:family="text">
+      <style:text-properties fo:font-style="italic" style:font-style-asian="italic"
+                             style:font-style-complex="italic"/>
+   </style:style>
+   <style:style style:name="MMD-Bold" style:family="text">
+      <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold"
+                             style:font-weight-complex="bold"/>
+   </style:style>
+   <style:style style:name="MMD-Superscript" style:family="text">
+      <style:text-properties style:text-position="super 58%"/>
+   </style:style>
+   <style:style style:name="MMD-Subscript" style:family="text">
+      <style:text-properties style:text-position="sub 58%"/>
+   </style:style>
+<style:style style:name="MMD-Table" style:family="paragraph" style:parent-style-name="Standard">
+   <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.05in"/>
+</style:style>
+<style:style style:name="MMD-Table-Center" style:family="paragraph" style:parent-style-name="MMD-Table">
+   <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
+</style:style>
+<style:style style:name="MMD-Table-Right" style:family="paragraph" style:parent-style-name="MMD-Table">
+   <style:paragraph-properties fo:text-align="right" style:justify-single-word="false"/>
+</style:style>
+<style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard"
+             style:list-style-name="L2">
+<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+</style:style>
+<style:style style:name="fr1" style:family="graphic" style:parent-style-name="Frame">
+   <style:graphic-properties style:print-content="true" style:vertical-pos="top"
+                             style:vertical-rel="baseline"
+                             fo:padding="0in"
+                             fo:border="none"
+                             style:shadow="none"/>
+</style:style>
+<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"
+             style:list-style-name="L1"/>
+<text:list-style style:name="L1">
+       <text:list-level-style-bullet text:level="1" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="•">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.5in" fo:text-indent="-0.25in" fo:margin-left="0.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-bullet>
+       <text:list-level-style-bullet text:level="2" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="◦">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.75in" fo:text-indent="-0.25in" fo:margin-left="0.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-bullet>
+       <text:list-level-style-bullet text:level="3" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="▪">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1in" fo:text-indent="-0.25in" fo:margin-left="1in"/>
+               </style:list-level-properties>
+       </text:list-level-style-bullet>
+       <text:list-level-style-number text:level="4" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.25in" fo:text-indent="-0.25in" fo:margin-left="1.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="5" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.5in" fo:text-indent="-0.25in" fo:margin-left="1.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="6" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.75in" fo:text-indent="-0.25in" fo:margin-left="1.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="7" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2in" fo:text-indent="-0.25in" fo:margin-left="2in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="8" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.25in" fo:text-indent="-0.25in" fo:margin-left="2.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="9" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.5in" fo:text-indent="-0.25in" fo:margin-left="2.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="10" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.75in" fo:text-indent="-0.25in" fo:margin-left="2.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+</text:list-style>
+<text:list-style style:name="L2">
+       <text:list-level-style-number text:level="1" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.5in" fo:text-indent="-0.25in" fo:margin-left="0.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="2" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.75in" fo:text-indent="-0.25in" fo:margin-left="0.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="3" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1in" fo:text-indent="-0.25in" fo:margin-left="1in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="4" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.25in" fo:text-indent="-0.25in" fo:margin-left="1.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="5" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.5in" fo:text-indent="-0.25in" fo:margin-left="1.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="6" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.75in" fo:text-indent="-0.25in" fo:margin-left="1.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="7" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2in" fo:text-indent="-0.25in" fo:margin-left="2in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="8" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.25in" fo:text-indent="-0.25in" fo:margin-left="2.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="9" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.5in" fo:text-indent="-0.25in" fo:margin-left="2.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="10" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.75in" fo:text-indent="-0.25in" fo:margin-left="2.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+</text:list-style>
+</office:automatic-styles>
+ <office:master-styles>
+  <style:master-page style:name="Endnote" >
+    <style:header><text:h text:outline-level="2">Bibliography</text:h></style:header></style:master-page>
+  <style:master-page style:name="Footnote" style:page-layout-name="pm2"/>
+ </office:master-styles>
+<office:meta>
+<dc:title>Table of Contents</dc:title>
+<meta:user-defined meta:name="latex config">article</meta:user-defined>
+</office:meta>
+<office:body>
+<office:text>
+<text:list text:style-name="L1"><text:list-item>
+<text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="#secondlevel">Second Level</text:a></text:p></text:list-item>
+<text:list-item>
+<text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="#firstlevel">First Level</text:a></text:p>
+
+<text:list text:style-name="L1"><text:list-item>
+<text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="#secondlevelb">Second Level b</text:a></text:p>
+
+<text:list text:style-name="L1"><text:list-item>
+<text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="#thirdlevel">Third Level</text:a></text:p></text:list-item>
+</text:list></text:list-item>
+<text:list-item>
+<text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="#secondlevelc">Second Level c</text:a></text:p></text:list-item>
+</text:list></text:list-item>
+<text:list-item>
+<text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="#firstlevelb">First Level b</text:a></text:p>
+
+<text:list text:style-name="L1"><text:list-item>
+<text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="#secondleveld">Second level d</text:a></text:p>
+
+<text:list text:style-name="L1"><text:list-item>
+<text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="#thirdleveld">Third level d</text:a></text:p>
+
+<text:list text:style-name="L1"><text:list-item>
+<text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="#fourthleveld">Fourth level d</text:a></text:p></text:list-item>
+</text:list></text:list-item>
+</text:list></text:list-item>
+</text:list></text:list-item>
+<text:list-item>
+<text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="#firstlevele">First level</text:a></text:p>
+
+<text:list text:style-name="L1"><text:list-item>
+<text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="#secondlevele">Second level</text:a></text:p></text:list-item>
+</text:list></text:list-item>
+</text:list>
+
+<text:h text:outline-level="2"><text:bookmark text:name="secondlevel"/>Second Level<text:bookmark-end text:name="secondlevel"/></text:h>
+
+<text:h text:outline-level="1"><text:bookmark text:name="firstlevel"/>First Level<text:bookmark-end text:name="firstlevel"/></text:h>
+
+<text:h text:outline-level="2"><text:bookmark text:name="secondlevelb"/>Second Level b<text:bookmark-end text:name="secondlevelb"/></text:h>
+
+<text:h text:outline-level="3"><text:bookmark text:name="thirdlevel"/>Third Level<text:bookmark-end text:name="thirdlevel"/></text:h>
+
+<text:h text:outline-level="2"><text:bookmark text:name="secondlevelc"/>Second Level c<text:bookmark-end text:name="secondlevelc"/></text:h>
+
+<text:h text:outline-level="1"><text:bookmark text:name="firstlevelb"/>First Level b<text:bookmark-end text:name="firstlevelb"/></text:h>
+
+<text:h text:outline-level="3"><text:bookmark text:name="thirdlevelb"/>Third Level b<text:bookmark-end text:name="thirdlevelb"/></text:h>
+
+<text:h text:outline-level="2"><text:bookmark text:name="secondleveld"/>Second level d<text:bookmark-end text:name="secondleveld"/></text:h>
+
+<text:h text:outline-level="3"><text:bookmark text:name="thirdleveld"/>Third level d<text:bookmark-end text:name="thirdleveld"/></text:h>
+
+<text:h text:outline-level="4"><text:bookmark text:name="fourthleveld"/>Fourth level d<text:bookmark-end text:name="fourthleveld"/></text:h>
+
+<text:h text:outline-level="1"><text:bookmark text:name="firstlevele"/>First level<text:bookmark-end text:name="firstlevele"/></text:h>
+
+<text:h text:outline-level="2"><text:bookmark text:name="secondlevele"/>Second level<text:bookmark-end text:name="secondlevele"/></text:h></office:text>
+</office:body>
+</office:document>
diff --git a/tests/MMD6Tests/Tables.fodt b/tests/MMD6Tests/Tables.fodt
new file mode 100644 (file)
index 0000000..04c91a0
--- /dev/null
@@ -0,0 +1,510 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
+     xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
+     xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+     xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+     xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+     xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
+     xmlns:xlink="http://www.w3.org/1999/xlink"
+     xmlns:dc="http://purl.org/dc/elements/1.1/"
+     xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
+     xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
+     xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
+     xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+     xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+     xmlns:math="http://www.w3.org/1998/Math/MathML"
+     xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
+     xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
+     xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
+     xmlns:ooo="http://openoffice.org/2004/office"
+     xmlns:ooow="http://openoffice.org/2004/writer"
+     xmlns:oooc="http://openoffice.org/2004/calc"
+     xmlns:dom="http://www.w3.org/2001/xml-events"
+     xmlns:xforms="http://www.w3.org/2002/xforms"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+     xmlns:rpt="http://openoffice.org/2005/report"
+     xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"
+     xmlns:xhtml="http://www.w3.org/1999/xhtml"
+     xmlns:grddl="http://www.w3.org/2003/g/data-view#"
+     xmlns:tableooo="http://openoffice.org/2009/table"
+     xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"
+     xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
+     xmlns:css3t="http://www.w3.org/TR/css3-text/"
+     office:version="1.2"
+     grddl:transformation="http://docs.oasis-open.org/office/1.2/xslt/odf2rdf.xsl"
+     office:mimetype="application/vnd.oasis.opendocument.text">
+<office:font-face-decls>
+   <style:font-face style:name="Courier New" svg:font-family="'Courier New'"
+                    style:font-adornments="Regular"
+                    style:font-family-generic="modern"
+                    style:font-pitch="fixed"/>
+</office:font-face-decls>
+<office:styles>
+<style:style style:name="Standard" style:family="paragraph" style:class="text">
+      <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.15in"     fo:text-align="justify" style:justify-single-word="false"/>
+   </style:style>
+<style:style style:name="Preformatted_20_Text" style:display-name="Preformatted Text"
+             style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="html">
+   <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" fo:text-align="start"
+                               style:justify-single-word="false"/>
+   <style:text-properties style:font-name="Courier New" fo:font-size="11pt"
+                          style:font-name-asian="Courier New"
+                          style:font-size-asian="11pt"
+                          style:font-name-complex="Courier New"
+                          style:font-size-complex="11pt"/>
+</style:style>
+<style:style style:name="Source_20_Text" style:display-name="Source Text"
+             style:family="text">
+   <style:text-properties style:font-name="Courier New" style:font-name-asian="Courier New"
+                          style:font-name-complex="Courier New"
+                          fo:font-size="11pt"/>
+</style:style>
+<style:style style:name="List" style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="list">
+   <style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+   <style:text-properties style:font-size-asian="12pt"/>
+</style:style>
+<style:style style:name="Quotations" style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="html">
+   <style:paragraph-properties fo:margin-left="0.3937in" fo:margin-right="0.3937in" fo:margin-top="0in"
+                               fo:margin-bottom="0.1965in"
+                               fo:text-align="justify"                               style:justify-single-word="false"                               fo:text-indent="0in"
+                               style:auto-text-indent="false"/>
+</style:style>
+<style:style style:name="Table_20_Heading" style:display-name="Table Heading"
+             style:family="paragraph"
+             style:parent-style-name="Table_20_Contents"
+             style:class="extra">
+   <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"
+                               text:number-lines="false"
+                               text:line-number="0"/>
+   <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold"
+                          style:font-weight-complex="bold"/>
+</style:style>
+<style:style style:name="Horizontal_20_Line" style:display-name="Horizontal Line"
+             style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="html">
+   <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.1965in"
+                               style:border-line-width-bottom="0.0008in 0.0138in 0.0008in"
+                               fo:padding="0in"
+                               fo:border-left="none"
+                               fo:border-right="none"
+                               fo:border-top="none"
+                               fo:border-bottom="0.0154in double #808080"
+                               text:number-lines="false"
+                               text:line-number="0"
+                               style:join-border="false"/>
+   <style:text-properties fo:font-size="6pt" style:font-size-asian="6pt" style:font-size-complex="6pt"/>
+</style:style>
+<style:style style:name="Footnote_20_anchor" style:display-name="Footnote anchor"              style:family="text">    <style:text-properties style:text-position="super 58%"/> </style:style>
+  <text:notes-configuration text:note-class="footnote" text:default-style-name="Footnote" text:citation-style-name="Footnote_20_Symbol" text:citation-body-style-name="Footnote_20_anchor" text:master-page-name="Footnote" style:num-format="a" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="page"/>
+  <text:notes-configuration text:note-class="endnote" text:default-style-name="Endnote" text:citation-style-name="Endnote_20_Symbol" text:citation-body-style-name="Endnote_20_anchor" text:master-page-name="Endnote" style:num-format="1" text:start-value="0"/>
+</office:styles>
+<office:automatic-styles>   <style:style style:name="MMD-Italic" style:family="text">
+      <style:text-properties fo:font-style="italic" style:font-style-asian="italic"
+                             style:font-style-complex="italic"/>
+   </style:style>
+   <style:style style:name="MMD-Bold" style:family="text">
+      <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold"
+                             style:font-weight-complex="bold"/>
+   </style:style>
+   <style:style style:name="MMD-Superscript" style:family="text">
+      <style:text-properties style:text-position="super 58%"/>
+   </style:style>
+   <style:style style:name="MMD-Subscript" style:family="text">
+      <style:text-properties style:text-position="sub 58%"/>
+   </style:style>
+   <style:style style:name="Strike" style:family="text">
+      <style:text-properties style:text-line-through-style="solid" />
+   </style:style>
+   <style:style style:name="Underline" style:family="text">
+      <style:text-properties style:text-underline-style="solid" style:text-underline-color="font-color"/>
+   </style:style>
+   <style:style style:name="Highlight" style:family="text">
+      <style:text-properties fo:background-color="#FFFF00" />
+   </style:style>
+   <style:style style:name="Comment" style:family="text">
+      <style:text-properties fo:color="#0000BB" />
+   </style:style>
+<style:style style:name="MMD-Table" style:family="paragraph" style:parent-style-name="Standard">
+   <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.05in"/>
+</style:style>
+<style:style style:name="MMD-Table-Center" style:family="paragraph" style:parent-style-name="MMD-Table">
+   <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
+</style:style>
+<style:style style:name="MMD-Table-Right" style:family="paragraph" style:parent-style-name="MMD-Table">
+   <style:paragraph-properties fo:text-align="right" style:justify-single-word="false"/>
+</style:style>
+<style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard"
+             style:list-style-name="L2">
+<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+</style:style>
+<style:style style:name="fr1" style:family="graphic" style:parent-style-name="Frame">
+   <style:graphic-properties style:print-content="true" style:vertical-pos="top"
+                             style:vertical-rel="baseline"
+                             fo:padding="0in"
+                             fo:border="none"
+                             style:shadow="none"/>
+</style:style>
+<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"
+             style:list-style-name="L1"/>
+<text:list-style style:name="L1">
+       <text:list-level-style-bullet text:level="1" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="•">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.5in" fo:text-indent="-0.25in" fo:margin-left="0.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-bullet>
+       <text:list-level-style-bullet text:level="2" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="◦">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.75in" fo:text-indent="-0.25in" fo:margin-left="0.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-bullet>
+       <text:list-level-style-bullet text:level="3" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="▪">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1in" fo:text-indent="-0.25in" fo:margin-left="1in"/>
+               </style:list-level-properties>
+       </text:list-level-style-bullet>
+       <text:list-level-style-number text:level="4" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.25in" fo:text-indent="-0.25in" fo:margin-left="1.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="5" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.5in" fo:text-indent="-0.25in" fo:margin-left="1.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="6" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.75in" fo:text-indent="-0.25in" fo:margin-left="1.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="7" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2in" fo:text-indent="-0.25in" fo:margin-left="2in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="8" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.25in" fo:text-indent="-0.25in" fo:margin-left="2.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="9" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.5in" fo:text-indent="-0.25in" fo:margin-left="2.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="10" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.75in" fo:text-indent="-0.25in" fo:margin-left="2.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+</text:list-style>
+<text:list-style style:name="L2">
+       <text:list-level-style-number text:level="1" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.5in" fo:text-indent="-0.25in" fo:margin-left="0.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="2" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.75in" fo:text-indent="-0.25in" fo:margin-left="0.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="3" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1in" fo:text-indent="-0.25in" fo:margin-left="1in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="4" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.25in" fo:text-indent="-0.25in" fo:margin-left="1.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="5" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.5in" fo:text-indent="-0.25in" fo:margin-left="1.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="6" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.75in" fo:text-indent="-0.25in" fo:margin-left="1.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="7" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2in" fo:text-indent="-0.25in" fo:margin-left="2in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="8" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.25in" fo:text-indent="-0.25in" fo:margin-left="2.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="9" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.5in" fo:text-indent="-0.25in" fo:margin-left="2.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="10" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.75in" fo:text-indent="-0.25in" fo:margin-left="2.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+</text:list-style>
+</office:automatic-styles>
+ <office:master-styles>
+  <style:master-page style:name="Endnote" >
+    <style:header><text:h text:outline-level="2">Bibliography</text:h></style:header></style:master-page>
+  <style:master-page style:name="Footnote" style:page-layout-name="pm2"/>
+ </office:master-styles>
+<office:meta>
+       <dc:title>Tables</dc:title>
+</office:meta>
+<office:body>
+<office:text>
+<table:table>
+<table:table-column/>
+<table:table-column/>
+
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="Table_20_Heading"> foo<text:tab/></text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="Table_20_Heading"> bar<text:tab/></text:p>
+</table:table-cell>
+</table:table-row>
+
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="MMD-Table"> <text:span text:style-name="MMD-Italic">foo</text:span><text:tab/></text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="MMD-Table-Center"> <text:span text:style-name="MMD-Italic">bar</text:span><text:tab/></text:p>
+</table:table-cell>
+</table:table-row>
+<table:table-row>
+<table:table-cell table:numer-columns-spanned="2">
+<text:p text:style-name="MMD-Table"> <text:span text:style-name="MMD-Bold">foo bar</text:span><text:tab/><text:tab/></text:p>
+</table:table-cell>
+</table:table-row>
+
+</table:table>
+
+
+<table:table>
+<table:table-column/>
+<table:table-column/>
+
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="Table_20_Heading"> foo1 </text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="Table_20_Heading"> bar1 </text:p>
+</table:table-cell>
+</table:table-row>
+
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="MMD-Table"><text:span text:style-name="MMD-Italic">foo</text:span> </text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="MMD-Table-Right"> <text:span text:style-name="MMD-Italic">bar</text:span> </text:p>
+</table:table-cell>
+</table:table-row>
+<table:table-row>
+<table:table-cell table:numer-columns-spanned="2">
+<text:p text:style-name="MMD-Table"> <text:span text:style-name="MMD-Bold">foo bar</text:span> </text:p>
+</table:table-cell>
+</table:table-row>
+
+</table:table>
+
+
+<table:table>
+<table:table-column/>
+<table:table-column/>
+
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="Table_20_Heading"> foo2 </text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="Table_20_Heading"> bar2 </text:p>
+</table:table-cell>
+</table:table-row>
+
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="MMD-Table"><text:span text:style-name="MMD-Italic">foo</text:span> </text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="MMD-Table-Right"> <text:span text:style-name="MMD-Italic">bar</text:span> </text:p>
+</table:table-cell>
+</table:table-row>
+<table:table-row>
+<table:table-cell table:numer-columns-spanned="2">
+<text:p text:style-name="MMD-Table"> <text:span text:style-name="MMD-Bold">foo bar</text:span> </text:p>
+</table:table-cell>
+</table:table-row>
+
+
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="MMD-Table"> foo3 </text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="MMD-Table-Right"> bar3 </text:p>
+</table:table-cell>
+</table:table-row>
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="MMD-Table"><text:span text:style-name="MMD-Italic">foo</text:span> </text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="MMD-Table-Right"> <text:span text:style-name="MMD-Italic">bar</text:span> </text:p>
+</table:table-cell>
+</table:table-row>
+<table:table-row>
+<table:table-cell table:numer-columns-spanned="2">
+<text:p text:style-name="MMD-Table"> <text:span text:style-name="MMD-Bold">foo bar</text:span> </text:p>
+</table:table-cell>
+</table:table-row>
+
+</table:table>
+
+
+<text:p text:style-name="Standard">| foo4 | bar4 |<text:line-break/>
+<text:span text:style-name="MMD-Italic">foo</text:span> | <text:span text:style-name="MMD-Italic">bar</text:span> |<text:line-break/>
+| <text:span text:style-name="MMD-Bold">foo bar</text:span> ||</text:p>
+
+<text:p text:style-name="Standard">5</text:p>
+
+<table:table>
+<table:table-column/>
+<table:table-column/>
+
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="Table_20_Heading"> foo5 </text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="Table_20_Heading"> bar5 </text:p>
+</table:table-cell>
+</table:table-row>
+
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="MMD-Table"><text:span text:style-name="MMD-Italic">foo</text:span> </text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="MMD-Table-Right"> <text:span text:style-name="MMD-Italic">bar</text:span> </text:p>
+</table:table-cell>
+</table:table-row>
+<table:table-row>
+<table:table-cell table:numer-columns-spanned="2">
+<text:p text:style-name="MMD-Table"> <text:span text:style-name="MMD-Bold">foo bar</text:span> | </text:p>
+</table:table-cell>
+</table:table-row>
+
+
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="MMD-Table"> foo6 </text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="MMD-Table-Right"> bar6 </text:p>
+</table:table-cell>
+</table:table-row>
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="MMD-Table"> :&#8212;&#8211; </text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="MMD-Table-Right"> &#8212;&#8211;: </text:p>
+</table:table-cell>
+</table:table-row>
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="MMD-Table"><text:span text:style-name="MMD-Italic">foo</text:span> </text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="MMD-Table-Right"> <text:span text:style-name="MMD-Italic">bar</text:span> </text:p>
+</table:table-cell>
+</table:table-row>
+<table:table-row>
+<table:table-cell table:numer-columns-spanned="2">
+<text:p text:style-name="MMD-Table"> <text:span text:style-name="MMD-Bold">foo bar</text:span> </text:p>
+</table:table-cell>
+</table:table-row>
+
+</table:table>
+
+
+<table:table>
+<table:table-column/>
+<table:table-column/>
+
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="Table_20_Heading"> foo </text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="Table_20_Heading"> bar </text:p>
+</table:table-cell>
+</table:table-row>
+
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="MMD-Table"> foo </text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="MMD-Table"> bar </text:p>
+</table:table-cell>
+</table:table-row>
+
+</table:table>
+<text:p><text:bookmark text:name="bar"/>Table <text:sequence text:name="Table" text:formula="ooow:Table+1" style:num-format="1"> Update Fields to calculate numbers</text:sequence>:<text:span text:style-name="MMD-Italic">caption</text:span><text:bookmark-end text:name="bar"/></text:p>
+
+
+<table:table>
+<table:table-column/>
+<table:table-column/>
+
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="Table_20_Heading"> foo </text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="Table_20_Heading"> bar </text:p>
+</table:table-cell>
+</table:table-row>
+
+<table:table-row>
+<table:table-cell>
+<text:p text:style-name="MMD-Table"> foo </text:p>
+</table:table-cell>
+<table:table-cell>
+<text:p text:style-name="MMD-Table"> bar </text:p>
+</table:table-cell>
+</table:table-row>
+
+</table:table>
+<text:p><text:bookmark text:name="caption"/>Table <text:sequence text:name="Table" text:formula="ooow:Table+1" style:num-format="1"> Update Fields to calculate numbers</text:sequence>:<text:span text:style-name="MMD-Italic">caption</text:span><text:bookmark-end text:name="caption"/></text:p>
+
+
+<text:p text:style-name="Standard">[<text:span text:style-name="MMD-Italic">foo</text:span>][bar]
+| foo | bar |
+| &#8212; | &#8212; |
+| foo | bar |</text:p>
+</office:text>
+</office:body>
+</office:document>