Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMarvin committed Nov 27, 2022
1 parent f42c522 commit ca06ac6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions R/class-workbook.R
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ wbWorkbook <- R6::R6Class(
# sheet name instead of the clone source

chart <- self$charts$chart[chartid]
self$charts$rels[chartid] <- gsub("?drawing[0-9].xml", paste0("drawing", chartid, ".xml"), self$charts$rels[chartid])
self$charts$rels[chartid] <- gsub("?drawing[0-9]+.xml", paste0("drawing", chartid, ".xml"), self$charts$rels[chartid])

guard_ws <- function(x) {
if (grepl(" ", x)) x <- shQuote(x, type = "sh")
Expand Down Expand Up @@ -5996,7 +5996,7 @@ wbWorkbook <- R6::R6Class(
stylesInd <- grep("styles\\.xml", self$workbook.xml.rels)
themeInd <- grep("theme/theme[0-9]+.xml", self$workbook.xml.rels)
connectionsInd <- grep("connections.xml", self$workbook.xml.rels)
customXMLInd <- grep("customXml/item[0-9].xml", self$workbook.xml.rels)
customXMLInd <- grep("customXml/item[0-9]+.xml", self$workbook.xml.rels)
extRefInds <- grep("externalLinks/externalLink[0-9]+.xml", self$workbook.xml.rels)
sharedStringsInd <- grep("sharedStrings.xml", self$workbook.xml.rels)
tableInds <- grep("table[0-9]+.xml", self$workbook.xml.rels)
Expand All @@ -6006,7 +6006,7 @@ wbWorkbook <- R6::R6Class(

## Reordering of workbook.xml.rels
## don't want to re-assign rIds for pivot tables or slicer caches
pivotNode <- grep("pivotCache/pivotCacheDefinition[0-9].xml", self$workbook.xml.rels, value = TRUE)
pivotNode <- grep("pivotCache/pivotCacheDefinition[0-9]+.xml", self$workbook.xml.rels, value = TRUE)
slicerNode <- grep("slicerCache[0-9]+.xml", self$workbook.xml.rels, value = TRUE)

## Reorder children of workbook.xml.rels
Expand Down
4 changes: 2 additions & 2 deletions R/wb_load.R
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ wb_load <- function(file, xlsxFile = NULL, sheet, data_only = FALSE) {
cache_keep <- unlist(
regmatches(
wb$pivotTables.xml.rels,
gregexpr("(?<=pivotCache/pivotCacheDefinition)[0-9](?=\\.xml)",
gregexpr("(?<=pivotCache/pivotCacheDefinition)[0-9]+(?=\\.xml)",
wb$pivotTables.xml.rels,
perl = TRUE, ignore.case = TRUE
)
Expand Down Expand Up @@ -1196,7 +1196,7 @@ wb_load <- function(file, xlsxFile = NULL, sheet, data_only = FALSE) {
)
}

for (cstitm in seq_along(grep_xml("customXml/item[0-9].xml"))) {
for (cstitm in seq_along(grep_xml("customXml/item[0-9]+.xml"))) {

# TODO provide a function that creates a wb_rels data frame
wb_rels <- rbindlist(xml_attr(wb$workbook.xml.rels, "Relationship"))
Expand Down

0 comments on commit ca06ac6

Please sign in to comment.