2018-09-14 00:35:47 +08:00
|
|
|
/*
|
|
|
|
Package excelize providing a set of functions that allow you to write to
|
|
|
|
and read from XLSX files. Support reads and writes XLSX file generated by
|
|
|
|
Microsoft Excel™ 2007 and later. Support save file without losing original
|
|
|
|
charts of XLSX. This library needs Go version 1.8 or later.
|
|
|
|
|
|
|
|
Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
|
|
|
|
this source code is governed by a BSD-style license that can be found in
|
|
|
|
the LICENSE file.
|
|
|
|
*/
|
2016-08-30 21:54:28 +08:00
|
|
|
package excelize
|
|
|
|
|
2016-12-22 10:10:40 +08:00
|
|
|
import "encoding/xml"
|
2016-08-30 21:54:28 +08:00
|
|
|
|
|
|
|
// xlsxSST directly maps the sst element from the namespace
|
2017-02-07 14:03:03 +08:00
|
|
|
// http://schemas.openxmlformats.org/spreadsheetml/2006/main. String values may
|
|
|
|
// be stored directly inside spreadsheet cell elements; however, storing the
|
|
|
|
// same value inside multiple cell elements can result in very large worksheet
|
|
|
|
// Parts, possibly resulting in performance degradation. The Shared String Table
|
|
|
|
// is an indexed list of string values, shared across the workbook, which allows
|
|
|
|
// implementations to store values only once.
|
2016-08-30 21:54:28 +08:00
|
|
|
type xlsxSST struct {
|
|
|
|
XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main sst"`
|
|
|
|
Count int `xml:"count,attr"`
|
|
|
|
UniqueCount int `xml:"uniqueCount,attr"`
|
|
|
|
SI []xlsxSI `xml:"si"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// xlsxSI directly maps the si element from the namespace
|
2017-01-18 16:05:01 +08:00
|
|
|
// http://schemas.openxmlformats.org/spreadsheetml/2006/main - currently I have
|
|
|
|
// not checked this for completeness - it does as much as I need.
|
2016-08-30 21:54:28 +08:00
|
|
|
type xlsxSI struct {
|
|
|
|
T string `xml:"t"`
|
|
|
|
R []xlsxR `xml:"r"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// xlsxR directly maps the r element from the namespace
|
2017-01-18 16:05:01 +08:00
|
|
|
// http://schemas.openxmlformats.org/spreadsheetml/2006/main - currently I have
|
|
|
|
// not checked this for completeness - it does as much as I need.
|
2016-08-30 21:54:28 +08:00
|
|
|
type xlsxR struct {
|
2017-05-13 13:28:21 +08:00
|
|
|
RPr *xlsxRPr `xml:"rPr"`
|
|
|
|
T string `xml:"t"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// xlsxRPr (Run Properties) specifies a set of run properties which shall be
|
|
|
|
// applied to the contents of the parent run after all style formatting has been
|
|
|
|
// applied to the text. These properties are defined as direct formatting, since
|
|
|
|
// they are directly applied to the run and supersede any formatting from
|
|
|
|
// styles.
|
|
|
|
type xlsxRPr struct {
|
|
|
|
B string `xml:"b,omitempty"`
|
2017-09-01 12:59:15 +08:00
|
|
|
Sz *attrValFloat `xml:"sz"`
|
2017-05-13 13:28:21 +08:00
|
|
|
Color *xlsxColor `xml:"color"`
|
|
|
|
RFont *attrValString `xml:"rFont"`
|
|
|
|
Family *attrValInt `xml:"family"`
|
2016-08-30 21:54:28 +08:00
|
|
|
}
|