From 03a6c7e970d303bdd0361eb7b3fed4cc24ebc696 Mon Sep 17 00:00:00 2001 From: bokuweb Date: Thu, 13 Feb 2020 16:14:06 +0900 Subject: [PATCH] Add json definitions (#40) * feat: Add test * fix: bom file * fix: delete serializer * fix: improve json * fix: dxa * fix: fixup ts * 0.0.24 --- docs/1.index.js | 43 +- docx-core/examples/reader.rs | 2 +- docx-core/src/documents/content_types.rs | 2 +- docx-core/src/documents/elements/paragraph.rs | 19 + docx-core/src/reader/document_rels.rs | 4 +- docx-core/src/reader/mod.rs | 35 +- docx-core/src/reader/paragraph.rs | 18 +- docx-core/src/reader/read_zip.rs | 24 + docx-core/src/reader/styles.rs | 3 +- docx-core/src/reader/table.rs | 6 +- docx-core/src/reader/table_cell.rs | 3 +- docx-core/src/types/alignment_type.rs | 7 +- docx-core/src/types/break_type.rs | 4 +- docx-core/src/types/style_type.rs | 3 + docx-core/src/types/vertical_merge_type.rs | 4 +- docx-core/src/types/width_type.rs | 4 +- docx-core/tests/reader.rs | 136 ++++++ .../snapshots/lib__reader__read_bom.snap | 5 + .../snapshots/lib__reader__read_bookmark.snap | 5 + .../lib__reader__read_decoration.snap | 5 + ..._reader__read_highlight_and_underline.snap | 5 + .../snapshots/lib__reader__read_history.snap | 5 + .../lib__reader__read_indent_word_online.snap | 5 + .../lib__reader__read_tab_and_break.snap | 5 + .../lib__reader__read_table_docx.snap | 5 + ...eader__read_table_merged_libre_office.snap | 5 + .../tests/snapshots/reader__read_bom.snap | 5 + .../snapshots/reader__read_bookmark.snap | 5 + .../snapshots/reader__read_decoration.snap | 5 + .../reader__read_highlight_and_underline.snap | 5 + .../tests/snapshots/reader__read_history.snap | 5 + .../reader__read_indent_word_online.snap | 5 + .../snapshots/reader__read_tab_and_break.snap | 5 + .../snapshots/reader__read_table_docx.snap | 5 + ...eader__read_table_merged_libre_office.snap | 5 + docx-wasm/js/index.ts | 4 +- docx-wasm/js/json/border.ts | 7 + docx-wasm/js/json/document.ts | 26 + docx-wasm/js/json/index.ts | 49 ++ docx-wasm/js/json/paragraph.ts | 61 +++ docx-wasm/js/json/run.ts | 49 ++ docx-wasm/js/json/styles.ts | 17 + docx-wasm/js/json/table.ts | 62 +++ docx-wasm/package.json | 7 +- fixtures/bom/bom.docx | Bin 0 -> 11377 bytes .../indent_word_online/[Content_Types].xml | 14 +- fixtures/table_libre_office/word/document.xml | 19 +- .../table_libre_office/word/fontTable.xml | 2 +- fixtures/table_libre_office/word/settings.xml | 2 +- fixtures/table_libre_office/word/styles.xml | 107 +--- .../table_merged_libre_office/word/styles.xml | 116 +---- fixtures/table_word_online/word/styles.xml | 460 +++++++++++++++++- 52 files changed, 1119 insertions(+), 290 deletions(-) create mode 100644 docx-core/src/reader/read_zip.rs create mode 100644 docx-core/tests/snapshots/lib__reader__read_bom.snap create mode 100644 docx-core/tests/snapshots/lib__reader__read_bookmark.snap create mode 100644 docx-core/tests/snapshots/lib__reader__read_decoration.snap create mode 100644 docx-core/tests/snapshots/lib__reader__read_highlight_and_underline.snap create mode 100644 docx-core/tests/snapshots/lib__reader__read_history.snap create mode 100644 docx-core/tests/snapshots/lib__reader__read_indent_word_online.snap create mode 100644 docx-core/tests/snapshots/lib__reader__read_tab_and_break.snap create mode 100644 docx-core/tests/snapshots/lib__reader__read_table_docx.snap create mode 100644 docx-core/tests/snapshots/lib__reader__read_table_merged_libre_office.snap create mode 100644 docx-core/tests/snapshots/reader__read_bom.snap create mode 100644 docx-core/tests/snapshots/reader__read_bookmark.snap create mode 100644 docx-core/tests/snapshots/reader__read_decoration.snap create mode 100644 docx-core/tests/snapshots/reader__read_highlight_and_underline.snap create mode 100644 docx-core/tests/snapshots/reader__read_history.snap create mode 100644 docx-core/tests/snapshots/reader__read_indent_word_online.snap create mode 100644 docx-core/tests/snapshots/reader__read_tab_and_break.snap create mode 100644 docx-core/tests/snapshots/reader__read_table_docx.snap create mode 100644 docx-core/tests/snapshots/reader__read_table_merged_libre_office.snap create mode 100644 docx-wasm/js/json/border.ts create mode 100644 docx-wasm/js/json/document.ts create mode 100644 docx-wasm/js/json/index.ts create mode 100644 docx-wasm/js/json/paragraph.ts create mode 100644 docx-wasm/js/json/run.ts create mode 100644 docx-wasm/js/json/styles.ts create mode 100644 docx-wasm/js/json/table.ts create mode 100644 fixtures/bom/bom.docx diff --git a/docs/1.index.js b/docs/1.index.js index 5eb6922..c521c1e 100644 --- a/docs/1.index.js +++ b/docs/1.index.js @@ -1,26 +1,31 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[1],{ - -/***/ "./pkg/index.js": -/*!**********************!*\ +(window["webpackJsonp"] = window["webpackJsonp"] || []).push([ + [1], + { + /***/ "./pkg/index.js": + /*!**********************!*\ !*** ./pkg/index.js ***! \**********************/ -/*! exports provided: createRun, createComment, createTableCell, createTableRow, createDocx, createLevel, createInsert, createTable, createNumbering, createDelete, createParagraph, TableAlignmentType, SpecialIndentKind, VMergeType, BreakType, FontPitchType, WidthType, BorderType, AlignmentType, StyleType, Comment, Delete, Docx, Insert, Level, Numbering, Paragraph, Run, Table, TableCell, TableRow, __wbindgen_string_new, __wbindgen_object_drop_ref, __wbindgen_throw, __wbindgen_rethrow */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + /*! exports provided: createRun, createComment, createTableCell, createTableRow, createDocx, createLevel, createInsert, createTable, createNumbering, createDelete, createParagraph, TableAlignmentType, SpecialIndentKind, VMergeType, BreakType, FontPitchType, WidthType, BorderType, AlignmentType, StyleType, Comment, Delete, Docx, Insert, Level, Numbering, Paragraph, Run, Table, TableCell, TableRow, __wbindgen_string_new, __wbindgen_object_drop_ref, __wbindgen_throw, __wbindgen_rethrow */ + /***/ function(module, __webpack_exports__, __webpack_require__) { + "use strict"; + eval( + '__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(TextEncoder, TextDecoder) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRun", function() { return createRun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createComment", function() { return createComment; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTableCell", function() { return createTableCell; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTableRow", function() { return createTableRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDocx", function() { return createDocx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLevel", function() { return createLevel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInsert", function() { return createInsert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTable", function() { return createTable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNumbering", function() { return createNumbering; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDelete", function() { return createDelete; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createParagraph", function() { return createParagraph; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TableAlignmentType", function() { return TableAlignmentType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SpecialIndentKind", function() { return SpecialIndentKind; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VMergeType", function() { return VMergeType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BreakType", function() { return BreakType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FontPitchType", function() { return FontPitchType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WidthType", function() { return WidthType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BorderType", function() { return BorderType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AlignmentType", function() { return AlignmentType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StyleType", function() { return StyleType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Comment", function() { return Comment; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Delete", function() { return Delete; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Docx", function() { return Docx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Insert", function() { return Insert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Level", function() { return Level; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Numbering", function() { return Numbering; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Paragraph", function() { return Paragraph; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Run", function() { return Run; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Table", function() { return Table; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TableCell", function() { return TableCell; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TableRow", function() { return TableRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__wbindgen_string_new", function() { return __wbindgen_string_new; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__wbindgen_object_drop_ref", function() { return __wbindgen_object_drop_ref; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__wbindgen_throw", function() { return __wbindgen_throw; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__wbindgen_rethrow", function() { return __wbindgen_rethrow; });\n/* harmony import */ var _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index_bg.wasm */ "./pkg/index_bg.wasm");\n\n\n/**\n* @returns {Run}\n*/\nfunction createRun() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["createRun"]();\n return Run.__wrap(ret);\n}\n\nfunction _assertNum(n) {\n if (typeof(n) !== \'number\') throw new Error(\'expected a number argument\');\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nlet cachedTextEncoder = new TextEncoder(\'utf-8\');\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === \'function\'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nlet cachegetUint8Memory = null;\nfunction getUint8Memory() {\n if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["memory"].buffer) {\n cachegetUint8Memory = new Uint8Array(_index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["memory"].buffer);\n }\n return cachegetUint8Memory;\n}\n\nfunction passStringToWasm(arg) {\n\n if (typeof(arg) !== \'string\') throw new Error(\'expected a string argument\');\n\n let len = arg.length;\n let ptr = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["__wbindgen_malloc"](len);\n\n const mem = getUint8Memory();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["__wbindgen_realloc"](ptr, len, len = offset + arg.length * 3);\n const view = getUint8Memory().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n if (ret.read != arg.length) throw new Error(\'failed to pass whole string\');\n offset += ret.written;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n/**\n* @param {number} id\n* @returns {Comment}\n*/\nfunction createComment(id) {\n _assertNum(id);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["createComment"](id);\n return Comment.__wrap(ret);\n}\n\nfunction _assertClass(instance, klass) {\n if (!(instance instanceof klass)) {\n throw new Error(`expected instance of ${klass.name}`);\n }\n return instance.ptr;\n}\n/**\n* @returns {TableCell}\n*/\nfunction createTableCell() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["createTableCell"]();\n return TableCell.__wrap(ret);\n}\n\n/**\n* @returns {TableRow}\n*/\nfunction createTableRow() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["createTableRow"]();\n return TableRow.__wrap(ret);\n}\n\n/**\n* @returns {Docx}\n*/\nfunction createDocx() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["createDocx"]();\n return Docx.__wrap(ret);\n}\n\nlet cachegetInt32Memory = null;\nfunction getInt32Memory() {\n if (cachegetInt32Memory === null || cachegetInt32Memory.buffer !== _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["memory"].buffer) {\n cachegetInt32Memory = new Int32Array(_index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["memory"].buffer);\n }\n return cachegetInt32Memory;\n}\n\nfunction getArrayU8FromWasm(ptr, len) {\n return getUint8Memory().subarray(ptr / 1, ptr / 1 + len);\n}\n/**\n* @param {number} id\n* @param {number} start\n* @param {string} format\n* @param {string} text\n* @param {string} jc\n* @returns {Level}\n*/\nfunction createLevel(id, start, format, text, jc) {\n _assertNum(id);\n _assertNum(start);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["createLevel"](id, start, passStringToWasm(format), WASM_VECTOR_LEN, passStringToWasm(text), WASM_VECTOR_LEN, passStringToWasm(jc), WASM_VECTOR_LEN);\n return Level.__wrap(ret);\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n/**\n* @returns {Insert}\n*/\nfunction createInsert() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["createInsert"]();\n return Insert.__wrap(ret);\n}\n\n/**\n* @returns {Table}\n*/\nfunction createTable() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["createTable"]();\n return Table.__wrap(ret);\n}\n\nlet cachegetUint32Memory = null;\nfunction getUint32Memory() {\n if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["memory"].buffer) {\n cachegetUint32Memory = new Uint32Array(_index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["memory"].buffer);\n }\n return cachegetUint32Memory;\n}\n\nfunction passArray32ToWasm(arg) {\n const ptr = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["__wbindgen_malloc"](arg.length * 4);\n getUint32Memory().set(arg, ptr / 4);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n/**\n* @param {number} id\n* @returns {Numbering}\n*/\nfunction createNumbering(id) {\n _assertNum(id);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["createNumbering"](id);\n return Numbering.__wrap(ret);\n}\n\n/**\n* @returns {Delete}\n*/\nfunction createDelete() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["createDelete"]();\n return Delete.__wrap(ret);\n}\n\n/**\n* @returns {Paragraph}\n*/\nfunction createParagraph() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["createParagraph"]();\n return Paragraph.__wrap(ret);\n}\n\nlet cachedTextDecoder = new TextDecoder(\'utf-8\', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nfunction getStringFromWasm(ptr, len) {\n return cachedTextDecoder.decode(getUint8Memory().subarray(ptr, ptr + len));\n}\n\nconst heap = new Array(32);\n\nheap.fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nlet heap_next = heap.length;\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n if (typeof(heap_next) !== \'number\') throw new Error(\'corrupt heap\');\n\n heap[idx] = obj;\n return idx;\n}\n\nfunction getObject(idx) { return heap[idx]; }\n\nfunction dropObject(idx) {\n if (idx < 36) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n/**\n*/\nconst TableAlignmentType = Object.freeze({ Center:0,Left:1,Right:2, });\n/**\n*/\nconst SpecialIndentKind = Object.freeze({ FirstLine:0,Hanging:1, });\n/**\n*/\nconst VMergeType = Object.freeze({ Continue:0,Restart:1, });\n/**\n*/\nconst BreakType = Object.freeze({ Page:0,Column:1,TextWrapping:2, });\n/**\n*/\nconst FontPitchType = Object.freeze({ Default:0,Fixed:1,Variable:2, });\n/**\n*/\nconst WidthType = Object.freeze({ DXA:0,Auto:1, });\n/**\n*/\nconst BorderType = Object.freeze({ None:0,Single:1,Thick:2,Double:3,Dotted:4,Dashed:5,DotDash:6,DotDotDash:7,Triple:8, });\n/**\n*/\nconst AlignmentType = Object.freeze({ Center:0,Left:1,Right:2,Justified:3, });\n/**\n*/\nconst StyleType = Object.freeze({ Paragraph:0,Character:1, });\n/**\n*/\nclass Comment {\n\n constructor() {\n throw new Error(\'cannot invoke `new` directly\');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Comment.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["__wbg_comment_free"](ptr);\n }\n /**\n * @param {string} author\n * @returns {Comment}\n */\n author(author) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["comment_author"](ptr, passStringToWasm(author), WASM_VECTOR_LEN);\n return Comment.__wrap(ret);\n }\n /**\n * @param {string} date\n * @returns {Comment}\n */\n date(date) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["comment_date"](ptr, passStringToWasm(date), WASM_VECTOR_LEN);\n return Comment.__wrap(ret);\n }\n /**\n * @param {Paragraph} p\n * @returns {Comment}\n */\n paragraph(p) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(p, Paragraph);\n if (p.ptr === 0) {\n throw new Error(\'Attempt to use a moved value\');\n }\n const ptr0 = p.ptr;\n p.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["comment_paragraph"](ptr, ptr0);\n return Comment.__wrap(ret);\n }\n /**\n * @returns {number}\n */\n id() {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n _assertNum(this.ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["comment_id"](this.ptr);\n return ret >>> 0;\n }\n}\n/**\n*/\nclass Delete {\n\n constructor() {\n throw new Error(\'cannot invoke `new` directly\');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Delete.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["__wbg_delete_free"](ptr);\n }\n}\n/**\n*/\nclass Docx {\n\n constructor() {\n throw new Error(\'cannot invoke `new` directly\');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Docx.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["__wbg_docx_free"](ptr);\n }\n /**\n * @param {Paragraph} p\n * @returns {Docx}\n */\n add_paragraph(p) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(p, Paragraph);\n if (p.ptr === 0) {\n throw new Error(\'Attempt to use a moved value\');\n }\n const ptr0 = p.ptr;\n p.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["docx_add_paragraph"](ptr, ptr0);\n return Docx.__wrap(ret);\n }\n /**\n * @param {Table} t\n * @returns {Docx}\n */\n add_table(t) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(t, Table);\n if (t.ptr === 0) {\n throw new Error(\'Attempt to use a moved value\');\n }\n const ptr0 = t.ptr;\n t.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["docx_add_table"](ptr, ptr0);\n return Docx.__wrap(ret);\n }\n /**\n * @param {Numbering} num\n * @returns {Docx}\n */\n add_numbering(num) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(num, Numbering);\n if (num.ptr === 0) {\n throw new Error(\'Attempt to use a moved value\');\n }\n const ptr0 = num.ptr;\n num.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["docx_add_numbering"](ptr, ptr0);\n return Docx.__wrap(ret);\n }\n /**\n * @returns {Uint8Array}\n */\n build() {\n const retptr = 8;\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n _assertNum(retptr);\n _assertNum(this.ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["docx_build"](retptr, this.ptr);\n const memi32 = getInt32Memory();\n const v0 = getArrayU8FromWasm(memi32[retptr / 4 + 0], memi32[retptr / 4 + 1]).slice();\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["__wbindgen_free"](memi32[retptr / 4 + 0], memi32[retptr / 4 + 1] * 1);\n return v0;\n }\n}\n/**\n*/\nclass Insert {\n\n constructor() {\n throw new Error(\'cannot invoke `new` directly\');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Insert.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["__wbg_insert_free"](ptr);\n }\n}\n/**\n*/\nclass Level {\n\n constructor() {\n throw new Error(\'cannot invoke `new` directly\');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Level.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["__wbg_level_free"](ptr);\n }\n /**\n * @param {number} left\n * @param {number | undefined} special_indent_kind\n * @param {number | undefined} special_indent_size\n * @returns {Level}\n */\n indent(left, special_indent_kind, special_indent_size) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(left);\n if (!isLikeNone(special_indent_kind)) {\n _assertNum(special_indent_kind);\n }\n if (!isLikeNone(special_indent_size)) {\n _assertNum(special_indent_size);\n }\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["level_indent"](ptr, left, isLikeNone(special_indent_kind) ? 2 : special_indent_kind, !isLikeNone(special_indent_size), isLikeNone(special_indent_size) ? 0 : special_indent_size);\n return Level.__wrap(ret);\n }\n}\n/**\n*/\nclass Numbering {\n\n constructor() {\n throw new Error(\'cannot invoke `new` directly\');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Numbering.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["__wbg_numbering_free"](ptr);\n }\n /**\n * @param {Level} level\n * @returns {Numbering}\n */\n add_level(level) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(level, Level);\n if (level.ptr === 0) {\n throw new Error(\'Attempt to use a moved value\');\n }\n const ptr0 = level.ptr;\n level.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["numbering_add_level"](ptr, ptr0);\n return Numbering.__wrap(ret);\n }\n}\n/**\n*/\nclass Paragraph {\n\n constructor() {\n throw new Error(\'cannot invoke `new` directly\');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Paragraph.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["__wbg_paragraph_free"](ptr);\n }\n /**\n * @param {Run} run\n * @returns {Paragraph}\n */\n add_run(run) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(run, Run);\n if (run.ptr === 0) {\n throw new Error(\'Attempt to use a moved value\');\n }\n const ptr0 = run.ptr;\n run.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["paragraph_add_run"](ptr, ptr0);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {Insert} i\n * @returns {Paragraph}\n */\n add_insert(i) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(i, Insert);\n if (i.ptr === 0) {\n throw new Error(\'Attempt to use a moved value\');\n }\n const ptr0 = i.ptr;\n i.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["paragraph_add_insert"](ptr, ptr0);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {Delete} d\n * @returns {Paragraph}\n */\n add_delete(d) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(d, Delete);\n if (d.ptr === 0) {\n throw new Error(\'Attempt to use a moved value\');\n }\n const ptr0 = d.ptr;\n d.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["paragraph_add_delete"](ptr, ptr0);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {string} id\n * @param {string} name\n * @returns {Paragraph}\n */\n add_bookmark_start(id, name) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["paragraph_add_bookmark_start"](ptr, passStringToWasm(id), WASM_VECTOR_LEN, passStringToWasm(name), WASM_VECTOR_LEN);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {string} id\n * @returns {Paragraph}\n */\n add_bookmark_end(id) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["paragraph_add_bookmark_end"](ptr, passStringToWasm(id), WASM_VECTOR_LEN);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {Comment} comment\n * @returns {Paragraph}\n */\n add_comment_start(comment) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(comment, Comment);\n if (comment.ptr === 0) {\n throw new Error(\'Attempt to use a moved value\');\n }\n const ptr0 = comment.ptr;\n comment.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["paragraph_add_comment_start"](ptr, ptr0);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {number} id\n * @returns {Paragraph}\n */\n add_comment_end(id) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(id);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["paragraph_add_comment_end"](ptr, id);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {number} alignment_type\n * @returns {Paragraph}\n */\n align(alignment_type) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(alignment_type);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["paragraph_align"](ptr, alignment_type);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {string} style_id\n * @returns {Paragraph}\n */\n style(style_id) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["paragraph_style"](ptr, passStringToWasm(style_id), WASM_VECTOR_LEN);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {number} left\n * @param {number | undefined} special_indent_kind\n * @param {number | undefined} special_indent_size\n * @returns {Paragraph}\n */\n indent(left, special_indent_kind, special_indent_size) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(left);\n if (!isLikeNone(special_indent_kind)) {\n _assertNum(special_indent_kind);\n }\n if (!isLikeNone(special_indent_size)) {\n _assertNum(special_indent_size);\n }\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["paragraph_indent"](ptr, left, isLikeNone(special_indent_kind) ? 2 : special_indent_kind, !isLikeNone(special_indent_size), isLikeNone(special_indent_size) ? 0 : special_indent_size);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {number} id\n * @param {number} level\n * @returns {Paragraph}\n */\n numbering(id, level) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(id);\n _assertNum(level);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["paragraph_numbering"](ptr, id, level);\n return Paragraph.__wrap(ret);\n }\n}\n/**\n*/\nclass Run {\n\n constructor() {\n throw new Error(\'cannot invoke `new` directly\');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Run.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["__wbg_run_free"](ptr);\n }\n /**\n * @param {string} text\n * @returns {Run}\n */\n add_text(text) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["run_add_text"](ptr, passStringToWasm(text), WASM_VECTOR_LEN);\n return Run.__wrap(ret);\n }\n /**\n * @param {string} text\n * @returns {Run}\n */\n add_delete_text(text) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["run_add_delete_text"](ptr, passStringToWasm(text), WASM_VECTOR_LEN);\n return Run.__wrap(ret);\n }\n /**\n * @returns {Run}\n */\n add_tab() {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["run_add_tab"](ptr);\n return Run.__wrap(ret);\n }\n /**\n * @param {number} break_type\n * @returns {Run}\n */\n add_break(break_type) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(break_type);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["run_add_break"](ptr, break_type);\n return Run.__wrap(ret);\n }\n /**\n * @param {number} size\n * @returns {Run}\n */\n size(size) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(size);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["run_size"](ptr, size);\n return Run.__wrap(ret);\n }\n /**\n * @param {string} color\n * @returns {Run}\n */\n color(color) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["run_color"](ptr, passStringToWasm(color), WASM_VECTOR_LEN);\n return Run.__wrap(ret);\n }\n /**\n * @param {string} color\n * @returns {Run}\n */\n highlight(color) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["run_highlight"](ptr, passStringToWasm(color), WASM_VECTOR_LEN);\n return Run.__wrap(ret);\n }\n /**\n * @returns {Run}\n */\n bold() {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["run_bold"](ptr);\n return Run.__wrap(ret);\n }\n /**\n * @returns {Run}\n */\n italic() {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["run_italic"](ptr);\n return Run.__wrap(ret);\n }\n /**\n * @param {string} line_type\n * @returns {Run}\n */\n underline(line_type) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["run_underline"](ptr, passStringToWasm(line_type), WASM_VECTOR_LEN);\n return Run.__wrap(ret);\n }\n /**\n * @returns {Run}\n */\n vanish() {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["run_vanish"](ptr);\n return Run.__wrap(ret);\n }\n}\n/**\n*/\nclass Table {\n\n constructor() {\n throw new Error(\'cannot invoke `new` directly\');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Table.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["__wbg_table_free"](ptr);\n }\n /**\n * @param {TableRow} row\n * @returns {Table}\n */\n add_row(row) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(row, TableRow);\n if (row.ptr === 0) {\n throw new Error(\'Attempt to use a moved value\');\n }\n const ptr0 = row.ptr;\n row.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["table_add_row"](ptr, ptr0);\n return Table.__wrap(ret);\n }\n /**\n * @param {Uint32Array} grid\n * @returns {Table}\n */\n set_grid(grid) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["table_set_grid"](ptr, passArray32ToWasm(grid), WASM_VECTOR_LEN);\n return Table.__wrap(ret);\n }\n /**\n * @param {number} v\n * @returns {Table}\n */\n indent(v) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(v);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["table_indent"](ptr, v);\n return Table.__wrap(ret);\n }\n /**\n * @param {number} v\n * @returns {Table}\n */\n align(v) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(v);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["table_align"](ptr, v);\n return Table.__wrap(ret);\n }\n}\n/**\n*/\nclass TableCell {\n\n constructor() {\n throw new Error(\'cannot invoke `new` directly\');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(TableCell.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["__wbg_tablecell_free"](ptr);\n }\n /**\n * @param {Paragraph} p\n * @returns {TableCell}\n */\n add_paragraph(p) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(p, Paragraph);\n if (p.ptr === 0) {\n throw new Error(\'Attempt to use a moved value\');\n }\n const ptr0 = p.ptr;\n p.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["tablecell_add_paragraph"](ptr, ptr0);\n return TableCell.__wrap(ret);\n }\n /**\n * @param {number} t\n * @returns {TableCell}\n */\n vertical_merge(t) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(t);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["tablecell_vertical_merge"](ptr, t);\n return TableCell.__wrap(ret);\n }\n /**\n * @param {number} v\n * @returns {TableCell}\n */\n grid_span(v) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(v);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["tablecell_grid_span"](ptr, v);\n return TableCell.__wrap(ret);\n }\n}\n/**\n*/\nclass TableRow {\n\n constructor() {\n throw new Error(\'cannot invoke `new` directly\');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(TableRow.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["__wbg_tablerow_free"](ptr);\n }\n /**\n * @param {TableCell} cell\n * @returns {TableRow}\n */\n add_cell(cell) {\n if (this.ptr == 0) throw new Error(\'Attempt to use a moved value\');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(cell, TableCell);\n if (cell.ptr === 0) {\n throw new Error(\'Attempt to use a moved value\');\n }\n const ptr0 = cell.ptr;\n cell.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__["tablerow_add_cell"](ptr, ptr0);\n return TableRow.__wrap(ret);\n }\n}\n\nconst __wbindgen_string_new = function(arg0, arg1) {\n const ret = getStringFromWasm(arg0, arg1);\n return addHeapObject(ret);\n};\n\nconst __wbindgen_object_drop_ref = function(arg0) {\n takeObject(arg0);\n};\n\nconst __wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm(arg0, arg1));\n};\n\nconst __wbindgen_rethrow = function(arg0) {\n throw takeObject(arg0);\n};\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! text-encoding */ "./node_modules/text-encoding/index.js")["TextEncoder"], __webpack_require__(/*! text-encoding */ "./node_modules/text-encoding/index.js")["TextDecoder"]))\n\n//# sourceURL=webpack:///./pkg/index.js?' + ); -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(TextEncoder, TextDecoder) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createRun\", function() { return createRun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createComment\", function() { return createComment; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createTableCell\", function() { return createTableCell; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createTableRow\", function() { return createTableRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createDocx\", function() { return createDocx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createLevel\", function() { return createLevel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createInsert\", function() { return createInsert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createTable\", function() { return createTable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createNumbering\", function() { return createNumbering; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createDelete\", function() { return createDelete; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createParagraph\", function() { return createParagraph; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TableAlignmentType\", function() { return TableAlignmentType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SpecialIndentKind\", function() { return SpecialIndentKind; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VMergeType\", function() { return VMergeType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BreakType\", function() { return BreakType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FontPitchType\", function() { return FontPitchType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WidthType\", function() { return WidthType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BorderType\", function() { return BorderType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AlignmentType\", function() { return AlignmentType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StyleType\", function() { return StyleType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Comment\", function() { return Comment; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Delete\", function() { return Delete; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Docx\", function() { return Docx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Insert\", function() { return Insert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Level\", function() { return Level; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Numbering\", function() { return Numbering; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Paragraph\", function() { return Paragraph; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Run\", function() { return Run; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Table\", function() { return Table; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TableCell\", function() { return TableCell; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TableRow\", function() { return TableRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_string_new\", function() { return __wbindgen_string_new; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_object_drop_ref\", function() { return __wbindgen_object_drop_ref; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_throw\", function() { return __wbindgen_throw; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_rethrow\", function() { return __wbindgen_rethrow; });\n/* harmony import */ var _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index_bg.wasm */ \"./pkg/index_bg.wasm\");\n\n\n/**\n* @returns {Run}\n*/\nfunction createRun() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"createRun\"]();\n return Run.__wrap(ret);\n}\n\nfunction _assertNum(n) {\n if (typeof(n) !== 'number') throw new Error('expected a number argument');\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nlet cachedTextEncoder = new TextEncoder('utf-8');\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nlet cachegetUint8Memory = null;\nfunction getUint8Memory() {\n if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer) {\n cachegetUint8Memory = new Uint8Array(_index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer);\n }\n return cachegetUint8Memory;\n}\n\nfunction passStringToWasm(arg) {\n\n if (typeof(arg) !== 'string') throw new Error('expected a string argument');\n\n let len = arg.length;\n let ptr = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_malloc\"](len);\n\n const mem = getUint8Memory();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_realloc\"](ptr, len, len = offset + arg.length * 3);\n const view = getUint8Memory().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n if (ret.read != arg.length) throw new Error('failed to pass whole string');\n offset += ret.written;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n/**\n* @param {number} id\n* @returns {Comment}\n*/\nfunction createComment(id) {\n _assertNum(id);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"createComment\"](id);\n return Comment.__wrap(ret);\n}\n\nfunction _assertClass(instance, klass) {\n if (!(instance instanceof klass)) {\n throw new Error(`expected instance of ${klass.name}`);\n }\n return instance.ptr;\n}\n/**\n* @returns {TableCell}\n*/\nfunction createTableCell() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"createTableCell\"]();\n return TableCell.__wrap(ret);\n}\n\n/**\n* @returns {TableRow}\n*/\nfunction createTableRow() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"createTableRow\"]();\n return TableRow.__wrap(ret);\n}\n\n/**\n* @returns {Docx}\n*/\nfunction createDocx() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"createDocx\"]();\n return Docx.__wrap(ret);\n}\n\nlet cachegetInt32Memory = null;\nfunction getInt32Memory() {\n if (cachegetInt32Memory === null || cachegetInt32Memory.buffer !== _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer) {\n cachegetInt32Memory = new Int32Array(_index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer);\n }\n return cachegetInt32Memory;\n}\n\nfunction getArrayU8FromWasm(ptr, len) {\n return getUint8Memory().subarray(ptr / 1, ptr / 1 + len);\n}\n/**\n* @param {number} id\n* @param {number} start\n* @param {string} format\n* @param {string} text\n* @param {string} jc\n* @returns {Level}\n*/\nfunction createLevel(id, start, format, text, jc) {\n _assertNum(id);\n _assertNum(start);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"createLevel\"](id, start, passStringToWasm(format), WASM_VECTOR_LEN, passStringToWasm(text), WASM_VECTOR_LEN, passStringToWasm(jc), WASM_VECTOR_LEN);\n return Level.__wrap(ret);\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n/**\n* @returns {Insert}\n*/\nfunction createInsert() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"createInsert\"]();\n return Insert.__wrap(ret);\n}\n\n/**\n* @returns {Table}\n*/\nfunction createTable() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"createTable\"]();\n return Table.__wrap(ret);\n}\n\nlet cachegetUint32Memory = null;\nfunction getUint32Memory() {\n if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer) {\n cachegetUint32Memory = new Uint32Array(_index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer);\n }\n return cachegetUint32Memory;\n}\n\nfunction passArray32ToWasm(arg) {\n const ptr = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_malloc\"](arg.length * 4);\n getUint32Memory().set(arg, ptr / 4);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n/**\n* @param {number} id\n* @returns {Numbering}\n*/\nfunction createNumbering(id) {\n _assertNum(id);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"createNumbering\"](id);\n return Numbering.__wrap(ret);\n}\n\n/**\n* @returns {Delete}\n*/\nfunction createDelete() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"createDelete\"]();\n return Delete.__wrap(ret);\n}\n\n/**\n* @returns {Paragraph}\n*/\nfunction createParagraph() {\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"createParagraph\"]();\n return Paragraph.__wrap(ret);\n}\n\nlet cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nfunction getStringFromWasm(ptr, len) {\n return cachedTextDecoder.decode(getUint8Memory().subarray(ptr, ptr + len));\n}\n\nconst heap = new Array(32);\n\nheap.fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nlet heap_next = heap.length;\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n if (typeof(heap_next) !== 'number') throw new Error('corrupt heap');\n\n heap[idx] = obj;\n return idx;\n}\n\nfunction getObject(idx) { return heap[idx]; }\n\nfunction dropObject(idx) {\n if (idx < 36) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n/**\n*/\nconst TableAlignmentType = Object.freeze({ Center:0,Left:1,Right:2, });\n/**\n*/\nconst SpecialIndentKind = Object.freeze({ FirstLine:0,Hanging:1, });\n/**\n*/\nconst VMergeType = Object.freeze({ Continue:0,Restart:1, });\n/**\n*/\nconst BreakType = Object.freeze({ Page:0,Column:1,TextWrapping:2, });\n/**\n*/\nconst FontPitchType = Object.freeze({ Default:0,Fixed:1,Variable:2, });\n/**\n*/\nconst WidthType = Object.freeze({ DXA:0,Auto:1, });\n/**\n*/\nconst BorderType = Object.freeze({ None:0,Single:1,Thick:2,Double:3,Dotted:4,Dashed:5,DotDash:6,DotDotDash:7,Triple:8, });\n/**\n*/\nconst AlignmentType = Object.freeze({ Center:0,Left:1,Right:2,Justified:3, });\n/**\n*/\nconst StyleType = Object.freeze({ Paragraph:0,Character:1, });\n/**\n*/\nclass Comment {\n\n constructor() {\n throw new Error('cannot invoke `new` directly');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Comment.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_comment_free\"](ptr);\n }\n /**\n * @param {string} author\n * @returns {Comment}\n */\n author(author) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"comment_author\"](ptr, passStringToWasm(author), WASM_VECTOR_LEN);\n return Comment.__wrap(ret);\n }\n /**\n * @param {string} date\n * @returns {Comment}\n */\n date(date) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"comment_date\"](ptr, passStringToWasm(date), WASM_VECTOR_LEN);\n return Comment.__wrap(ret);\n }\n /**\n * @param {Paragraph} p\n * @returns {Comment}\n */\n paragraph(p) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(p, Paragraph);\n if (p.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = p.ptr;\n p.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"comment_paragraph\"](ptr, ptr0);\n return Comment.__wrap(ret);\n }\n /**\n * @returns {number}\n */\n id() {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n _assertNum(this.ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"comment_id\"](this.ptr);\n return ret >>> 0;\n }\n}\n/**\n*/\nclass Delete {\n\n constructor() {\n throw new Error('cannot invoke `new` directly');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Delete.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_delete_free\"](ptr);\n }\n}\n/**\n*/\nclass Docx {\n\n constructor() {\n throw new Error('cannot invoke `new` directly');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Docx.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_docx_free\"](ptr);\n }\n /**\n * @param {Paragraph} p\n * @returns {Docx}\n */\n add_paragraph(p) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(p, Paragraph);\n if (p.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = p.ptr;\n p.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"docx_add_paragraph\"](ptr, ptr0);\n return Docx.__wrap(ret);\n }\n /**\n * @param {Table} t\n * @returns {Docx}\n */\n add_table(t) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(t, Table);\n if (t.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = t.ptr;\n t.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"docx_add_table\"](ptr, ptr0);\n return Docx.__wrap(ret);\n }\n /**\n * @param {Numbering} num\n * @returns {Docx}\n */\n add_numbering(num) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(num, Numbering);\n if (num.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = num.ptr;\n num.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"docx_add_numbering\"](ptr, ptr0);\n return Docx.__wrap(ret);\n }\n /**\n * @returns {Uint8Array}\n */\n build() {\n const retptr = 8;\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n _assertNum(retptr);\n _assertNum(this.ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"docx_build\"](retptr, this.ptr);\n const memi32 = getInt32Memory();\n const v0 = getArrayU8FromWasm(memi32[retptr / 4 + 0], memi32[retptr / 4 + 1]).slice();\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_free\"](memi32[retptr / 4 + 0], memi32[retptr / 4 + 1] * 1);\n return v0;\n }\n}\n/**\n*/\nclass Insert {\n\n constructor() {\n throw new Error('cannot invoke `new` directly');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Insert.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_insert_free\"](ptr);\n }\n}\n/**\n*/\nclass Level {\n\n constructor() {\n throw new Error('cannot invoke `new` directly');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Level.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_level_free\"](ptr);\n }\n /**\n * @param {number} left\n * @param {number | undefined} special_indent_kind\n * @param {number | undefined} special_indent_size\n * @returns {Level}\n */\n indent(left, special_indent_kind, special_indent_size) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(left);\n if (!isLikeNone(special_indent_kind)) {\n _assertNum(special_indent_kind);\n }\n if (!isLikeNone(special_indent_size)) {\n _assertNum(special_indent_size);\n }\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"level_indent\"](ptr, left, isLikeNone(special_indent_kind) ? 2 : special_indent_kind, !isLikeNone(special_indent_size), isLikeNone(special_indent_size) ? 0 : special_indent_size);\n return Level.__wrap(ret);\n }\n}\n/**\n*/\nclass Numbering {\n\n constructor() {\n throw new Error('cannot invoke `new` directly');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Numbering.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_numbering_free\"](ptr);\n }\n /**\n * @param {Level} level\n * @returns {Numbering}\n */\n add_level(level) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(level, Level);\n if (level.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = level.ptr;\n level.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"numbering_add_level\"](ptr, ptr0);\n return Numbering.__wrap(ret);\n }\n}\n/**\n*/\nclass Paragraph {\n\n constructor() {\n throw new Error('cannot invoke `new` directly');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Paragraph.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_paragraph_free\"](ptr);\n }\n /**\n * @param {Run} run\n * @returns {Paragraph}\n */\n add_run(run) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(run, Run);\n if (run.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = run.ptr;\n run.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"paragraph_add_run\"](ptr, ptr0);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {Insert} i\n * @returns {Paragraph}\n */\n add_insert(i) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(i, Insert);\n if (i.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = i.ptr;\n i.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"paragraph_add_insert\"](ptr, ptr0);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {Delete} d\n * @returns {Paragraph}\n */\n add_delete(d) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(d, Delete);\n if (d.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = d.ptr;\n d.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"paragraph_add_delete\"](ptr, ptr0);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {string} id\n * @param {string} name\n * @returns {Paragraph}\n */\n add_bookmark_start(id, name) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"paragraph_add_bookmark_start\"](ptr, passStringToWasm(id), WASM_VECTOR_LEN, passStringToWasm(name), WASM_VECTOR_LEN);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {string} id\n * @returns {Paragraph}\n */\n add_bookmark_end(id) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"paragraph_add_bookmark_end\"](ptr, passStringToWasm(id), WASM_VECTOR_LEN);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {Comment} comment\n * @returns {Paragraph}\n */\n add_comment_start(comment) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(comment, Comment);\n if (comment.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = comment.ptr;\n comment.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"paragraph_add_comment_start\"](ptr, ptr0);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {number} id\n * @returns {Paragraph}\n */\n add_comment_end(id) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(id);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"paragraph_add_comment_end\"](ptr, id);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {number} alignment_type\n * @returns {Paragraph}\n */\n align(alignment_type) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(alignment_type);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"paragraph_align\"](ptr, alignment_type);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {string} style_id\n * @returns {Paragraph}\n */\n style(style_id) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"paragraph_style\"](ptr, passStringToWasm(style_id), WASM_VECTOR_LEN);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {number} left\n * @param {number | undefined} special_indent_kind\n * @param {number | undefined} special_indent_size\n * @returns {Paragraph}\n */\n indent(left, special_indent_kind, special_indent_size) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(left);\n if (!isLikeNone(special_indent_kind)) {\n _assertNum(special_indent_kind);\n }\n if (!isLikeNone(special_indent_size)) {\n _assertNum(special_indent_size);\n }\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"paragraph_indent\"](ptr, left, isLikeNone(special_indent_kind) ? 2 : special_indent_kind, !isLikeNone(special_indent_size), isLikeNone(special_indent_size) ? 0 : special_indent_size);\n return Paragraph.__wrap(ret);\n }\n /**\n * @param {number} id\n * @param {number} level\n * @returns {Paragraph}\n */\n numbering(id, level) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(id);\n _assertNum(level);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"paragraph_numbering\"](ptr, id, level);\n return Paragraph.__wrap(ret);\n }\n}\n/**\n*/\nclass Run {\n\n constructor() {\n throw new Error('cannot invoke `new` directly');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Run.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_run_free\"](ptr);\n }\n /**\n * @param {string} text\n * @returns {Run}\n */\n add_text(text) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"run_add_text\"](ptr, passStringToWasm(text), WASM_VECTOR_LEN);\n return Run.__wrap(ret);\n }\n /**\n * @param {string} text\n * @returns {Run}\n */\n add_delete_text(text) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"run_add_delete_text\"](ptr, passStringToWasm(text), WASM_VECTOR_LEN);\n return Run.__wrap(ret);\n }\n /**\n * @returns {Run}\n */\n add_tab() {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"run_add_tab\"](ptr);\n return Run.__wrap(ret);\n }\n /**\n * @param {number} break_type\n * @returns {Run}\n */\n add_break(break_type) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(break_type);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"run_add_break\"](ptr, break_type);\n return Run.__wrap(ret);\n }\n /**\n * @param {number} size\n * @returns {Run}\n */\n size(size) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(size);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"run_size\"](ptr, size);\n return Run.__wrap(ret);\n }\n /**\n * @param {string} color\n * @returns {Run}\n */\n color(color) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"run_color\"](ptr, passStringToWasm(color), WASM_VECTOR_LEN);\n return Run.__wrap(ret);\n }\n /**\n * @param {string} color\n * @returns {Run}\n */\n highlight(color) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"run_highlight\"](ptr, passStringToWasm(color), WASM_VECTOR_LEN);\n return Run.__wrap(ret);\n }\n /**\n * @returns {Run}\n */\n bold() {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"run_bold\"](ptr);\n return Run.__wrap(ret);\n }\n /**\n * @returns {Run}\n */\n italic() {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"run_italic\"](ptr);\n return Run.__wrap(ret);\n }\n /**\n * @param {string} line_type\n * @returns {Run}\n */\n underline(line_type) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"run_underline\"](ptr, passStringToWasm(line_type), WASM_VECTOR_LEN);\n return Run.__wrap(ret);\n }\n /**\n * @returns {Run}\n */\n vanish() {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"run_vanish\"](ptr);\n return Run.__wrap(ret);\n }\n}\n/**\n*/\nclass Table {\n\n constructor() {\n throw new Error('cannot invoke `new` directly');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(Table.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_table_free\"](ptr);\n }\n /**\n * @param {TableRow} row\n * @returns {Table}\n */\n add_row(row) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(row, TableRow);\n if (row.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = row.ptr;\n row.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"table_add_row\"](ptr, ptr0);\n return Table.__wrap(ret);\n }\n /**\n * @param {Uint32Array} grid\n * @returns {Table}\n */\n set_grid(grid) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"table_set_grid\"](ptr, passArray32ToWasm(grid), WASM_VECTOR_LEN);\n return Table.__wrap(ret);\n }\n /**\n * @param {number} v\n * @returns {Table}\n */\n indent(v) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(v);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"table_indent\"](ptr, v);\n return Table.__wrap(ret);\n }\n /**\n * @param {number} v\n * @returns {Table}\n */\n align(v) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(v);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"table_align\"](ptr, v);\n return Table.__wrap(ret);\n }\n}\n/**\n*/\nclass TableCell {\n\n constructor() {\n throw new Error('cannot invoke `new` directly');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(TableCell.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_tablecell_free\"](ptr);\n }\n /**\n * @param {Paragraph} p\n * @returns {TableCell}\n */\n add_paragraph(p) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(p, Paragraph);\n if (p.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = p.ptr;\n p.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"tablecell_add_paragraph\"](ptr, ptr0);\n return TableCell.__wrap(ret);\n }\n /**\n * @param {number} t\n * @returns {TableCell}\n */\n vertical_merge(t) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(t);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"tablecell_vertical_merge\"](ptr, t);\n return TableCell.__wrap(ret);\n }\n /**\n * @param {number} v\n * @returns {TableCell}\n */\n grid_span(v) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertNum(v);\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"tablecell_grid_span\"](ptr, v);\n return TableCell.__wrap(ret);\n }\n}\n/**\n*/\nclass TableRow {\n\n constructor() {\n throw new Error('cannot invoke `new` directly');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(TableRow.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_tablerow_free\"](ptr);\n }\n /**\n * @param {TableCell} cell\n * @returns {TableRow}\n */\n add_cell(cell) {\n if (this.ptr == 0) throw new Error('Attempt to use a moved value');\n const ptr = this.ptr;\n this.ptr = 0;\n _assertNum(ptr);\n _assertClass(cell, TableCell);\n if (cell.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = cell.ptr;\n cell.ptr = 0;\n const ret = _index_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"tablerow_add_cell\"](ptr, ptr0);\n return TableRow.__wrap(ret);\n }\n}\n\nconst __wbindgen_string_new = function(arg0, arg1) {\n const ret = getStringFromWasm(arg0, arg1);\n return addHeapObject(ret);\n};\n\nconst __wbindgen_object_drop_ref = function(arg0) {\n takeObject(arg0);\n};\n\nconst __wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm(arg0, arg1));\n};\n\nconst __wbindgen_rethrow = function(arg0) {\n throw takeObject(arg0);\n};\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! text-encoding */ \"./node_modules/text-encoding/index.js\")[\"TextEncoder\"], __webpack_require__(/*! text-encoding */ \"./node_modules/text-encoding/index.js\")[\"TextDecoder\"]))\n\n//# sourceURL=webpack:///./pkg/index.js?"); + /***/ + }, -/***/ }), - -/***/ "./pkg/index_bg.wasm": -/*!***************************!*\ + /***/ "./pkg/index_bg.wasm": + /*!***************************!*\ !*** ./pkg/index_bg.wasm ***! \***************************/ -/*! exports provided: memory, __rustc_debug_gdb_scripts_section__, __wbg_run_free, createRun, run_add_text, run_add_delete_text, run_add_tab, run_add_break, run_size, run_color, run_highlight, run_bold, run_italic, run_underline, run_vanish, __wbg_comment_free, createComment, comment_author, comment_date, comment_paragraph, comment_id, __wbg_tablecell_free, createTableCell, tablecell_add_paragraph, tablecell_vertical_merge, tablecell_grid_span, __wbg_tablerow_free, createTableRow, tablerow_add_cell, __wbg_docx_free, createDocx, docx_add_paragraph, docx_add_table, docx_add_numbering, docx_build, __wbg_level_free, createLevel, level_indent, __wbg_insert_free, createInsert, __wbg_table_free, createTable, table_add_row, table_set_grid, table_indent, table_align, __wbg_numbering_free, createNumbering, numbering_add_level, __wbg_delete_free, createDelete, __wbg_paragraph_free, createParagraph, paragraph_add_run, paragraph_add_insert, paragraph_add_delete, paragraph_add_bookmark_start, paragraph_add_bookmark_end, paragraph_add_comment_start, paragraph_add_comment_end, paragraph_align, paragraph_style, paragraph_indent, paragraph_numbering, __wbindgen_malloc, __wbindgen_realloc, __wbindgen_free */ -/***/ (function(module, exports, __webpack_require__) { + /*! exports provided: memory, __rustc_debug_gdb_scripts_section__, __wbg_run_free, createRun, run_add_text, run_add_delete_text, run_add_tab, run_add_break, run_size, run_color, run_highlight, run_bold, run_italic, run_underline, run_vanish, __wbg_comment_free, createComment, comment_author, comment_date, comment_paragraph, comment_id, __wbg_tablecell_free, createTableCell, tablecell_add_paragraph, tablecell_vertical_merge, tablecell_grid_span, __wbg_tablerow_free, createTableRow, tablerow_add_cell, __wbg_docx_free, createDocx, docx_add_paragraph, docx_add_table, docx_add_numbering, docx_build, __wbg_level_free, createLevel, level_indent, __wbg_insert_free, createInsert, __wbg_table_free, createTable, table_add_row, table_set_grid, table_indent, table_align, __wbg_numbering_free, createNumbering, numbering_add_level, __wbg_delete_free, createDelete, __wbg_paragraph_free, createParagraph, paragraph_add_run, paragraph_add_insert, paragraph_add_delete, paragraph_add_bookmark_start, paragraph_add_bookmark_end, paragraph_add_comment_start, paragraph_add_comment_end, paragraph_align, paragraph_style, paragraph_indent, paragraph_numbering, __wbindgen_malloc, __wbindgen_realloc, __wbindgen_free */ + /***/ function(module, exports, __webpack_require__) { + eval( + '"use strict";\n// Instantiate WebAssembly module\nvar wasmExports = __webpack_require__.w[module.i];\n__webpack_require__.r(exports);\n// export exports from WebAssembly module\nfor(var name in wasmExports) if(name != "__webpack_init__") exports[name] = wasmExports[name];\n// exec imports from WebAssembly module (for esm order)\n/* harmony import */ var m0 = __webpack_require__(/*! ./index.js */ "./pkg/index.js");\n\n\n// exec wasm module\nwasmExports["__webpack_init__"]()\n\n//# sourceURL=webpack:///./pkg/index_bg.wasm?' + ); -eval("\"use strict\";\n// Instantiate WebAssembly module\nvar wasmExports = __webpack_require__.w[module.i];\n__webpack_require__.r(exports);\n// export exports from WebAssembly module\nfor(var name in wasmExports) if(name != \"__webpack_init__\") exports[name] = wasmExports[name];\n// exec imports from WebAssembly module (for esm order)\n/* harmony import */ var m0 = __webpack_require__(/*! ./index.js */ \"./pkg/index.js\");\n\n\n// exec wasm module\nwasmExports[\"__webpack_init__\"]()\n\n//# sourceURL=webpack:///./pkg/index_bg.wasm?"); - -/***/ }) - -}]); \ No newline at end of file + /***/ + } + } +]); diff --git a/docx-core/examples/reader.rs b/docx-core/examples/reader.rs index 59cc831..ff1549f 100644 --- a/docx-core/examples/reader.rs +++ b/docx-core/examples/reader.rs @@ -3,7 +3,7 @@ use std::fs::*; use std::io::Read; pub fn main() { - let mut file = File::open("./run.docx").unwrap(); + let mut file = File::open("./10.docx").unwrap(); let mut buf = vec![]; file.read_to_end(&mut buf).unwrap(); dbg!(read_docx(&buf).unwrap().json()); diff --git a/docx-core/src/documents/content_types.rs b/docx-core/src/documents/content_types.rs index e1749c6..6dfbb32 100644 --- a/docx-core/src/documents/content_types.rs +++ b/docx-core/src/documents/content_types.rs @@ -111,7 +111,7 @@ impl FromXML for ContentTypes { Ok(XmlEvent::EndElement { .. }) => { depth -= 1; } - Err(_) => return Err(ReaderError::XMLReadError), + Err(_) => {} _ => {} } } diff --git a/docx-core/src/documents/elements/paragraph.rs b/docx-core/src/documents/elements/paragraph.rs index b9cd7ef..25f7c69 100644 --- a/docx-core/src/documents/elements/paragraph.rs +++ b/docx-core/src/documents/elements/paragraph.rs @@ -69,6 +69,25 @@ impl Serialize for ParagraphChild { t.serialize_field("data", r)?; t.end() } + ParagraphChild::Delete(ref r) => { + let mut t = serializer.serialize_struct("Delete", 2)?; + t.serialize_field("type", "delete")?; + t.serialize_field("data", r)?; + t.end() + } + ParagraphChild::BookmarkStart(ref r) => { + let mut t = serializer.serialize_struct("BookmarkStart", 2)?; + t.serialize_field("type", "bookmarkStart")?; + t.serialize_field("data", r)?; + t.end() + } + ParagraphChild::BookmarkEnd(ref r) => { + let mut t = serializer.serialize_struct("BookmarkEnd", 2)?; + t.serialize_field("type", "bookmarkEnd")?; + t.serialize_field("data", r)?; + t.end() + } + // TODO: Add comment later _ => { let mut t = serializer.serialize_struct("Unsupported", 2)?; t.serialize_field("type", "unsupported")?; diff --git a/docx-core/src/reader/document_rels.rs b/docx-core/src/reader/document_rels.rs index 529c77c..76b7645 100644 --- a/docx-core/src/reader/document_rels.rs +++ b/docx-core/src/reader/document_rels.rs @@ -29,8 +29,8 @@ pub fn read_document_rels( .ok_or(ReaderError::DocumentRelsNotFoundError)?; let p = find_rels_filename(&main_path)?; let p = p.to_str().ok_or(ReaderError::DocumentRelsNotFoundError)?; - let rels_xml = archive.by_name(&p)?; - let rels = read_rels_xml(rels_xml, dir)?; + let data = read_zip(archive, &p)?; + let rels = read_rels_xml(&data[..], dir)?; Ok(rels) } diff --git a/docx-core/src/reader/mod.rs b/docx-core/src/reader/mod.rs index 9a9bcd8..99182d8 100644 --- a/docx-core/src/reader/mod.rs +++ b/docx-core/src/reader/mod.rs @@ -9,6 +9,7 @@ mod level; mod numbering_property; mod numberings; mod paragraph; +mod read_zip; mod rels; mod run; mod style; @@ -27,6 +28,7 @@ pub use attributes::*; pub use document_rels::*; pub use errors::ReaderError; pub use from_xml::*; +pub use read_zip::*; pub use xml_element::*; const DOC_RELATIONSHIP_TYPE: &str = @@ -41,19 +43,26 @@ pub fn read_docx(buf: &[u8]) -> Result { let mut archive = zip::ZipArchive::new(cur)?; // First, the content type for relationship parts and the Main Document part // (the only required part) must be defined (physically located at /[Content_Types].xml in the package) - let content_types_xml = archive.by_name("[Content_Types].xml")?; - let _content_types = ContentTypes::from_xml(content_types_xml)?; + let _content_types = { + let data = read_zip(&mut archive, "[Content_Types].xml")?; + ContentTypes::from_xml(&data[..])? + }; + // Next, the single required relationship (the package-level relationship to the Main Document part) // must be defined (physically located at /_rels/.rels in the package) - let rels_xml = archive.by_name("_rels/.rels")?; - let rels = Rels::from_xml(rels_xml)?; + let rels = { + let data = read_zip(&mut archive, "_rels/.rels")?; + Rels::from_xml(&data[..])? + }; // Finally, the minimum content for the Main Document part must be defined // (physically located at /document.xml in the package): let main_rel = rels .find_target(DOC_RELATIONSHIP_TYPE) .ok_or(ReaderError::DocumentNotFoundError)?; - let document_xml = archive.by_name(&main_rel.2)?; - let document = Document::from_xml(document_xml)?; + let document = { + let data = read_zip(&mut archive, &main_rel.2)?; + Document::from_xml(&data[..])? + }; let mut docx = Docx::new().document(document); // Read document relationships let rels = read_document_rels(&mut archive, &main_rel.2)?; @@ -61,16 +70,22 @@ pub fn read_docx(buf: &[u8]) -> Result { // Read styles let style_path = rels.find_target_path(STYLE_RELATIONSHIP_TYPE); if let Some(style_path) = style_path { - let styles_xml = archive.by_name(style_path.to_str().expect("should have styles"))?; - let styles = Styles::from_xml(styles_xml)?; + let data = read_zip( + &mut archive, + style_path.to_str().expect("should have styles"), + )?; + let styles = Styles::from_xml(&data[..])?; docx = docx.styles(styles); } // Read numberings let num_path = rels.find_target_path(NUMBERING_RELATIONSHIP_TYPE); if let Some(num_path) = num_path { - let num_xml = archive.by_name(num_path.to_str().expect("should have numberings"))?; - let nums = Numberings::from_xml(num_xml)?; + let data = read_zip( + &mut archive, + num_path.to_str().expect("should have numberings"), + )?; + let nums = Numberings::from_xml(&data[..])?; docx = docx.numberings(nums); } diff --git a/docx-core/src/reader/paragraph.rs b/docx-core/src/reader/paragraph.rs index c8072df..964d842 100644 --- a/docx-core/src/reader/paragraph.rs +++ b/docx-core/src/reader/paragraph.rs @@ -122,8 +122,7 @@ mod tests { #[test] fn test_read_indent() { - let c = - r#" + let c = r#" @@ -161,8 +160,7 @@ mod tests { #[test] fn test_read_jc() { - let c = - r#" + let c = r#" @@ -191,8 +189,7 @@ mod tests { #[test] fn test_read_numbering() { - let c = - r#" + let c = r#" @@ -227,8 +224,7 @@ mod tests { #[test] fn test_read_insert() { - let c = - r#" + let c = r#" @@ -264,8 +260,7 @@ mod tests { #[test] fn test_read_delete() { - let c = - r#" + let c = r#" @@ -301,8 +296,7 @@ mod tests { #[test] fn test_read_bookmark() { - let c = - r#" + let c = r#" diff --git a/docx-core/src/reader/read_zip.rs b/docx-core/src/reader/read_zip.rs new file mode 100644 index 0000000..96294f6 --- /dev/null +++ b/docx-core/src/reader/read_zip.rs @@ -0,0 +1,24 @@ +use std::io::{Cursor, Read}; +use zip; + +use super::ReaderError; + +pub fn read_zip( + archive: &mut zip::read::ZipArchive>, + name: &str, +) -> Result, ReaderError> { + let mut p = name.to_owned(); + if p.starts_with('/') { + p.remove(0); + } + let mut xml = archive.by_name(&p)?; + let mut data = vec![]; + xml.read_to_end(&mut data).unwrap(); + // Remove BOM + if (data[0] == 0xef) && (data[1] == 0xbb) && (data[2] == 0xbf) { + data.remove(0); + data.remove(0); + data.remove(0); + } + Ok(data) +} diff --git a/docx-core/src/reader/styles.rs b/docx-core/src/reader/styles.rs index 4d59d1e..6e38d21 100644 --- a/docx-core/src/reader/styles.rs +++ b/docx-core/src/reader/styles.rs @@ -47,8 +47,7 @@ mod tests { #[test] fn test_from_xml() { - let xml = - r#" + let xml = r#" diff --git a/docx-core/src/reader/table.rs b/docx-core/src/reader/table.rs index db436fb..d76f099 100644 --- a/docx-core/src/reader/table.rs +++ b/docx-core/src/reader/table.rs @@ -72,8 +72,7 @@ mod tests { #[test] fn test_read_table_with_width_prop() { - let c = - r#" + let c = r#" @@ -97,8 +96,7 @@ mod tests { #[test] fn test_read_table_with_layout() { - let c = - r#" + let c = r#" diff --git a/docx-core/src/reader/table_cell.rs b/docx-core/src/reader/table_cell.rs index 93bc5d0..b730a51 100644 --- a/docx-core/src/reader/table_cell.rs +++ b/docx-core/src/reader/table_cell.rs @@ -94,8 +94,7 @@ mod tests { #[test] fn test_read_cell_with_prop() { - let c = - r#" + let c = r#" diff --git a/docx-core/src/types/alignment_type.rs b/docx-core/src/types/alignment_type.rs index 2a62850..1bc52e3 100644 --- a/docx-core/src/types/alignment_type.rs +++ b/docx-core/src/types/alignment_type.rs @@ -10,7 +10,9 @@ pub enum AlignmentType { Center, Left, Right, + Both, Justified, + Unsupported, } impl fmt::Display for AlignmentType { @@ -19,7 +21,9 @@ impl fmt::Display for AlignmentType { AlignmentType::Center => write!(f, "center"), AlignmentType::Left => write!(f, "left"), AlignmentType::Right => write!(f, "right"), + AlignmentType::Both => write!(f, "both"), AlignmentType::Justified => write!(f, "justified"), + _ => write!(f, "unsupported"), } } } @@ -31,8 +35,9 @@ impl FromStr for AlignmentType { "left" => Ok(AlignmentType::Left), "right" => Ok(AlignmentType::Right), "center" => Ok(AlignmentType::Center), + "both" => Ok(AlignmentType::Both), "justified" => Ok(AlignmentType::Justified), - _ => Err(errors::TypeError::FromStrError), + _ => Ok(AlignmentType::Unsupported), } } } diff --git a/docx-core/src/types/break_type.rs b/docx-core/src/types/break_type.rs index d08124f..16b72ed 100644 --- a/docx-core/src/types/break_type.rs +++ b/docx-core/src/types/break_type.rs @@ -16,6 +16,7 @@ pub enum BreakType { Page, Column, TextWrapping, + Unsupported, } impl fmt::Display for BreakType { @@ -24,6 +25,7 @@ impl fmt::Display for BreakType { BreakType::Page => write!(f, "page"), BreakType::Column => write!(f, "column"), BreakType::TextWrapping => write!(f, "textWrapping"), + BreakType::Unsupported => write!(f, "unsupported"), } } } @@ -35,7 +37,7 @@ impl FromStr for BreakType { "page" => Ok(BreakType::Page), "column" => Ok(BreakType::Column), "textWrapping" => Ok(BreakType::TextWrapping), - _ => Err(errors::TypeError::FromStrError), + _ => Ok(BreakType::Unsupported), } } } diff --git a/docx-core/src/types/style_type.rs b/docx-core/src/types/style_type.rs index a9c99f6..6c3b244 100644 --- a/docx-core/src/types/style_type.rs +++ b/docx-core/src/types/style_type.rs @@ -12,6 +12,7 @@ pub enum StyleType { Paragraph, Character, Numbering, + Table, Unsupported, } @@ -21,6 +22,7 @@ impl fmt::Display for StyleType { StyleType::Paragraph => write!(f, "paragraph"), StyleType::Character => write!(f, "character"), StyleType::Numbering => write!(f, "numbering"), + StyleType::Table => write!(f, "table"), StyleType::Unsupported => write!(f, "unsupported"), } } @@ -33,6 +35,7 @@ impl FromStr for StyleType { "paragraph" => Ok(StyleType::Paragraph), "character" => Ok(StyleType::Character), "numbering" => Ok(StyleType::Numbering), + "table" => Ok(StyleType::Table), _ => Ok(StyleType::Unsupported), } } diff --git a/docx-core/src/types/vertical_merge_type.rs b/docx-core/src/types/vertical_merge_type.rs index f0920b2..bc2fc46 100644 --- a/docx-core/src/types/vertical_merge_type.rs +++ b/docx-core/src/types/vertical_merge_type.rs @@ -9,6 +9,7 @@ use std::str::FromStr; pub enum VMergeType { Continue, Restart, + Unsupported, } impl fmt::Display for VMergeType { @@ -16,6 +17,7 @@ impl fmt::Display for VMergeType { match *self { VMergeType::Continue => write!(f, "continue"), VMergeType::Restart => write!(f, "restart"), + VMergeType::Unsupported => write!(f, "unsupported"), } } } @@ -26,7 +28,7 @@ impl FromStr for VMergeType { match s { "continue" => Ok(VMergeType::Continue), "restart" => Ok(VMergeType::Restart), - _ => Err(errors::TypeError::FromStrError), + _ => Ok(VMergeType::Unsupported), } } } diff --git a/docx-core/src/types/width_type.rs b/docx-core/src/types/width_type.rs index fe5cc61..d2ef154 100644 --- a/docx-core/src/types/width_type.rs +++ b/docx-core/src/types/width_type.rs @@ -11,6 +11,7 @@ pub enum WidthType { DXA, Auto, Pct, + Unsupported, } impl fmt::Display for WidthType { @@ -19,6 +20,7 @@ impl fmt::Display for WidthType { WidthType::DXA => write!(f, "dxa"), WidthType::Auto => write!(f, "auto"), WidthType::Pct => write!(f, "pct"), + WidthType::Unsupported => write!(f, "unsupported"), } } } @@ -30,7 +32,7 @@ impl FromStr for WidthType { "dxa" => Ok(WidthType::DXA), "auto" => Ok(WidthType::Auto), "pct" => Ok(WidthType::Pct), - _ => Err(errors::TypeError::FromStrError), + _ => Ok(WidthType::Unsupported), } } } diff --git a/docx-core/tests/reader.rs b/docx-core/tests/reader.rs index ed756b6..e4e1df6 100644 --- a/docx-core/tests/reader.rs +++ b/docx-core/tests/reader.rs @@ -33,3 +33,139 @@ pub fn read_numbering() { file.write_all(json.as_bytes()).unwrap(); file.flush().unwrap(); } + +#[test] +pub fn read_decoration() { + let mut file = File::open("../fixtures/decoration/decoration.docx").unwrap(); + let mut buf = vec![]; + file.read_to_end(&mut buf).unwrap(); + let json = read_docx(&buf).unwrap().json(); + + assert_debug_snapshot!(&json); + + let path = std::path::Path::new("./tests/output/decoration.json"); + let mut file = std::fs::File::create(&path).unwrap(); + file.write_all(json.as_bytes()).unwrap(); + file.flush().unwrap(); +} + +#[test] +pub fn read_highlight_and_underline() { + let mut file = + File::open("../fixtures/highlight_and_underline/highlight_and_underline.docx").unwrap(); + let mut buf = vec![]; + file.read_to_end(&mut buf).unwrap(); + let json = read_docx(&buf).unwrap().json(); + + assert_debug_snapshot!(&json); + + let path = std::path::Path::new("./tests/output/highlight_and_underline.json"); + let mut file = std::fs::File::create(&path).unwrap(); + file.write_all(json.as_bytes()).unwrap(); + file.flush().unwrap(); +} + +#[test] +pub fn read_history() { + let mut file = File::open("../fixtures/history_libre_office/history.docx").unwrap(); + let mut buf = vec![]; + file.read_to_end(&mut buf).unwrap(); + let json = read_docx(&buf).unwrap().json(); + + assert_debug_snapshot!(&json); + + let path = std::path::Path::new("./tests/output/history.json"); + let mut file = std::fs::File::create(&path).unwrap(); + file.write_all(json.as_bytes()).unwrap(); + file.flush().unwrap(); +} + +#[test] +pub fn read_indent_word_online() { + let mut file = File::open("../fixtures/indent_word_online/indent.docx").unwrap(); + let mut buf = vec![]; + file.read_to_end(&mut buf).unwrap(); + let json = read_docx(&buf).unwrap().json(); + + assert_debug_snapshot!(&json); + + let path = std::path::Path::new("./tests/output/indent_word_online.json"); + let mut file = std::fs::File::create(&path).unwrap(); + file.write_all(json.as_bytes()).unwrap(); + file.flush().unwrap(); +} + +#[test] +pub fn read_tab_and_break() { + let mut file = File::open("../fixtures/tab_and_break/tab_and_break.docx").unwrap(); + let mut buf = vec![]; + file.read_to_end(&mut buf).unwrap(); + let json = read_docx(&buf).unwrap().json(); + + assert_debug_snapshot!(&json); + + let path = std::path::Path::new("./tests/output/tab_and_break.json"); + let mut file = std::fs::File::create(&path).unwrap(); + file.write_all(json.as_bytes()).unwrap(); + file.flush().unwrap(); +} + +#[test] +pub fn read_table_docx() { + let mut file = File::open("../fixtures/table_docx/table.docx").unwrap(); + let mut buf = vec![]; + file.read_to_end(&mut buf).unwrap(); + let json = read_docx(&buf).unwrap().json(); + + assert_debug_snapshot!(&json); + + let path = std::path::Path::new("./tests/output/table_docx.json"); + let mut file = std::fs::File::create(&path).unwrap(); + file.write_all(json.as_bytes()).unwrap(); + file.flush().unwrap(); +} + +#[test] +pub fn read_table_merged_libre_office() { + let mut file = File::open("../fixtures/table_merged_libre_office/table_merged.docx").unwrap(); + let mut buf = vec![]; + file.read_to_end(&mut buf).unwrap(); + let json = read_docx(&buf).unwrap().json(); + + assert_debug_snapshot!(&json); + + let path = std::path::Path::new("./tests/output/table_merged_libre_office.json"); + let mut file = std::fs::File::create(&path).unwrap(); + file.write_all(json.as_bytes()).unwrap(); + file.flush().unwrap(); +} + +#[test] +pub fn read_bom() { + let mut file = File::open("../fixtures/bom/bom.docx").unwrap(); + let mut buf = vec![]; + file.read_to_end(&mut buf).unwrap(); + let json = read_docx(&buf).unwrap().json(); + + assert_debug_snapshot!(&json); + + let path = std::path::Path::new("./tests/output/bom.json"); + let mut file = std::fs::File::create(&path).unwrap(); + file.write_all(json.as_bytes()).unwrap(); + file.flush().unwrap(); +} + +#[test] +pub fn read_bookmark() { + let mut file = File::open("../fixtures/bookmark/bookmark.docx").unwrap(); + let mut buf = vec![]; + file.read_to_end(&mut buf).unwrap(); + let json = read_docx(&buf).unwrap().json(); + + assert_debug_snapshot!(&json); + + let path = std::path::Path::new("./tests/output/bookmark.json"); + let mut file = std::fs::File::create(&path).unwrap(); + file.write_all(json.as_bytes()).unwrap(); + file.flush().unwrap(); +} diff --git a/docx-core/tests/snapshots/lib__reader__read_bom.snap b/docx-core/tests/snapshots/lib__reader__read_bom.snap new file mode 100644 index 0000000..9262b78 --- /dev/null +++ b/docx-core/tests/snapshots/lib__reader__read_bom.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"DefaultParagraphFont\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"TableNormal\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"NoList\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"bookmarkStart\",\n \"data\": {\n \"id\": 0,\n \"name\": \"_GoBack\"\n }\n },\n {\n \"type\": \"bookmarkEnd\",\n \"data\": {\n \"id\": 0\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/lib__reader__read_bookmark.snap b/docx-core/tests/snapshots/lib__reader__read_bookmark.snap new file mode 100644 index 0000000..732314c --- /dev/null +++ b/docx-core/tests/snapshots/lib__reader__read_bookmark.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": \"auto\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style14\",\n \"name\": \"見出し\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 28,\n \"szCs\": 28,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style15\",\n \"name\": \"Body Text\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style16\",\n \"name\": \"List\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style17\",\n \"name\": \"Caption\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style18\",\n \"name\": \"索引\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"bookmarkStart\",\n \"data\": {\n \"id\": 0,\n \"name\": \"ABCD-1234\"\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Bookmarked\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"bookmarkEnd\",\n \"data\": {\n \"id\": 0\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/lib__reader__read_decoration.snap b/docx-core/tests/snapshots/lib__reader__read_decoration.snap new file mode 100644 index 0000000..2799d68 --- /dev/null +++ b/docx-core/tests/snapshots/lib__reader__read_decoration.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": \"auto\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style14\",\n \"name\": \"見出し\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 28,\n \"szCs\": 28,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style15\",\n \"name\": \"Body Text\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style16\",\n \"name\": \"List\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style17\",\n \"name\": \"Caption\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style18\",\n \"name\": \"索引\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello \"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": true,\n \"boldCs\": true,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"World\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"!!\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello \"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"CE181E\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": true,\n \"boldCs\": true,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"World\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"!!\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"000000\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello \"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"000000\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": true,\n \"boldCs\": true,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"World\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"000000\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"!!\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"000000\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello \"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"000000\",\n \"highlight\": \"yellow\",\n \"underline\": null,\n \"bold\": true,\n \"boldCs\": true,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"World\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"000000\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"!!\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/lib__reader__read_highlight_and_underline.snap b/docx-core/tests/snapshots/lib__reader__read_highlight_and_underline.snap new file mode 100644 index 0000000..35017df --- /dev/null +++ b/docx-core/tests/snapshots/lib__reader__read_highlight_and_underline.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": \"auto\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style14\",\n \"name\": \"見出し\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 28,\n \"szCs\": 28,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style15\",\n \"name\": \"Body Text\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style16\",\n \"name\": \"List\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style17\",\n \"name\": \"Caption\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style18\",\n \"name\": \"索引\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": \"yellow\",\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"マーカー\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": \"single\",\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"下線\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/lib__reader__read_history.snap b/docx-core/tests/snapshots/lib__reader__read_history.snap new file mode 100644 index 0000000..04a4265 --- /dev/null +++ b/docx-core/tests/snapshots/lib__reader__read_history.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": \"auto\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style14\",\n \"name\": \"見出し\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 28,\n \"szCs\": 28,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style15\",\n \"name\": \"Body Text\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style16\",\n \"name\": \"List\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style17\",\n \"name\": \"Caption\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style18\",\n \"name\": \"索引\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"insert\",\n \"data\": {\n \"run\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"W\"\n }\n }\n ]\n },\n \"author\": \"不明な作成者\",\n \"date\": \"2019-11-15T14:19:04Z\"\n }\n },\n {\n \"type\": \"insert\",\n \"data\": {\n \"run\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"a\"\n }\n }\n ]\n },\n \"author\": \"不明な作成者\",\n \"date\": \"2019-11-15T14:19:04Z\"\n }\n },\n {\n \"type\": \"insert\",\n \"data\": {\n \"run\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"rld\"\n }\n }\n ]\n },\n \"author\": \"不明な作成者\",\n \"date\": \"2019-11-15T14:19:04Z\"\n }\n },\n {\n \"type\": \"delete\",\n \"data\": {\n \"author\": \"不明な作成者\",\n \"date\": \"2019-11-15T14:19:04Z\",\n \"run\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"deleteText\",\n \"data\": {\n \"text\": \"Hello \",\n \"preserveSpace\": true\n }\n }\n ]\n }\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/lib__reader__read_indent_word_online.snap b/docx-core/tests/snapshots/lib__reader__read_indent_word_online.snap new file mode 100644 index 0000000..79fcff0 --- /dev/null +++ b/docx-core/tests/snapshots/lib__reader__read_indent_word_online.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"DefaultParagraphFont\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"TableNormal\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"NoList\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 22,\n \"szCs\": 22,\n \"color\": \"222222\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 0\n }\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 22,\n \"szCs\": 22,\n \"color\": \"222222\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 1560,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/lib__reader__read_tab_and_break.snap b/docx-core/tests/snapshots/lib__reader__read_tab_and_break.snap new file mode 100644 index 0000000..6928e6f --- /dev/null +++ b/docx-core/tests/snapshots/lib__reader__read_tab_and_break.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": \"auto\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style14\",\n \"name\": \"見出し\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 28,\n \"szCs\": 28,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style15\",\n \"name\": \"Body Text\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style16\",\n \"name\": \"List\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style17\",\n \"name\": \"Caption\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style18\",\n \"name\": \"索引\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Start\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"break\",\n \"data\": {\n \"breakType\": \"page\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Break\"\n }\n },\n {\n \"type\": \"tab\"\n },\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Tabaaa\"\n }\n },\n {\n \"type\": \"tab\"\n },\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"aaaaa\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/lib__reader__read_table_docx.snap b/docx-core/tests/snapshots/lib__reader__read_table_docx.snap new file mode 100644 index 0000000..6cdc662 --- /dev/null +++ b/docx-core/tests/snapshots/lib__reader__read_table_docx.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Title\",\n \"name\": \"Title\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 56,\n \"szCs\": 56,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Heading1\",\n \"name\": \"Heading 1\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 32,\n \"szCs\": 32,\n \"color\": \"2E74B5\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Heading2\",\n \"name\": \"Heading 2\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 26,\n \"szCs\": 26,\n \"color\": \"2E74B5\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Heading3\",\n \"name\": \"Heading 3\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": \"1F4D78\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Heading4\",\n \"name\": \"Heading 4\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"2E74B5\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Heading5\",\n \"name\": \"Heading 5\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"2E74B5\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Heading6\",\n \"name\": \"Heading 6\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"1F4D78\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"ListParagraph\",\n \"name\": \"List Paragraph\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Hyperlink\",\n \"name\": \"Hyperlink\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"0563C1\",\n \"highlight\": null,\n \"underline\": \"single\",\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"FootnoteReference\",\n \"name\": \"footnote reference\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"FootnoteText\",\n \"name\": \"footnote text\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 20,\n \"szCs\": 20,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"FootnoteTextChar\",\n \"name\": \"Footnote Text Char\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": 20,\n \"szCs\": 20,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"table\",\n \"data\": {\n \"rows\": [\n {\n \"cells\": [\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": null,\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": null,\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": null,\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n }\n ],\n \"hasNumbering\": false,\n \"property\": {}\n },\n {\n \"cells\": [\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": null,\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": null,\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": null,\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n }\n ],\n \"hasNumbering\": false,\n \"property\": {}\n }\n ],\n \"grid\": [\n 2985,\n 3000,\n 3000\n ],\n \"hasNumbering\": false,\n \"property\": {\n \"width\": {\n \"width\": 8985,\n \"widthType\": \"DXA\"\n },\n \"justification\": \"left\",\n \"borders\": {\n \"top\": {\n \"position\": \"top\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"left\": {\n \"position\": \"left\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"bottom\": {\n \"position\": \"bottom\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"right\": {\n \"position\": \"right\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"insideH\": {\n \"position\": \"insideH\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"insideV\": {\n \"position\": \"insideV\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n }\n },\n \"margins\": {\n \"top\": 55,\n \"left\": 54,\n \"bottom\": 55,\n \"right\": 55\n },\n \"indent\": null\n }\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [\n {\n \"id\": 0,\n \"levels\": [\n {\n \"level\": 0,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"●\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 720,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 1,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"○\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 1440,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 2,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"■\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 2160,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 3,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"●\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 2880,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 4,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"○\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 3600,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 5,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"■\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 4320,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 6,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"●\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 5040,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 7,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"○\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 5760,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 8,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"■\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 6480,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n }\n ]\n }\n ],\n \"numberings\": [\n {\n \"id\": 1,\n \"abstractNumId\": 0\n }\n ]\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/lib__reader__read_table_merged_libre_office.snap b/docx-core/tests/snapshots/lib__reader__read_table_merged_libre_office.snap new file mode 100644 index 0000000..cdfc761 --- /dev/null +++ b/docx-core/tests/snapshots/lib__reader__read_table_merged_libre_office.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": \"auto\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style14\",\n \"name\": \"見出し\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 28,\n \"szCs\": 28,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style15\",\n \"name\": \"Body Text\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style16\",\n \"name\": \"List\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style17\",\n \"name\": \"Caption\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style18\",\n \"name\": \"索引\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style19\",\n \"name\": \"表の内容\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style20\",\n \"name\": \"表の見出し\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": true,\n \"boldCs\": true,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"center\",\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"table\",\n \"data\": {\n \"rows\": [\n {\n \"cells\": [\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Style19\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 6425,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": 2,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Style19\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 3213,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": \"restart\"\n },\n \"hasNumbering\": false\n }\n ],\n \"hasNumbering\": false,\n \"property\": {}\n },\n {\n \"cells\": [\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Style19\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 3212,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": \"restart\"\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 3213,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Style19\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 3213,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": \"continue\"\n },\n \"hasNumbering\": false\n }\n ],\n \"hasNumbering\": false,\n \"property\": {}\n },\n {\n \"cells\": [\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Style19\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 3212,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": \"continue\"\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 3213,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Style19\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 3213,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": \"continue\"\n },\n \"hasNumbering\": false\n }\n ],\n \"hasNumbering\": false,\n \"property\": {}\n }\n ],\n \"grid\": [\n 3212,\n 3213,\n 3213\n ],\n \"hasNumbering\": false,\n \"property\": {\n \"width\": {\n \"width\": 9638,\n \"widthType\": \"DXA\"\n },\n \"justification\": \"left\",\n \"borders\": {\n \"top\": {\n \"position\": \"top\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"left\": {\n \"position\": \"left\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"bottom\": {\n \"position\": \"bottom\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"right\": {\n \"position\": \"right\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"insideH\": {\n \"position\": \"insideH\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"insideV\": {\n \"position\": \"insideV\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n }\n },\n \"margins\": {\n \"top\": 55,\n \"left\": 54,\n \"bottom\": 55,\n \"right\": 55\n },\n \"indent\": {\n \"width\": 0,\n \"widthType\": \"DXA\"\n }\n }\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/reader__read_bom.snap b/docx-core/tests/snapshots/reader__read_bom.snap new file mode 100644 index 0000000..9262b78 --- /dev/null +++ b/docx-core/tests/snapshots/reader__read_bom.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"DefaultParagraphFont\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"TableNormal\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"NoList\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"bookmarkStart\",\n \"data\": {\n \"id\": 0,\n \"name\": \"_GoBack\"\n }\n },\n {\n \"type\": \"bookmarkEnd\",\n \"data\": {\n \"id\": 0\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/reader__read_bookmark.snap b/docx-core/tests/snapshots/reader__read_bookmark.snap new file mode 100644 index 0000000..732314c --- /dev/null +++ b/docx-core/tests/snapshots/reader__read_bookmark.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": \"auto\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style14\",\n \"name\": \"見出し\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 28,\n \"szCs\": 28,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style15\",\n \"name\": \"Body Text\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style16\",\n \"name\": \"List\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style17\",\n \"name\": \"Caption\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style18\",\n \"name\": \"索引\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"bookmarkStart\",\n \"data\": {\n \"id\": 0,\n \"name\": \"ABCD-1234\"\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Bookmarked\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"bookmarkEnd\",\n \"data\": {\n \"id\": 0\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/reader__read_decoration.snap b/docx-core/tests/snapshots/reader__read_decoration.snap new file mode 100644 index 0000000..2799d68 --- /dev/null +++ b/docx-core/tests/snapshots/reader__read_decoration.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": \"auto\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style14\",\n \"name\": \"見出し\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 28,\n \"szCs\": 28,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style15\",\n \"name\": \"Body Text\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style16\",\n \"name\": \"List\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style17\",\n \"name\": \"Caption\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style18\",\n \"name\": \"索引\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello \"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": true,\n \"boldCs\": true,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"World\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"!!\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello \"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"CE181E\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": true,\n \"boldCs\": true,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"World\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"!!\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"000000\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello \"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"000000\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": true,\n \"boldCs\": true,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"World\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"000000\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"!!\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"000000\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello \"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"000000\",\n \"highlight\": \"yellow\",\n \"underline\": null,\n \"bold\": true,\n \"boldCs\": true,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"World\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"000000\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"!!\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/reader__read_highlight_and_underline.snap b/docx-core/tests/snapshots/reader__read_highlight_and_underline.snap new file mode 100644 index 0000000..35017df --- /dev/null +++ b/docx-core/tests/snapshots/reader__read_highlight_and_underline.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": \"auto\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style14\",\n \"name\": \"見出し\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 28,\n \"szCs\": 28,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style15\",\n \"name\": \"Body Text\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style16\",\n \"name\": \"List\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style17\",\n \"name\": \"Caption\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style18\",\n \"name\": \"索引\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": \"yellow\",\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"マーカー\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": \"single\",\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"下線\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/reader__read_history.snap b/docx-core/tests/snapshots/reader__read_history.snap new file mode 100644 index 0000000..04a4265 --- /dev/null +++ b/docx-core/tests/snapshots/reader__read_history.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": \"auto\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style14\",\n \"name\": \"見出し\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 28,\n \"szCs\": 28,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style15\",\n \"name\": \"Body Text\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style16\",\n \"name\": \"List\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style17\",\n \"name\": \"Caption\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style18\",\n \"name\": \"索引\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"insert\",\n \"data\": {\n \"run\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"W\"\n }\n }\n ]\n },\n \"author\": \"不明な作成者\",\n \"date\": \"2019-11-15T14:19:04Z\"\n }\n },\n {\n \"type\": \"insert\",\n \"data\": {\n \"run\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"a\"\n }\n }\n ]\n },\n \"author\": \"不明な作成者\",\n \"date\": \"2019-11-15T14:19:04Z\"\n }\n },\n {\n \"type\": \"insert\",\n \"data\": {\n \"run\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"rld\"\n }\n }\n ]\n },\n \"author\": \"不明な作成者\",\n \"date\": \"2019-11-15T14:19:04Z\"\n }\n },\n {\n \"type\": \"delete\",\n \"data\": {\n \"author\": \"不明な作成者\",\n \"date\": \"2019-11-15T14:19:04Z\",\n \"run\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"deleteText\",\n \"data\": {\n \"text\": \"Hello \",\n \"preserveSpace\": true\n }\n }\n ]\n }\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/reader__read_indent_word_online.snap b/docx-core/tests/snapshots/reader__read_indent_word_online.snap new file mode 100644 index 0000000..79fcff0 --- /dev/null +++ b/docx-core/tests/snapshots/reader__read_indent_word_online.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"DefaultParagraphFont\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"TableNormal\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"NoList\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 22,\n \"szCs\": 22,\n \"color\": \"222222\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 0\n }\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 22,\n \"szCs\": 22,\n \"color\": \"222222\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 1560,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/reader__read_tab_and_break.snap b/docx-core/tests/snapshots/reader__read_tab_and_break.snap new file mode 100644 index 0000000..6928e6f --- /dev/null +++ b/docx-core/tests/snapshots/reader__read_tab_and_break.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": \"auto\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style14\",\n \"name\": \"見出し\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 28,\n \"szCs\": 28,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style15\",\n \"name\": \"Body Text\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style16\",\n \"name\": \"List\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style17\",\n \"name\": \"Caption\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style18\",\n \"name\": \"索引\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Start\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"break\",\n \"data\": {\n \"breakType\": \"page\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Break\"\n }\n },\n {\n \"type\": \"tab\"\n },\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Tabaaa\"\n }\n },\n {\n \"type\": \"tab\"\n },\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"aaaaa\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/reader__read_table_docx.snap b/docx-core/tests/snapshots/reader__read_table_docx.snap new file mode 100644 index 0000000..6cdc662 --- /dev/null +++ b/docx-core/tests/snapshots/reader__read_table_docx.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Title\",\n \"name\": \"Title\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 56,\n \"szCs\": 56,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Heading1\",\n \"name\": \"Heading 1\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 32,\n \"szCs\": 32,\n \"color\": \"2E74B5\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Heading2\",\n \"name\": \"Heading 2\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 26,\n \"szCs\": 26,\n \"color\": \"2E74B5\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Heading3\",\n \"name\": \"Heading 3\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": \"1F4D78\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Heading4\",\n \"name\": \"Heading 4\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"2E74B5\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Heading5\",\n \"name\": \"Heading 5\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"2E74B5\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Heading6\",\n \"name\": \"Heading 6\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"1F4D78\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"ListParagraph\",\n \"name\": \"List Paragraph\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Hyperlink\",\n \"name\": \"Hyperlink\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": \"0563C1\",\n \"highlight\": null,\n \"underline\": \"single\",\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"FootnoteReference\",\n \"name\": \"footnote reference\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"FootnoteText\",\n \"name\": \"footnote text\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 20,\n \"szCs\": 20,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"FootnoteTextChar\",\n \"name\": \"Footnote Text Char\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": 20,\n \"szCs\": 20,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n },\n {\n \"type\": \"table\",\n \"data\": {\n \"rows\": [\n {\n \"cells\": [\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": null,\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": null,\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": null,\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n }\n ],\n \"hasNumbering\": false,\n \"property\": {}\n },\n {\n \"cells\": [\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": null,\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": null,\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": null,\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n }\n ],\n \"hasNumbering\": false,\n \"property\": {}\n }\n ],\n \"grid\": [\n 2985,\n 3000,\n 3000\n ],\n \"hasNumbering\": false,\n \"property\": {\n \"width\": {\n \"width\": 8985,\n \"widthType\": \"DXA\"\n },\n \"justification\": \"left\",\n \"borders\": {\n \"top\": {\n \"position\": \"top\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"left\": {\n \"position\": \"left\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"bottom\": {\n \"position\": \"bottom\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"right\": {\n \"position\": \"right\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"insideH\": {\n \"position\": \"insideH\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"insideV\": {\n \"position\": \"insideV\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n }\n },\n \"margins\": {\n \"top\": 55,\n \"left\": 54,\n \"bottom\": 55,\n \"right\": 55\n },\n \"indent\": null\n }\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"left\",\n \"indent\": {\n \"start\": 0,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [\n {\n \"id\": 0,\n \"levels\": [\n {\n \"level\": 0,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"●\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 720,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 1,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"○\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 1440,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 2,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"■\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 2160,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 3,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"●\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 2880,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 4,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"○\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 3600,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 5,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"■\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 4320,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 6,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"●\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 5040,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 7,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"○\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 5760,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n },\n {\n \"level\": 8,\n \"start\": 1,\n \"format\": \"bullet\",\n \"text\": \"■\",\n \"jc\": \"left\",\n \"pstyle\": null,\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 6480,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 360\n }\n }\n }\n }\n ]\n }\n ],\n \"numberings\": [\n {\n \"id\": 1,\n \"abstractNumId\": 0\n }\n ]\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-core/tests/snapshots/reader__read_table_merged_libre_office.snap b/docx-core/tests/snapshots/reader__read_table_merged_libre_office.snap new file mode 100644 index 0000000..cdfc761 --- /dev/null +++ b/docx-core/tests/snapshots/reader__read_table_merged_libre_office.snap @@ -0,0 +1,5 @@ +--- +source: docx-core/tests/reader.rs +expression: "&json" +--- +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": \"auto\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style14\",\n \"name\": \"見出し\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 28,\n \"szCs\": 28,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style15\",\n \"name\": \"Body Text\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style16\",\n \"name\": \"List\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style17\",\n \"name\": \"Caption\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": 24,\n \"szCs\": 24,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": true,\n \"italicCs\": true,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style18\",\n \"name\": \"索引\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style19\",\n \"name\": \"表の内容\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"Style20\",\n \"name\": \"表の見出し\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": true,\n \"boldCs\": true,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": \"center\",\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"table\",\n \"data\": {\n \"rows\": [\n {\n \"cells\": [\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Style19\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 6425,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": 2,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Style19\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 3213,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": \"restart\"\n },\n \"hasNumbering\": false\n }\n ],\n \"hasNumbering\": false,\n \"property\": {}\n },\n {\n \"cells\": [\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Style19\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 3212,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": \"restart\"\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 3213,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Style19\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 3213,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": \"continue\"\n },\n \"hasNumbering\": false\n }\n ],\n \"hasNumbering\": false,\n \"property\": {}\n },\n {\n \"cells\": [\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Style19\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 3212,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": \"continue\"\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 3213,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": null\n },\n \"hasNumbering\": false\n },\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Style19\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"property\": {\n \"width\": {\n \"width\": 3213,\n \"widthType\": \"DXA\"\n },\n \"borders\": null,\n \"gridSpan\": null,\n \"verticalMerge\": \"continue\"\n },\n \"hasNumbering\": false\n }\n ],\n \"hasNumbering\": false,\n \"property\": {}\n }\n ],\n \"grid\": [\n 3212,\n 3213,\n 3213\n ],\n \"hasNumbering\": false,\n \"property\": {\n \"width\": {\n \"width\": 9638,\n \"widthType\": \"DXA\"\n },\n \"justification\": \"left\",\n \"borders\": {\n \"top\": {\n \"position\": \"top\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"left\": {\n \"position\": \"left\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"bottom\": {\n \"position\": \"bottom\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"right\": {\n \"position\": \"right\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"insideH\": {\n \"position\": \"insideH\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n },\n \"insideV\": {\n \"position\": \"insideV\",\n \"borderType\": \"single\",\n \"size\": 2,\n \"space\": 0,\n \"color\": \"000000\"\n }\n },\n \"margins\": {\n \"top\": 55,\n \"left\": 54,\n \"bottom\": 55,\n \"right\": 55\n },\n \"indent\": {\n \"width\": 0,\n \"widthType\": \"DXA\"\n }\n }\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"children\": []\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false,\n \"attrs\": []\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100\n },\n \"fontTable\": {}\n}" diff --git a/docx-wasm/js/index.ts b/docx-wasm/js/index.ts index 365d50a..a431dec 100644 --- a/docx-wasm/js/index.ts +++ b/docx-wasm/js/index.ts @@ -14,6 +14,7 @@ import { AbstractNumbering } from "./abstract-numbering"; import { Numbering } from "./numbering"; import { BookmarkStart } from "./bookmark-start"; import { BookmarkEnd } from "./bookmark-end"; +import { DocxJSON } from "./json"; import * as wasm from "../pkg"; @@ -287,7 +288,7 @@ export class Docx { } export const readDocx = (buf: Uint8Array) => { - return wasm.readDocx(buf); + return JSON.parse(wasm.readDocx(buf)) as DocxJSON; }; export * from "./paragraph"; @@ -307,3 +308,4 @@ export * from "./break"; export * from "./delete-text"; export * from "./level"; export * from "./tab"; +export * from "./json"; diff --git a/docx-wasm/js/json/border.ts b/docx-wasm/js/json/border.ts new file mode 100644 index 0000000..e49a831 --- /dev/null +++ b/docx-wasm/js/json/border.ts @@ -0,0 +1,7 @@ +export type BorderJSON = { + position: string; + borderType: string; + size: number; + space: number; + color: string; +}; diff --git a/docx-wasm/js/json/document.ts b/docx-wasm/js/json/document.ts new file mode 100644 index 0000000..d403d49 --- /dev/null +++ b/docx-wasm/js/json/document.ts @@ -0,0 +1,26 @@ +import { ParagraphJSON } from "./paragraph"; +import { TableJSON } from "./table"; + +export type DocumentChildJSON = ParagraphJSON | TableJSON; + +export type DocumentJSON = { + children: DocumentChildJSON[]; + sectionProperty: { + pageSize: { + w: number; + h: number; + }; + pageMargin: { + top: number; + left: number; + bottom: number; + right: number; + header: number; + footer: number; + gutter: number; + }; + columns: number; + documentGrid: number; + }; + hasNumbering: boolean; +}; diff --git a/docx-wasm/js/json/index.ts b/docx-wasm/js/json/index.ts new file mode 100644 index 0000000..4070ccf --- /dev/null +++ b/docx-wasm/js/json/index.ts @@ -0,0 +1,49 @@ +import { Styles } from "./styles"; + +export type DocxJSON = { + contentType: { + types: { + [k: string]: string; + }; + }; + rels: [string, string, string][]; + documentRels: { + hasComments: boolean; + hasNumberings: boolean; + }; + docProps: { + app: {}; + core: { + config: { + creator: string | null; + description: string | null; + language: string | null; + lastModifiedBy: string | null; + modified: string | null; + revision: string | null; + subject: string | null; + title: string | null; + }; + }; + }; + styles: Styles; + document: { + children: any[]; + }; + comments: { + comments: any[]; + }; + numberings: {}; + settings: { + defaultTabStop: number; + zoom: number; + }; + fontTable: {}; +}; + +export * from "./styles"; +export * from "./border"; +export * from "./document"; +export * from "./paragraph"; +export * from "./run"; +export * from "./table"; diff --git a/docx-wasm/js/json/paragraph.ts b/docx-wasm/js/json/paragraph.ts new file mode 100644 index 0000000..10003cb --- /dev/null +++ b/docx-wasm/js/json/paragraph.ts @@ -0,0 +1,61 @@ +import { RunJSON, RunChildJSON } from "./run"; + +export type ParagraphChildJSON = + | RunJSON + | InsertJSON + | DeleteJSON + | BookmarkStartJSON + | BookmarkEndJSON; + +export type NumberingPropertyJSON = { + id: number; + level: number; +}; + +export type ParagraphPropertyJSON = { + runProperty: RunChildJSON; + style: string | null; + numberingProperty: NumberingPropertyJSON | null; + alignment: "left" | "center" | "right" | "justified" | "both"; +}; + +export type ParagraphJSON = { + type: "paragraph"; + data: { + property: ParagraphPropertyJSON; + children: ParagraphChildJSON[]; + }; +}; + +export type InsertJSON = { + type: "insert"; + data: { + run: RunJSON; + author: string; + data: string; + }; +}; + +export type DeleteJSON = { + type: "delete"; + data: { + run: RunJSON; + author: string; + data: string; + }; +}; + +export type BookmarkStartJSON = { + type: "bookmarkStart"; + data: { + id: number; + name: string; + }; +}; + +export type BookmarkEndJSON = { + type: "bookmarkEnd"; + data: { + id: number; + }; +}; diff --git a/docx-wasm/js/json/run.ts b/docx-wasm/js/json/run.ts new file mode 100644 index 0000000..97159ab --- /dev/null +++ b/docx-wasm/js/json/run.ts @@ -0,0 +1,49 @@ +export type RunPropertyJSON = { + sz: number | null; + szCs: number | null; + color: string | null; + highlight: string | null; + underline: string | null; + bold: boolean | null; + boldCs: boolean | null; + italic: boolean | null; + italicCs: boolean | null; + vanish: boolean | null; +}; + +export type RunChildJSON = TextJSON | DeleteTextJSON | TabJSON | BreakJSON; + +export type TextJSON = { + type: "text"; + data: { + preserveSpace: boolean; + text: string; + }; +}; + +export type DeleteTextJSON = { + type: "deleteText"; + data: { + preserveSpace: boolean; + text: string; + }; +}; + +export type TabJSON = { + type: "tab"; +}; + +export type BreakJSON = { + type: "break"; + data: { + breakType: "page" | "column" | "textWrapping"; + }; +}; + +export type RunJSON = { + type: "run"; + data: { + runProperty: RunPropertyJSON; + children: RunChildJSON[]; + }; +}; diff --git a/docx-wasm/js/json/styles.ts b/docx-wasm/js/json/styles.ts new file mode 100644 index 0000000..28af03e --- /dev/null +++ b/docx-wasm/js/json/styles.ts @@ -0,0 +1,17 @@ +import { RunPropertyJSON } from "./run"; +import { ParagraphPropertyJSON } from "./paragraph"; + +export type StyleJSON = { + styleId: string; + name: string; + styleType: string; + runProperty: RunPropertyJSON; + paragraphProperty: ParagraphPropertyJSON; +}; + +export type Styles = { + docDefaults: { + runPropertyDefault: RunPropertyJSON; + }; + styles: StyleJSON[]; +}; diff --git a/docx-wasm/js/json/table.ts b/docx-wasm/js/json/table.ts new file mode 100644 index 0000000..7673422 --- /dev/null +++ b/docx-wasm/js/json/table.ts @@ -0,0 +1,62 @@ +import { ParagraphJSON } from "./paragraph"; +import { BorderJSON } from "./border"; + +export type TableCellChildJSON = ParagraphJSON; + +export type WidthType = "DXA" | "Auto" | "Pct"; + +export type TableCellPropertyJSON = { + width: { + width: number; + widthType: WidthType; + } | null; + borders: any | null; + gridSpan: number | null; + verticalMerge: "restart" | "continue" | null; + hasNumbering: boolean; +}; + +export type TableCellJSON = { + children: TableCellChildJSON[]; + property: TableCellPropertyJSON; +}; + +export type TableRowJSON = { + cells: TableCellJSON[]; +}; + +export type TablePropertyJSON = { + width: { + width: number; + widthType: WidthType; + } | null; + justification: "left" | "center" | "right"; + borders: { + top: BorderJSON; + left: BorderJSON; + bottom: BorderJSON; + right: BorderJSON; + insideH: BorderJSON; + insideV: BorderJSON; + } | null; + margins: { + top: number; + left: number; + bottom: number; + right: number; + } | null; + indent: { + width: number; + widthType: WidthType; + }; +}; + +export type TableJSON = { + type: "table"; + data: { + rows: TableRowJSON[]; + grid: number[]; + hasNumbering: boolean; + property: TablePropertyJSON; + }; +}; diff --git a/docx-wasm/package.json b/docx-wasm/package.json index b4887cd..19a87fe 100644 --- a/docx-wasm/package.json +++ b/docx-wasm/package.json @@ -1,12 +1,13 @@ { "name": "docx-wasm", - "version": "0.0.23", + "version": "0.0.24", "main": "dist/index.js", "author": "bokuweb ", "license": "MIT", "scripts": { - "build": "tsc -p .", - "serve": "webpack-dev-server --open --config webpack.dev.js" + "build": "tsc -p . && wasm-pack build", + "serve": "webpack-dev-server --open --config webpack.dev.js", + "prepublishOnly": "npm run build" }, "resolutions": { "**/serialize-javascript": "2.1.2" diff --git a/fixtures/bom/bom.docx b/fixtures/bom/bom.docx new file mode 100644 index 0000000000000000000000000000000000000000..9e5c8ba2bdb708fef7a5b9590529512c96eb3089 GIT binary patch literal 11377 zcmeHtWmH{Dw(iDVf_rdx3-0c&!QD5mL4&)qad!(Eg1fr~cMT*2CqW)Lr_;$f-S@ut zes`}ic8y)~&04G0lvQ6%C0Pha3;;9$7EqZWr*sdguO<%$0N_Ib0O$Z%a9vRcdlxf% z7XvjaXutCbuIuL@Zak{dIcJj2_k9Z>CLckaR`mmRkc+&IK$slb9NH zF?@p6-A1W)rfso_SrR^|olzLSM<*?#&;mKV>{2c|pOz_He2*$zuGs=$Ik|Codyd>~ z6w(OuGL|SefiCF8Q8q`{7BZ2m)ghRpVv`lJAX%(DvXQP+xsIQtWI`e_g{P1RjtiaY zh5V6ZPu^FM0_ic@M>PqbgcMWb9TOUv8jTd4&^ylpbmcedR!}fOZA}Q%bW-6HAJgx( z-l??eTO_>Yg*f`gqO)Oe1{TlrNY=gH!rKeI&-8?~6Y1%m5YffP{R;R%Ao=MthExXZ zsWZ?qZeX82v2gZKG=DzE59hwN)zw{s3?{6U*SDQ4p^YgU_1Grw?K#G4cFnb0bfte< zVfwQbCR9d6Z$B%S=(CX_JX@iGlbNkE6XTEazt;C3ZFK*9_^bq31qc?zkQy}4jjt|o zs3P*MN5#Bvy};u&S*4|@>O@<~fY`NuNUc;@jg(OP3;*)rJZp**-I*W`_3=#;GP z>@3J{{KD_(AashC1t}j=M0q5`Kaz8MkxYp=k`uv5!-*3>(3< zckrJyf0+blOrRWV0ydr>GyvdA2>@U|uY$XSlPQynrJ0@CpC!wW&~&OZ89OV1(V=<# z#C*=*=XOsf44K3Q*HG*KkpXj1+X4-R_gai?XDu341!_;?<{jguJpZTA}JxFeb-t#=RZ($8S!qS`faIfVGA>$`w?bXHIkYljg)Y zvY%SNOJiTg+XR;|k+OXIVVS`3wC4^*kPBuq0uT%<<(=G;gHL;DvD*eM}cF{00Br)cshDA#B6SCT5CF=wt|6aHdF<<_qhz>2?_R||`kWu$H5=St?F3ny#&)05J0XOI1yxw0 ztmYb_y&bWd=JYl@(*QVPtwt6TNH7OzLWGhk`D-4;by-WjEE{!99PVv{c4q0Q;%dgN z)!MWk+ap$E#!pHRFmug&pNW?kZbBe$Q)S|aNs;~Y|z^bK;%Padp z0Sb;pf#=*;&K>8E14zdf_z)xy(+S2oU ziq(56y_Q*T+|bFsj+87>dEg~E%oI|Yb1X%bdM%6%Lz0?}h&e{ifDUP57N%7dH85B* z4lw2gjKq`CuI^hy9m-OOl9&gTr#Of`*Dk5?cba86VVGm83wBXGYSO=`*JE7jb10Ts zS33r_<5rCgZ*NmxpIx&%kK!$?zf)i)$uL%!!puh3X6$7r8vZPIkxy3idR=uA{EqEF zqn?1VTNQd%qpS25Bhrw~pUn!Cw`T!zn$I_5OH*dV)E~X7;;do@DvS1QK@&0!;7UA# zrH{b(Pb+C_s39i1hHD|ZtYYrWY!WPk+-pG|@0V?O8!ueF^iN}sJ#F|W*VK0&BM(A+ z^Q+w#oZIc%h!(Ns?;xcJ;#`^Jh#XcHxiv|uzi(sgnF)u1uK@*ucmwhs?ZpI<} z)L@>w?Rm9S;HCdY4hk4`ERkJJaH6)Kj7I6Kx3P9zHqotCF)H@TC}yN6P0Ub{R%SE> z{T8?|PkD~4^@wQUq>_!n75D61_7OCOww-VdREIQWJ!P0pULz8tVBNZCf#s;tfwKq! zsV4^$-hduusc4-)GV47MUc4{pM6hXlPd^G^2N4@2SqK+12|nb@lET-g1S!0&de6n4 zqP&7Q;BA=EcLJS6XV)rG2QiQqx#xyslEQ5p(qI1JawRS6|GtNy3TQPlENxaEw_6J*sH!nA&tOi3Cu1cV=s) zXJJ&vF)}-J%+e|hs=&2EE@Mn$c&ZdOtXy>3m3#3nSE6GMF7Y7-onZTJb*0 z!|1lBSaA2c^|J8Q7;$@TOSH}c8D>wk?Q8fOyxe24XwhJP&X@b+`=gxBM}fyPEuce?3>%HP z???Pwq6jr}xk__iv-8cNn+C9WuvBo1N94w*tz8e^c}qkVt5^(Jeuf!PCuecy^>-dU z6R;0dvKWy2Dwu|cs#V{hN<+&LRkV`~wR*VNS|5STX}48)(h|vOO|*f5MKabPd^*-- z&j}UVr_8rrk!upWBE{+fJ#$#!;koaKgZ1lGc`InR2y}2BIM)Qyn|^!Rc4<&p^Ij*86kue zYNgg*<_H(Bb~F{?o-#@rf>^$DJ8e9uqh3P$GzQC4yAph2Rc@d>=4>;8q6(H6lX6iK zfB9W^t~i=gJkOTMBc=Rn8Vb62JrdN@!Q0m|J7nqmhO{03Zxjoc|P zy%Tx>ol3Pu7;n_*TMLO+x#O|HI}2FpA6UNEnkg;{O(*g?!qKo~C%&L)F{#%pDW$fj zi%&1FenX{oW3o0+9`0Nwz_c6}5G2JyX-6>W7E<0JlRo>Bp6%0uqBj}BTcqsiQyXNj zH`asVK^ph^U^@#me4Cv<^j4L9HYpjr>~qja&`YT@8BpjR!M2T@i`(nwE$T&%zAgS) zm1B7aj%<Y(y9Yq_5*1M6{~fkpHlH*H;4 z*JgrFBuz_I%?GQ|C%g9>^S&&NWcL~^iQ@&D>|+N?zoeQE-EC#L)~s z(EaM$Q^b}p^Z*CW$I79II$fOKp!UaM3<7mrKM=-#699!wjO*uQS(XaSn9}NcROH&$ z?RxZl{W#1j9Ie6id_Qfe=zn31_H| z8}9oBZ0;}YrB{61hf7sTk^hjW&UMjZcQZAD`)%Z~Ov#VD!YC5S#`dG(6-*(g@wPn* zq1~Y+j1QS4zH7s~f@ofyT}x%j46fzAnT0v)2)3_6$pB1 z*y96JRD*RS4Rm7O88iYjPCZe$UjE7Sbeq$k%eUSxteRWH%I_8oLbmss`_A!3$Xrz4 zWcwmd$am{JTU}vLC~^$F!?hg41Ik5`wNLPQmlsiPkw;AIPwRi&QV#NqjyWIx zK5a-KCn1d!RUnK(z5^L3j3q5$aYLgWkM zMLEAw@x`6#Akh!(uRbY=+{}Xic~c350RYf``Xuvbibu`J*w*ZaQ(8-!v|nZ>7&M?5 zY42l6@}sTtXPiYoHQIrSatv$y7-JinMA!bMt@j#s7CED#m-f^s&T9|zT2{)E&M?Wo zq(5TU$M1Uan##cQ>SA%JKRPT6cQ%A>$@u}#iIB1^9msv!Qii0sTx~)hkB&w+?DaVl z_h$Q^{!@sI&Q6!D)rY|A)uH9WPo5zXa;U1RaEVHY$yj|oCD~qqhc{MEBFR!=dnQEA zyf@4u^34s?la9(pLo}^w?3i-P#vLWvh%qwhVN}IVquDztH2l&H`C~X-@4^;+1A#5? zzT)dj1gcg=!P_Art9~x64LlN{^&<6U=Hj0KI3Plvc7SAxhPj|GYtdoGRwFtRT`68D z;edy!O-71{6ta$mE=Tq8V;jv0$$Kb9hA0zqydE5toC&k+JuxSzy^4b+nxxaF6E@YB zeqW@lp7vt=;!QF~Z;6uhIL@BN*{0j59-VJlu1~l~x30`XnaE2YB`WGy*Yik5yc-F(XrWimTk){_gbE#M8U=wa;2cjc|O828ijt^PmDn zkbOO|T-cF+OP-feopNV@z>|NE8TiB!MM7QWR?vZ&KhceP*DZ`=HkkPY{Y%*Z01|+% z-9sYWGne@F`G@gS+1$;HRey_tNz>gj5G<(Bo2{F?^exRxSeV)$7{b)r!g2+K(kGg_ zk6!oy?PzHj8T1Mv ztCj-OmM-sYXI}BsXXj!(&?M7J<6Ty1rzYUr^w)r8A<~G>494K-O($q#5q8?2ccGhW z_K@}|HMzZB)HI(wqk(tTI|Iu42E~n3Z?KAC(hT#M-c5f~ZOHZjf%w7>1#mj~T}TMi zru$#K?Ph~>H7gxGp;}g67ASY8it6mzd-DGZCbY3ygZ55WELw=F41-N|+}{ZfN5D|Q zr*{sa_ThsYi^|h2uq5~aeeMz+0C;+W0Q_3IAKwoC$Fi9m&&!toY^$gMSTIuu6D21H zpfi&Z5cm%c7VMdWeID_jeN`ol+Jlo|gct@KSC$-NO*7a(e$YRkuFxFI9^L0f=KB4R&gioLWcqzJOLnvgL@jf zKD}(QsgaI;&(TxpUEI6Y>xbqmBQ~5O%pw<``!N>AIrykWJ}_^3wz*`N;mg%BrPA-D zeqZUDsfVZTEY>A^jo&f-Rn`1*xw~YZ70L8j)m{K-f2o>@gVP@ofjFP?zq5UnYYelhJ=6DHWMk{pEE^GykdJ|blE8r6A<=~M7ZSZEZd8NuU9(Ysc8kk<4hxxOcElT5j_ zId)r93r#>t6@OKYS0C3_7bBQRlc2(tAoX4ZghI1Ak)jk-eA+`A=H8(<<%^P(9e}bR z-I`8{M$aZ!q~RaEL$3ayseSZBJ{U-)%$gO&lyEC~PBYYewlc@r8Cr#mwKiqv!bB*f zBNKX2uy+omktbZbzUc)TnAMK2~7gpaQ zgP8eJq()y_(*NPW@9AciX(N&AcEFV~sV#GC{X`L*Q4|yI&V!rgd~bb;e8`EC42y1< ziE5HB7G^{HQ(2FWC=b6sGHakP2s>TA>4lhcDIBJ{_(0YNr^O1va{OR5T}l@1=J*ZNZ8UPfxLUv#pcgl%bzF~0rY@~H?lcxekhcaYNeZ-(yhXWwQRaw z5IM2;iYSAg(@@#eKS^x-LPWM_pz1EchEY^uxd*Q7T^wJWcwMe#0gZQIkRz_LrcqGg z5eX+l2IgJ)Wo)kH8XQ7nJ`OaFp2b&TQ^+fImB3G=G2ECZ=*p_~%z+p^POz-7qa;$q z^r6IlmNb$Y@*FYcP1XeJMe|(cA1d%@wb%amqVZ^NoE(4Y z@BEb-1j0u}6d9*I;h#NGu6Myqik#h~9n3k@5ufaa7*=W)j+cM3lWk$aW;7L6D&ys1 z&9U=WQ&<6%wKajEy+17g$)=*e*UcZZ(5F9FfFP?2<&KQBo{=@=OF?gFsKQ)F$ePB@ z&ybx?5=>TI*DY_^Y|4ZbU+IA*xUNggXD}Quq_(K+p~{cByXM|o-UTY|D1T8WsNjf& zjlXzZQ9j=I;0I)0efpB%($5+X25pQswMu~^Q0H>bu{J0tMS8VBS-hQdQ%5 z8fIh-ANk=ofiiz{^`mCeW}7rO9=SM<(=%9eR9?QorJ(saL|ik`;`i%>MBP`P&xWdR zD9yDgMLrIO8eQ%RLq8?elBbiYzh=>$3FT}PBNLsWF*iDsN za-xqjmYxKE$`cnW2`h>pHnK9+(ZU0vrbtwPcdH6B;B^=LC@zFCqph8$^5Yv{Er)~6 zR~2AISGH^8X?xeR*Ik=inVz1W*>$DLvMEy%xa-K(H7y#W#R#w-NSCwEPO6Q$v-p`} zR8(Sq)~_(Ts}4$-citmsTQ`nRoEV}b0?irR237+pq8dywM$74AlJj-aS7JmsFZ=6V z1S9HeBBGf3-i(QKs5tgDeya0gJMkP50mC-56Ar1$@AV8M?CYiyd6$E5?~FOhh6;`!Rl*%eO(U&!e}7UW zmpFXpDH(gfh^jr}$ZPvCU}_6)yW965KXmPzgc}t5Mu+T007TF9+2iGn$lhkiE!Z}H z120=k0xk-VaA;VoG4Df6D{H8`ko~|}_Ru)aIz9;dzUo9LlaL#Y=VtrS@va*K zV4={p0jmE=CvjKBQy@;wqsz0i&XV5JLtR>#oiv4my(=V%g$e-61Chs^xy+Z2q`X7{tTEik;10g~7b0Zjk7 zooPh`alI)npqasR(+&aGV?_k|N41_I?53Wf?^n|%lttzLWv<|Vy+bI2m;V31lSw$p zR(%QkpbwYkS((pcz$COvS`m3A`JLk`OI#bWf+iI|#KV1Cr>rFR0&}ES6jGetIPawA zhHX=c&-d$!{P#WbP6q~DFP5uO{A(fxEmVFy0(dO57%zN3UJUXO$#%OALU_s&$##Ax zUJS%I$#%kb999>vqi~CbTpXHbBeJ=-y<5*T_$m+AV_GrcKD9Kr+KcyCe?BeLjUN(UN}!PF0b(lUI`wjJ-U5 zu14U6Ty+b(^5KPLKS__GV;627m+2iHvUYYvZwFcxmsl?5%W0F=7rqe?6R`axqXv#c z&zKm;=h5JQ_VQ}+a+6_%()&I4sycE(h|wYckoBYYmIj&YS67_g4rVB9!!~Mw1_9|k z22AFQ2+@?z?YQ}h_jLuxtp413 zMH?emvl>A*Tfx{L|D%)4%XadA>mRx-m;L%KsPS2J#ZMtEn3BbsdcO(zUuXCs!O_%f zPwnUQUYPDhnzL6E4*JQ!@85y@hxgojd(EI`{o8k~pYyM4l*Q+ z7B)CqJzdN0ikGtUTRXBBu2@iQf_&@|7ZDbJ3-(&L8r z^c8rYR4fHHS$DL3c-XxlRXir^<6L*+O9 z*%`TZUv?zq+!5H@d1`pZakBk3$E*Kk~O; zdbY00KkwvvpO4DX00e)2DnGLau6EB!T&#am2RH!g+#h_*zg|V^diE>Kh#e7mH)@W) zJd35emGT*TMncm>hDxT-{v|xHuy4G&DU{Gk6K9XhaRE$xxlJpd+V@^6eJ;nKv&O+d zozU*BE1HYMb|gvo+x<9MJ#*93NMRAu1JHyvl8&h<9YITbi~S72tq$BN8RQhB9pa?a zUb{4nYa3cb3j#$86ijgEW-c{G@NOWdp)(KOK(CtxJ#dS_tJT7*m*8k~?#a^dt%Mnv z21{%{Lz%H#BPWE|tFh6d%AyU@>oX@52%MmKD;O3oRCvmx7^UVDh7%fJcglK3h$=~I z@n`~}R+)5xsLA}iy5%6-bp+!AYbR=9KJFT5wo$y-UR|n(2fSqJU(z~baZnUXrTn?H zGDWrwa=a-cq}O;K)vRL@@D&B2nY|DUM=m1Rnrk`v)A>;B@-$&8rxss!9Y^>Or1Qp( z$@U|<Jli&+DZ?c%0o(7v4_?y&W zE;#R6G#F_KL@fuRz#+x#`vI?zoZIpk~D0i<`-z%zMcEg?Hi_#IXXL2g>nY z!nXKOjw`EyarK^uD2RHA^ybNDR$a1#?Bf{oneYm&xA-hbos+Z$tK-t|)*Y*EdZ7-e zhUiC!N$WdnAHkJm!N3`wdD9=6nLl#E{+gNjcia6pd76J0@YkfW-vxv`zmwlm%zg*{ zyVRRsP|&lN`L~HUzl->HXQ97D$RhpR&;P~>{|^80?0-MD_yym1K3VE9*%DR&=yUAf&_5Zszr+8|fBX`V zjQ4Z({>g^?1phR=zea>#PynEd;ve9@7~tRWe>L3S@!Hh?!2eHXtRxHdtRO#97!d%y M&p|1T=11-S0B>@Kf&c&j literal 0 HcmV?d00001 diff --git a/fixtures/indent_word_online/[Content_Types].xml b/fixtures/indent_word_online/[Content_Types].xml index 4d5931e..fb48557 100644 --- a/fixtures/indent_word_online/[Content_Types].xml +++ b/fixtures/indent_word_online/[Content_Types].xml @@ -1 +1,13 @@ - \ No newline at end of file + + + + + + + + + + + + + \ No newline at end of file diff --git a/fixtures/table_libre_office/word/document.xml b/fixtures/table_libre_office/word/document.xml index e9aec01..d6a7a65 100644 --- a/fixtures/table_libre_office/word/document.xml +++ b/fixtures/table_libre_office/word/document.xml @@ -24,14 +24,14 @@ - + - + @@ -59,7 +59,7 @@ - + @@ -88,6 +88,7 @@ + @@ -107,8 +108,9 @@ - + + @@ -139,5 +141,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/fixtures/table_libre_office/word/fontTable.xml b/fixtures/table_libre_office/word/fontTable.xml index 94f56db..3916a0e 100644 --- a/fixtures/table_libre_office/word/fontTable.xml +++ b/fixtures/table_libre_office/word/fontTable.xml @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/fixtures/table_libre_office/word/settings.xml b/fixtures/table_libre_office/word/settings.xml index 97dba84..c338dcc 100644 --- a/fixtures/table_libre_office/word/settings.xml +++ b/fixtures/table_libre_office/word/settings.xml @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/fixtures/table_libre_office/word/styles.xml b/fixtures/table_libre_office/word/styles.xml index 0baa766..c014ee5 100644 --- a/fixtures/table_libre_office/word/styles.xml +++ b/fixtures/table_libre_office/word/styles.xml @@ -1,107 +1,2 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/fixtures/table_merged_libre_office/word/styles.xml b/fixtures/table_merged_libre_office/word/styles.xml index 546e921..f4a3277 100644 --- a/fixtures/table_merged_libre_office/word/styles.xml +++ b/fixtures/table_merged_libre_office/word/styles.xml @@ -1,116 +1,2 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/fixtures/table_word_online/word/styles.xml b/fixtures/table_word_online/word/styles.xml index ab59613..0a5c66e 100644 --- a/fixtures/table_word_online/word/styles.xml +++ b/fixtures/table_word_online/word/styles.xml @@ -1 +1,459 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file