summaryrefslogtreecommitdiff
path: root/xmlDrawing.go
diff options
context:
space:
mode:
Diffstat (limited to 'xmlDrawing.go')
-rw-r--r--xmlDrawing.go101
1 files changed, 61 insertions, 40 deletions
diff --git a/xmlDrawing.go b/xmlDrawing.go
index 2bad16a..142121d 100644
--- a/xmlDrawing.go
+++ b/xmlDrawing.go
@@ -13,40 +13,52 @@ import "encoding/xml"
// Source relationship and namespace.
const (
- SourceRelationship = "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
- SourceRelationshipChart = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"
- SourceRelationshipComments = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"
- SourceRelationshipImage = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
- SourceRelationshipTable = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"
- SourceRelationshipDrawingML = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing"
- SourceRelationshipDrawingVML = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing"
- SourceRelationshipHyperLink = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"
- SourceRelationshipWorkSheet = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"
- SourceRelationshipPivotTable = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable"
- SourceRelationshipPivotCache = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition"
- SourceRelationshipVBAProject = "http://schemas.microsoft.com/office/2006/relationships/vbaProject"
- SourceRelationshipChart201506 = "http://schemas.microsoft.com/office/drawing/2015/06/chart"
- SourceRelationshipChart20070802 = "http://schemas.microsoft.com/office/drawing/2007/8/2/chart"
- SourceRelationshipChart2014 = "http://schemas.microsoft.com/office/drawing/2014/chart"
- SourceRelationshipCompatibility = "http://schemas.openxmlformats.org/markup-compatibility/2006"
- NameSpaceDrawingML = "http://schemas.openxmlformats.org/drawingml/2006/main"
- NameSpaceDrawingMLChart = "http://schemas.openxmlformats.org/drawingml/2006/chart"
- NameSpaceDrawingMLSpreadSheet = "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
- NameSpaceSpreadSheet = "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
- NameSpaceSpreadSheetX14 = "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"
- NameSpaceSpreadSheetX15 = "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"
- NameSpaceSpreadSheetExcel2006Main = "http://schemas.microsoft.com/office/excel/2006/main"
- NameSpaceMacExcel2008Main = "http://schemas.microsoft.com/office/mac/excel/2008/main"
- NameSpaceXML = "http://www.w3.org/XML/1998/namespace"
- NameSpaceXMLSchemaInstance = "http://www.w3.org/2001/XMLSchema-instance"
- StrictSourceRelationship = "http://purl.oclc.org/ooxml/officeDocument/relationships"
- StrictSourceRelationshipChart = "http://purl.oclc.org/ooxml/officeDocument/relationships/chart"
- StrictSourceRelationshipComments = "http://purl.oclc.org/ooxml/officeDocument/relationships/comments"
- StrictSourceRelationshipImage = "http://purl.oclc.org/ooxml/officeDocument/relationships/image"
- StrictNameSpaceSpreadSheet = "http://purl.oclc.org/ooxml/spreadsheetml/main"
- NameSpaceDublinCore = "http://purl.org/dc/elements/1.1/"
- NameSpaceDublinCoreTerms = "http://purl.org/dc/terms/"
- NameSpaceDublinCoreMetadataIntiative = "http://purl.org/dc/dcmitype/"
+ SourceRelationship = "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+ SourceRelationshipChart = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"
+ SourceRelationshipComments = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"
+ SourceRelationshipImage = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
+ SourceRelationshipTable = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"
+ SourceRelationshipDrawingML = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing"
+ SourceRelationshipDrawingVML = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing"
+ SourceRelationshipHyperLink = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"
+ SourceRelationshipWorkSheet = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"
+ SourceRelationshipChartsheet = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet"
+ SourceRelationshipPivotTable = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable"
+ SourceRelationshipPivotCache = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition"
+ SourceRelationshipVBAProject = "http://schemas.microsoft.com/office/2006/relationships/vbaProject"
+ SourceRelationshipChart201506 = "http://schemas.microsoft.com/office/drawing/2015/06/chart"
+ SourceRelationshipChart20070802 = "http://schemas.microsoft.com/office/drawing/2007/8/2/chart"
+ SourceRelationshipChart2014 = "http://schemas.microsoft.com/office/drawing/2014/chart"
+ SourceRelationshipCompatibility = "http://schemas.openxmlformats.org/markup-compatibility/2006"
+ NameSpaceDrawingML = "http://schemas.openxmlformats.org/drawingml/2006/main"
+ NameSpaceDrawingMLChart = "http://schemas.openxmlformats.org/drawingml/2006/chart"
+ NameSpaceDrawingMLSpreadSheet = "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
+ NameSpaceSpreadSheet = "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
+ NameSpaceSpreadSheetX14 = "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"
+ NameSpaceSpreadSheetX15 = "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"
+ NameSpaceSpreadSheetExcel2006Main = "http://schemas.microsoft.com/office/excel/2006/main"
+ NameSpaceMacExcel2008Main = "http://schemas.microsoft.com/office/mac/excel/2008/main"
+ NameSpaceXML = "http://www.w3.org/XML/1998/namespace"
+ NameSpaceXMLSchemaInstance = "http://www.w3.org/2001/XMLSchema-instance"
+ StrictSourceRelationship = "http://purl.oclc.org/ooxml/officeDocument/relationships"
+ StrictSourceRelationshipChart = "http://purl.oclc.org/ooxml/officeDocument/relationships/chart"
+ StrictSourceRelationshipComments = "http://purl.oclc.org/ooxml/officeDocument/relationships/comments"
+ StrictSourceRelationshipImage = "http://purl.oclc.org/ooxml/officeDocument/relationships/image"
+ StrictNameSpaceSpreadSheet = "http://purl.oclc.org/ooxml/spreadsheetml/main"
+ NameSpaceDublinCore = "http://purl.org/dc/elements/1.1/"
+ NameSpaceDublinCoreTerms = "http://purl.org/dc/terms/"
+ NameSpaceDublinCoreMetadataIntiative = "http://purl.org/dc/dcmitype/"
+ ContentTypeDrawing = "application/vnd.openxmlformats-officedocument.drawing+xml"
+ ContentTypeDrawingML = "application/vnd.openxmlformats-officedocument.drawingml.chart+xml"
+ ContentTypeMacro = "application/vnd.ms-excel.sheet.macroEnabled.main+xml"
+ ContentTypeSpreadSheetMLChartsheet = "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml"
+ ContentTypeSpreadSheetMLComments = "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"
+ ContentTypeSpreadSheetMLPivotCacheDefinition = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml"
+ ContentTypeSpreadSheetMLPivotTable = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml"
+ ContentTypeSpreadSheetMLTable = "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"
+ ContentTypeSpreadSheetMLWorksheet = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"
+ ContentTypeVBA = "application/vnd.ms-office.vbaProject"
+ ContentTypeVML = "application/vnd.openxmlformats-officedocument.vmlDrawing"
// ExtURIConditionalFormattings is the extLst child element
// ([ISO/IEC29500-1:2016] section 18.2.10) of the worksheet element
// ([ISO/IEC29500-1:2016] section 18.3.1.99) is extended by the addition of
@@ -240,6 +252,7 @@ type xdrClientData struct {
// with cells and its extents are in EMU units.
type xdrCellAnchor struct {
EditAs string `xml:"editAs,attr,omitempty"`
+ Pos *xlsxPoint2D `xml:"xdr:pos"`
From *xlsxFrom `xml:"xdr:from"`
To *xlsxTo `xml:"xdr:to"`
Ext *xlsxExt `xml:"xdr:ext"`
@@ -249,15 +262,23 @@ type xdrCellAnchor struct {
ClientData *xdrClientData `xml:"xdr:clientData"`
}
+// xlsxPoint2D describes the position of a drawing element within a spreadsheet.
+type xlsxPoint2D struct {
+ XMLName xml.Name `xml:"xdr:pos"`
+ X int `xml:"x,attr"`
+ Y int `xml:"y,attr"`
+}
+
// xlsxWsDr directly maps the root element for a part of this content type shall
// wsDr.
type xlsxWsDr struct {
- XMLName xml.Name `xml:"xdr:wsDr"`
- OneCellAnchor []*xdrCellAnchor `xml:"xdr:oneCellAnchor"`
- TwoCellAnchor []*xdrCellAnchor `xml:"xdr:twoCellAnchor"`
- A string `xml:"xmlns:a,attr,omitempty"`
- Xdr string `xml:"xmlns:xdr,attr,omitempty"`
- R string `xml:"xmlns:r,attr,omitempty"`
+ XMLName xml.Name `xml:"xdr:wsDr"`
+ AbsoluteAnchor []*xdrCellAnchor `xml:"xdr:absoluteAnchor"`
+ OneCellAnchor []*xdrCellAnchor `xml:"xdr:oneCellAnchor"`
+ TwoCellAnchor []*xdrCellAnchor `xml:"xdr:twoCellAnchor"`
+ A string `xml:"xmlns:a,attr,omitempty"`
+ Xdr string `xml:"xmlns:xdr,attr,omitempty"`
+ R string `xml:"xmlns:r,attr,omitempty"`
}
// xlsxGraphicFrame (Graphic Frame) directly maps the xdr:graphicFrame element.