aboutsummaryrefslogtreecommitdiff
path: root/src/odf
diff options
context:
space:
mode:
Diffstat (limited to 'src/odf')
-rwxr-xr-xsrc/odf/odf.ml2
-rwxr-xr-xsrc/odf/odfLoader.ml10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/odf/odf.ml b/src/odf/odf.ml
index 176e70a..1db9d4b 100755
--- a/src/odf/odf.ml
+++ b/src/odf/odf.ml
@@ -210,7 +210,7 @@ let save sheet file = begin
Xmlm.output output (`El_start (NS.table_node, []));
Xmlm.output output (`El_start (NS.table_row_node, []));
- ignore (Sheet.Raw.fold (f output) (1,1) sheet);
+ ignore (Sheet.fold (f output) (1,1) sheet);
Xmlm.output output `El_end;
Xmlm.output output `El_end;
diff --git a/src/odf/odfLoader.ml b/src/odf/odfLoader.ml
index 93a6c62..280e6bd 100755
--- a/src/odf/odfLoader.ml
+++ b/src/odf/odfLoader.ml
@@ -83,7 +83,7 @@ let build_p (attributes:Xmlm.attribute list) = begin function
end
-let build_row (sheet:Sheet.Raw.t ref) (row_num:int ref) catalog (attributes:Xmlm.attribute list) (childs:tree list) = begin
+let build_row (sheet:Sheet.t) (row_num:int ref) (attributes:Xmlm.attribute list) (childs:tree list) = begin
let repetition =
try int_of_string @@ List.assoc (NS.table, "number-rows-repeated") attributes
@@ -94,7 +94,7 @@ let build_row (sheet:Sheet.Raw.t ref) (row_num:int ref) catalog (attributes:Xmlm
List.iter (function
| Cell cell ->
for i = 1 to cell.repetition do
- sheet := snd @@ Sheet.Raw.add (!cell_num, !row_num) cell.expression catalog !sheet;
+ ignore @@ Sheet.add ~history:false cell.expression (!cell_num, !row_num) sheet;
cell_num := !cell_num + cell.cell_width
done;
| _ -> ()
@@ -109,13 +109,13 @@ let data str = Data str
let load catalog source = begin
(* Mutable datas *)
- let sheet = ref Sheet.Raw.empty in
+ let sheet = Sheet.create catalog in
let cache = Hashtbl.create 10 in
let table = Base.String_dict.of_alist_exn [
((NS.text ^ "p"), build_p);
((NS.table ^ "table-cell"), build_cell cache);
- ((NS.table ^ "table-row"), build_row sheet (ref 1) catalog)
+ ((NS.table ^ "table-row"), build_row sheet (ref 1))
] in
let el (((ns, name), attributes):Xmlm.tag) childs = begin
@@ -125,6 +125,6 @@ let load catalog source = begin
end in
match Xmlm.input_doc_tree ~el ~data source with
- | _, Unit -> !sheet
+ | _, Unit -> sheet
| _ -> raise Not_found
end