summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRi Xu <xuri.me@gmail.com>2016-12-22 10:10:40 +0800
committerRi Xu <xuri.me@gmail.com>2016-12-22 10:10:40 +0800
commita08c8eb1aecea4a7d82fc70eb2aa4f886a6ed632 (patch)
tree8666354894f05dd28329dc52a7d8ccee1dcd0db4
parentddeed48fc19e814e1ec2c04580108f7b865cf181 (diff)
- Fix issue comments missing after save;
- Update import PKG syntax in struct; - Update test XLSX file (include table, charts, functions, comments and hyperlink on Sheet1)
-rw-r--r--sheet.go1
-rw-r--r--test/Workbook1.xlsxbin21643 -> 22867 bytes
-rw-r--r--xmlContentTypes.go4
-rw-r--r--xmlSharedStrings.go4
-rw-r--r--xmlWorkbook.go4
-rw-r--r--xmlWorksheet.go14
6 files changed, 18 insertions, 9 deletions
diff --git a/sheet.go b/sheet.go
index 088a651..35fd5ed 100644
--- a/sheet.go
+++ b/sheet.go
@@ -127,6 +127,7 @@ func replaceRelationshipsID(workbookMarshal string) string {
rids = strings.Replace(rids, `<hyperlinks></hyperlinks>`, ``, -1)
rids = strings.Replace(rids, `<tableParts count="0"></tableParts>`, ``, -1)
rids = strings.Replace(rids, `<picture></picture>`, ``, -1)
+ rids = strings.Replace(rids, `<legacyDrawing></legacyDrawing>`, ``, -1)
return strings.Replace(rids, `<drawing rid="`, `<drawing r:id="`, -1)
}
diff --git a/test/Workbook1.xlsx b/test/Workbook1.xlsx
index ecc7a4f..f6f713c 100644
--- a/test/Workbook1.xlsx
+++ b/test/Workbook1.xlsx
Binary files differ
diff --git a/xmlContentTypes.go b/xmlContentTypes.go
index b56c125..65e85bc 100644
--- a/xmlContentTypes.go
+++ b/xmlContentTypes.go
@@ -2,9 +2,7 @@
package excelize
-import (
- "encoding/xml"
-)
+import "encoding/xml"
type xlsxTypes struct {
XMLName xml.Name `xml:"http://schemas.openxmlformats.org/package/2006/content-types Types"`
diff --git a/xmlSharedStrings.go b/xmlSharedStrings.go
index 467f19c..059ed60 100644
--- a/xmlSharedStrings.go
+++ b/xmlSharedStrings.go
@@ -2,9 +2,7 @@
package excelize
-import (
- "encoding/xml"
-)
+import "encoding/xml"
// xlsxSST directly maps the sst element from the namespace
// http://schemas.openxmlformats.org/spreadsheetml/2006/main currently
diff --git a/xmlWorkbook.go b/xmlWorkbook.go
index a82052f..1f355c7 100644
--- a/xmlWorkbook.go
+++ b/xmlWorkbook.go
@@ -2,9 +2,7 @@
package excelize
-import (
- "encoding/xml"
-)
+import "encoding/xml"
const (
// sheet state values as defined by
diff --git a/xmlWorksheet.go b/xmlWorksheet.go
index 02794e4..2847c39 100644
--- a/xmlWorksheet.go
+++ b/xmlWorksheet.go
@@ -23,6 +23,7 @@ type xlsxWorksheet struct {
PageSetUp xlsxPageSetUp `xml:"pageSetup"`
HeaderFooter xlsxHeaderFooter `xml:"headerFooter"`
Drawing xlsxDrawing `xml:"drawing"`
+ LegacyDrawing xlsxLegacyDrawing `xml:"legacyDrawing"`
Picture xlsxPicture `xml:"picture"`
TableParts xlsxTableParts `xml:"tableParts"`
}
@@ -350,3 +351,16 @@ type xlsxTablePart struct {
type xlsxPicture struct {
RID string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"` // Relationship Id pointing to the image part.
}
+
+// xlsxLegacyDrawing directly maps the legacyDrawing element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main -
+// A comment is a rich text note that is attached to, and associated with,
+// a cell, separate from other cell content. Comment content is stored
+// separate from the cell, and is displayed in a drawing object (like a
+// text box) that is separate from, but associated with, a cell. Comments
+// are used as reminders, such as noting how a complex formula works, or
+// to provide feedback to other users. Comments can also be used to explain
+// assumptions made in a formula or to call out something special about the cell.
+type xlsxLegacyDrawing struct {
+ RID string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
+}