Skip to content

Commit

Permalink
add hack for media references
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMarvin committed Oct 2, 2023
1 parent f120999 commit 1e0edaa
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions R/class-workbook.R
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,18 @@ wbWorkbook <- R6::R6Class(
# - Slicers

if (external_wb) {

# FIXME we copy all references from a workbook over to this workbook.
# This is not going to work, if multiple images from different
# workbooks are used. The references are called imageX.jpg and will
# overwrite each other. This needs a better solution
if (length(from$media)) {
if (!any(grepl("Default Extension=\"jpg\"", self$Content_Types))) {
self$append("Content_Types", "<Default Extension=\"jpg\" ContentType=\"image/jpg\"/>")
}
self$media <- append(self$media, from$media)
}

# update sheet styles
style <- get_cellstyle(from, sheet = old)
# only if styles are present
Expand Down

0 comments on commit 1e0edaa

Please sign in to comment.