diff --git a/excelize.go b/excelize.go index ba6445f..c59ec8c 100644 --- a/excelize.go +++ b/excelize.go @@ -192,7 +192,7 @@ func (f *File) addRels(relPath, relType, target, targetMode string) int { // Office Excel 2007. func replaceWorkSheetsRelationshipsNameSpaceBytes(workbookMarshal []byte) []byte { var oldXmlns = []byte(``) - var newXmlns = []byte(``) + var newXmlns = []byte(``) workbookMarshal = bytes.Replace(workbookMarshal, oldXmlns, newXmlns, -1) return workbookMarshal } diff --git a/sheet.go b/sheet.go index c2e6bf6..566e6e7 100644 --- a/sheet.go +++ b/sheet.go @@ -207,7 +207,7 @@ func replaceRelationshipsBytes(content []byte) []byte { // a horrible hack to fix that after the XML marshalling is completed. func replaceRelationshipsNameSpaceBytes(workbookMarshal []byte) []byte { oldXmlns := []byte(``) - newXmlns := []byte(``) + newXmlns := []byte(``) return bytes.Replace(workbookMarshal, oldXmlns, newXmlns, -1) } diff --git a/xmlWorksheet.go b/xmlWorksheet.go index 8408cfa..cb854cd 100644 --- a/xmlWorksheet.go +++ b/xmlWorksheet.go @@ -22,8 +22,13 @@ type xlsxWorksheet struct { SheetFormatPr *xlsxSheetFormatPr `xml:"sheetFormatPr"` Cols *xlsxCols `xml:"cols,omitempty"` SheetData xlsxSheetData `xml:"sheetData"` + SheetCalcPr *xlsxInnerXML `xml:"sheetCalcPr"` SheetProtection *xlsxSheetProtection `xml:"sheetProtection"` + ProtectedRanges *xlsxInnerXML `xml:"protectedRanges"` + Scenarios *xlsxInnerXML `xml:"scenarios"` AutoFilter *xlsxAutoFilter `xml:"autoFilter"` + SortState *xlsxInnerXML `xml:"sortState"` + DataConsolidate *xlsxInnerXML `xml:"dataConsolidate"` CustomSheetViews *xlsxCustomSheetViews `xml:"customSheetViews"` MergeCells *xlsxMergeCells `xml:"mergeCells"` PhoneticPr *xlsxPhoneticPr `xml:"phoneticPr"` @@ -36,9 +41,18 @@ type xlsxWorksheet struct { HeaderFooter *xlsxHeaderFooter `xml:"headerFooter"` RowBreaks *xlsxBreaks `xml:"rowBreaks"` ColBreaks *xlsxBreaks `xml:"colBreaks"` + CustomProperties *xlsxInnerXML `xml:"customProperties"` + CellWatches *xlsxInnerXML `xml:"cellWatches"` + IgnoredErrors *xlsxInnerXML `xml:"ignoredErrors"` + SmartTags *xlsxInnerXML `xml:"smartTags"` Drawing *xlsxDrawing `xml:"drawing"` LegacyDrawing *xlsxLegacyDrawing `xml:"legacyDrawing"` + LegacyDrawingHF *xlsxInnerXML `xml:"legacyDrawingHF"` + DrawingHF *xlsxDrawingHF `xml:"drawingHF"` Picture *xlsxPicture `xml:"picture"` + OleObjects *xlsxInnerXML `xml:"oleObjects"` + Controls *xlsxInnerXML `xml:"controls"` + WebPublishItems *xlsxInnerXML `xml:"webPublishItems"` TableParts *xlsxTableParts `xml:"tableParts"` ExtLst *xlsxExtLst `xml:"extLst"` } @@ -631,6 +645,10 @@ type xlsxLegacyDrawing struct { RID string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"` } +type xlsxInnerXML struct { + Content string `xml:",innerxml"` +} + // xlsxWorksheetExt directly maps the ext element in the worksheet. type xlsxWorksheetExt struct { XMLName xml.Name `xml:"ext"`