From f91f548614a7182ce66d55d10ed311e9b7e08a2a Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 17 May 2019 22:58:12 +0800 Subject: Resolve #404, get sheet map by target rels. --- xmlWorkbook.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'xmlWorkbook.go') diff --git a/xmlWorkbook.go b/xmlWorkbook.go index ad66f42..90a1427 100644 --- a/xmlWorkbook.go +++ b/xmlWorkbook.go @@ -146,9 +146,8 @@ type xlsxSheets struct { Sheet []xlsxSheet `xml:"sheet"` } -// xlsxSheet directly maps the sheet element from the namespace -// http://schemas.openxmlformats.org/spreadsheetml/2006/main - currently I have -// not checked it for completeness - it does as much as I need. +// xlsxSheet defines a sheet in this workbook. Sheet data is stored in a +// separate part. type xlsxSheet struct { Name string `xml:"name,attr,omitempty"` SheetID int `xml:"sheetId,attr,omitempty"` -- cgit v1.2.1 From d038ca2e9c755abb6458606a90129559f14dc33b Mon Sep 17 00:00:00 2001 From: xuri Date: Sat, 1 Jun 2019 15:37:47 +0800 Subject: Fix #413, make pivot cache ID not omit empty --- xmlWorkbook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmlWorkbook.go') diff --git a/xmlWorkbook.go b/xmlWorkbook.go index 90a1427..5384977 100644 --- a/xmlWorkbook.go +++ b/xmlWorkbook.go @@ -175,7 +175,7 @@ type xlsxPivotCaches struct { // xlsxPivotCache directly maps the pivotCache element. type xlsxPivotCache struct { - CacheID int `xml:"cacheId,attr,omitempty"` + CacheID int `xml:"cacheId,attr"` RID string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"` } -- cgit v1.2.1 From a335be7e4e6824e65f3d8a34b7b45ffa8d78fe4b Mon Sep 17 00:00:00 2001 From: xuri Date: Tue, 18 Jun 2019 23:07:44 +0800 Subject: New functions: SetDefinedName and GetDefinedName added --- xmlWorkbook.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xmlWorkbook.go') diff --git a/xmlWorkbook.go b/xmlWorkbook.go index 5384977..0118685 100644 --- a/xmlWorkbook.go +++ b/xmlWorkbook.go @@ -288,3 +288,12 @@ type xlsxCustomWorkbookView struct { XWindow *int `xml:"xWindow,attr"` YWindow *int `xml:"yWindow,attr"` } + +// DefinedName directly maps the name for a cell or cell range on a +// worksheet. +type DefinedName struct { + Name string + Comment string + RefersTo string + Scope string +} -- cgit v1.2.1 From 9c70d0ac868f66badf2663cc7b4b3c46d5411131 Mon Sep 17 00:00:00 2001 From: xuri Date: Sun, 11 Aug 2019 00:36:14 +0800 Subject: Documentation updated, Go 1.10+ required --- xmlWorkbook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmlWorkbook.go') diff --git a/xmlWorkbook.go b/xmlWorkbook.go index 0118685..8150e29 100644 --- a/xmlWorkbook.go +++ b/xmlWorkbook.go @@ -5,7 +5,7 @@ // 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. +// charts of XLSX. This library needs Go version 1.10 or later. package excelize -- cgit v1.2.1 From 8922f659788187afa6d0a5d3248e999c2c1bb846 Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 16 Sep 2019 01:17:35 +0800 Subject: Combine functions: workBookRelsWriter, drawingRelsWriter into relsWriter; drawingRelsReader, workbookRelsReader, workSheetRelsReader into relsReader; addDrawingRelationships, addSheetRelationships into addRels --- xmlWorkbook.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'xmlWorkbook.go') diff --git a/xmlWorkbook.go b/xmlWorkbook.go index 8150e29..765563b 100644 --- a/xmlWorkbook.go +++ b/xmlWorkbook.go @@ -11,14 +11,14 @@ package excelize import "encoding/xml" -// xmlxWorkbookRels contains xmlxWorkbookRelations which maps sheet id and sheet XML. -type xlsxWorkbookRels struct { - XMLName xml.Name `xml:"http://schemas.openxmlformats.org/package/2006/relationships Relationships"` - Relationships []xlsxWorkbookRelation `xml:"Relationship"` +// xlsxRelationships describe references from parts to other internal resources in the package or to external resources. +type xlsxRelationships struct { + XMLName xml.Name `xml:"http://schemas.openxmlformats.org/package/2006/relationships Relationships"` + Relationships []xlsxRelationship `xml:"Relationship"` } -// xmlxWorkbookRelation maps sheet id and xl/worksheets/_rels/sheet%d.xml.rels -type xlsxWorkbookRelation struct { +// xlsxRelationship contains relations which maps id and XML. +type xlsxRelationship struct { ID string `xml:"Id,attr"` Target string `xml:",attr"` Type string `xml:",attr"` -- cgit v1.2.1 From a526e90404913f5d649d29a7aeee29f5ac9ff590 Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 16 Dec 2019 08:32:04 +0800 Subject: Fix #426, handle empty workbook view --- xmlWorkbook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmlWorkbook.go') diff --git a/xmlWorkbook.go b/xmlWorkbook.go index 765563b..e9ded6c 100644 --- a/xmlWorkbook.go +++ b/xmlWorkbook.go @@ -33,7 +33,7 @@ type xlsxWorkbook struct { FileVersion *xlsxFileVersion `xml:"fileVersion"` WorkbookPr *xlsxWorkbookPr `xml:"workbookPr"` WorkbookProtection *xlsxWorkbookProtection `xml:"workbookProtection"` - BookViews xlsxBookViews `xml:"bookViews"` + BookViews *xlsxBookViews `xml:"bookViews"` Sheets xlsxSheets `xml:"sheets"` ExternalReferences *xlsxExternalReferences `xml:"externalReferences"` DefinedNames *xlsxDefinedNames `xml:"definedNames"` -- cgit v1.2.1 From ae2865d9237cfd27d7bc4fbef3870b3361597be8 Mon Sep 17 00:00:00 2001 From: xuri Date: Sun, 22 Dec 2019 00:02:09 +0800 Subject: Improve code coverage unit tests --- xmlWorkbook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmlWorkbook.go') diff --git a/xmlWorkbook.go b/xmlWorkbook.go index e9ded6c..65606b0 100644 --- a/xmlWorkbook.go +++ b/xmlWorkbook.go @@ -203,7 +203,7 @@ type xlsxDefinedNames struct { // http://schemas.openxmlformats.org/spreadsheetml/2006/main This element // defines a defined name within this workbook. A defined name is descriptive // text that is used to represents a cell, range of cells, formula, or constant -// value. For a descriptions of the attributes see https://msdn.microsoft.com/en-us/library/office/documentformat.openxml.spreadsheet.definedname.aspx +// value. For a descriptions of the attributes see https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.spreadsheet.definedname type xlsxDefinedName struct { Comment string `xml:"comment,attr,omitempty"` CustomMenu string `xml:"customMenu,attr,omitempty"` -- cgit v1.2.1 From 09485b3f9f0aefc58d51462aed65c2416205c591 Mon Sep 17 00:00:00 2001 From: xuri Date: Sun, 29 Dec 2019 16:02:31 +0800 Subject: Improve code coverage unit tests --- xmlWorkbook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmlWorkbook.go') diff --git a/xmlWorkbook.go b/xmlWorkbook.go index 65606b0..bc59924 100644 --- a/xmlWorkbook.go +++ b/xmlWorkbook.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 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. // -- cgit v1.2.1