Skip to content

Commit

Permalink
adding a drawing to a worksheet should not overwrite existing workshe…
Browse files Browse the repository at this point in the history
…et_relationships like pivot tables (#821)
  • Loading branch information
JanMarvin authored Oct 19, 2023
1 parent 82e4d64 commit a7556c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/class-workbook.R
Original file line number Diff line number Diff line change
Expand Up @@ -4703,7 +4703,10 @@ wbWorkbook <- R6::R6Class(
# if a drawing exisits, we already added ourself to it. Otherwise we
# create a new drawing.
if (has_no_drawing) {
self$worksheets_rels[[sheet]] <- sprintf("<Relationship Id=\"rId%s\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing\" Target=\"../drawings/drawing%s.xml\"/>", next_relship, sheet_drawing)
self$worksheets_rels[[sheet]] <- append(
self$worksheets_rels[[sheet]],
sprintf("<Relationship Id=\"rId%s\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing\" Target=\"../drawings/drawing%s.xml\"/>", next_relship, sheet_drawing)
)
self$worksheets[[sheet]]$drawing <- sprintf("<drawing r:id=\"rId%s\"/>", next_relship)
}

Expand Down

0 comments on commit a7556c1

Please sign in to comment.