From f79aa6392589db518f7292b89a4c8978f5c7c6a5 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 28 Aug 2013 17:24:32 -0400 Subject: fix up the merge and autofilter stuff (#1) --- lib/Spreadsheet/Template.pm | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'lib/Spreadsheet/Template.pm') diff --git a/lib/Spreadsheet/Template.pm b/lib/Spreadsheet/Template.pm index 2e4fe61..4b879c8 100644 --- a/lib/Spreadsheet/Template.pm +++ b/lib/Spreadsheet/Template.pm @@ -45,7 +45,9 @@ been preprocessed is a JSON file, with a structure that looks like this: "name" : "Sheet1", "row_heights" : [ 18, 18, 18 ], "selection" : [ 0, 0 ], - "autofilter" : [ 0, 0, 0, 3], + "autofilter" : [ + [ [0, 0], [0, 2] ] + ], "cells" : [ [ { @@ -106,15 +108,16 @@ been preprocessed is a JSON file, with a structure that looks like this: } ] ], - merge : [ - ["contents":"Merged Contents","format":{"color":#000000"}, - "type":"string", - "first_row": 0, - "first_col": 0, - "last_row" : 0, - "last_col" : 3 - ] - ] + "merge" : [ + { + "range" : [ [1, 0], [1, 2] ], + "contents" : "Merged Contents", + "format" : { + "color" : "#000000" + }, + "type" : "string" + } + ] } ] } @@ -163,11 +166,24 @@ spreadsheet. An array of two numbers corresponding to the (zero-based) row and column of the cell that should be selected when the worksheet is first displayed. +=item autofilter + +Enables autofilter behavior for each range of cells listed. Cell ranges are +specified by an array of two arrays of two numbers, corresponding to the row +and column of the top left and bottom right cell of the autofiltered range. + =item cells An array of arrays of cell objects. Each innermost array represents a row, containing all of the cell data for that row. +=item merge + +An array of merge objects. Merge objects are identical to cell objects, except +that they contain an additional C key, which has a value of an array of +two arrays of two numbers, corresponding to the row and column of the top left +and bottom right cell of the range to be merged. + =back =head2 cell -- cgit v1.2.3-54-g00ecf