Skip to content

Commit

Permalink
Fix non-visual canvas properties ID calculator.
Browse files Browse the repository at this point in the history
  • Loading branch information
xuri committed May 25, 2017
1 parent fbc3d1c commit 7c3f91a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 4 additions & 3 deletions chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,8 @@ func (f *File) drawPlotAreaTxPr() *cTxPr {
// problem that the label structure is changed after serialization and
// deserialization, two different structures: decodeWsDr and encodeWsDr are
// defined.
func (f *File) drawingParser(drawingXML string, cNvPrID int, content *xlsxWsDr) {
func (f *File) drawingParser(drawingXML string, content *xlsxWsDr) int {
cNvPrID := 1
_, ok := f.XLSX[drawingXML]
if ok { // Append Model
decodeWsDr := decodeWsDr{}
Expand All @@ -825,6 +826,7 @@ func (f *File) drawingParser(drawingXML string, cNvPrID int, content *xlsxWsDr)
})
}
}
return cNvPrID
}

// addDrawingChart provides function to add chart graphic frame by given sheet,
Expand All @@ -841,8 +843,7 @@ func (f *File) addDrawingChart(sheet, drawingXML, cell string, width, height, rI
content := xlsxWsDr{}
content.A = NameSpaceDrawingML
content.Xdr = NameSpaceDrawingMLSpreadSheet
cNvPrID := 1
f.drawingParser(drawingXML, cNvPrID, &content)
cNvPrID := f.drawingParser(drawingXML, &content)
twoCellAnchor := xdrCellAnchor{}
twoCellAnchor.EditAs = "oneCell"
from := xlsxFrom{}
Expand Down
3 changes: 1 addition & 2 deletions picture.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ func (f *File) addDrawingPicture(sheet, drawingXML, cell, file string, width, he
content := xlsxWsDr{}
content.A = NameSpaceDrawingML
content.Xdr = NameSpaceDrawingMLSpreadSheet
cNvPrID := 1
f.drawingParser(drawingXML, cNvPrID, &content)
cNvPrID := f.drawingParser(drawingXML, &content)
twoCellAnchor := xdrCellAnchor{}
twoCellAnchor.EditAs = "oneCell"
from := xlsxFrom{}
Expand Down
3 changes: 1 addition & 2 deletions shape.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,7 @@ func (f *File) addDrawingShape(sheet, drawingXML, cell string, formatSet *format
content := xlsxWsDr{}
content.A = NameSpaceDrawingML
content.Xdr = NameSpaceDrawingMLSpreadSheet
cNvPrID := 1
f.drawingParser(drawingXML, cNvPrID, &content)
cNvPrID := f.drawingParser(drawingXML, &content)
twoCellAnchor := xdrCellAnchor{}
twoCellAnchor.EditAs = "oneCell"
from := xlsxFrom{}
Expand Down

0 comments on commit 7c3f91a

Please sign in to comment.