diff --git a/DESCRIPTION b/DESCRIPTION index 1a3632638..eea106b05 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -43,3 +43,4 @@ RoxygenNote: 7.3.1 Roxygen: list(markdown = TRUE) Config/testthat/edition: 3 Config/testthat/parallel: true +Config/testthat/start-first: read_sources, class-workbook-wrappers diff --git a/R/class-workbook.R b/R/class-workbook.R index f8f802218..39434fc2b 100644 --- a/R/class-workbook.R +++ b/R/class-workbook.R @@ -3518,7 +3518,7 @@ wbWorkbook <- R6::R6Class( if (any(ind)) { nn <- sprintf("'%s'", new_name[i]) - nn <- stringi::stri_replace_all_fixed(self$workbook$definedName[ind], old, nn) + nn <- stringi::stri_replace_all_fixed(self$workbook$definedNames[ind], old, nn) nn <- stringi::stri_replace_all(nn, regex = "'+", replacement = "'") self$workbook$definedNames[ind] <- nn } diff --git a/R/get-named-regions.R b/R/get-named-regions.R index 2b4a9596f..f61c6ac90 100644 --- a/R/get-named-regions.R +++ b/R/get-named-regions.R @@ -43,7 +43,7 @@ get_nr_from_definedName <- function(wb) { get_named_regions_tab <- function(wb) { data.frame( #localSheetId is not always available - name = wb$tables$tab_nam, + name = wb$tables$tab_name, value = "table", sheets = wb_get_sheet_name(wb, wb$tables$tab_sheet), coords = wb$tables$tab_ref, diff --git a/R/helper-functions.R b/R/helper-functions.R index 5806040ff..a3b3077a2 100644 --- a/R/helper-functions.R +++ b/R/helper-functions.R @@ -824,7 +824,7 @@ get_colstyle <- function(wb, sheet = current_sheet()) { st_ids <- NULL if (length(wb$worksheets[[sheet]]$cols_attr)) { cols <- wb$worksheets[[sheet]]$unfold_cols() - st_ids <- cols$s[cols$s != ""] + st_ids <- cols$style[cols$style != ""] xf_ids <- match(st_ids, wb$styles_mgr$xf$id) xf_xml <- wb$styles_mgr$styles$cellXfs[xf_ids] } else { diff --git a/R/write.R b/R/write.R index 0104c95c3..5f4b6ed1f 100644 --- a/R/write.R +++ b/R/write.R @@ -475,12 +475,12 @@ write_data2 <- function( } wb$add_font( - sheet = sheetno, - dims = dim_sel, - color = hyperlink_col, - name = wb_get_base_font(wb)$name$val, - size = wb_get_base_font(wb)$size$val, - u = "single" + sheet = sheetno, + dims = dim_sel, + color = hyperlink_col, + name = wb$get_base_font()$name$val, + size = wb$get_base_font()$size$val, + underline = "single" ) } diff --git a/tests/testthat/test-class-comment.R b/tests/testthat/test-class-comment.R index ce812a79e..9d14d6e92 100644 --- a/tests/testthat/test-class-comment.R +++ b/tests/testthat/test-class-comment.R @@ -303,7 +303,7 @@ test_that("background images work", { # file extension must be png or jpeg, not jpg? tmp <- tempfile(fileext = ".png") - png(file = tmp, bg = "transparent") + png(filename = tmp, bg = "transparent") plot(1:10) rect(1, 5, 3, 7, col = "white") dev.off() @@ -320,7 +320,7 @@ test_that("background images work", { # file extension must be png or jpeg, not jpg? tmp2 <- tempfile(fileext = ".png") - png(file = tmp2, bg = "transparent") + png(filename = tmp2, bg = "transparent") barplot(1:10) dev.off() @@ -340,7 +340,7 @@ test_that("background images work", { test_that("More than two background images work", { tmp <- tempfile(fileext = ".png") - png(file = tmp, bg = "transparent") + png(filename = tmp, bg = "transparent") plot(1:10) dev.off() diff --git a/tests/testthat/test-class-workbook-wrappers.R b/tests/testthat/test-class-workbook-wrappers.R index 1506232e0..c1a6a1298 100644 --- a/tests/testthat/test-class-workbook-wrappers.R +++ b/tests/testthat/test-class-workbook-wrappers.R @@ -291,7 +291,7 @@ test_that("wb_get_tables(), wb_remove_tables() are wrappers", { test_that("wb_add_filter(), wb_remove_filter() is a wrapper", { wb <- wb_workbook()$add_worksheet("a") - params <- list(sheet = "a", col = 1, row = 1) + params <- list(sheet = "a", cols = 1, rows = 1) expect_wrapper("add_filter", wb = wb, params = params) wb$add_filter("a", 1, 1) expect_wrapper("remove_filter", wb = wb, params = list(sheet = "a")) diff --git a/tests/testthat/test-class-workbook.R b/tests/testthat/test-class-workbook.R index 17af1712a..e9e8bfd7a 100644 --- a/tests/testthat/test-class-workbook.R +++ b/tests/testthat/test-class-workbook.R @@ -40,7 +40,7 @@ test_that("wb_set_col_widths", { ) # a few more errors - expect_error(wb$set_col_widths("test", cols = "Y", width = 1:2)) + expect_error(wb$set_col_widths("test", cols = "Y", widths = 1:2)) expect_error(wb$set_col_widths("test", cols = "Y", hidden = 1:2)) @@ -48,7 +48,7 @@ test_that("wb_set_col_widths", { wb <- wb_workbook()$ add_worksheet()$ - set_col_widths(cols = 1:10, width = (8:17) + .5)$ + set_col_widths(cols = 1:10, widths = (8:17) + .5)$ add_data(x = rbind(8:17), colNames = FALSE) exp <- c( @@ -72,7 +72,7 @@ test_that("wb_set_col_widths", { "" ) - expect_silent(wb$set_col_widths(cols = 19, width = 9)) + expect_silent(wb$set_col_widths(cols = 19, widths = 9)) }) diff --git a/tests/testthat/test-styles_xml.R b/tests/testthat/test-styles_xml.R index 15fb5dd57..79766b685 100644 --- a/tests/testthat/test-styles_xml.R +++ b/tests/testthat/test-styles_xml.R @@ -123,7 +123,7 @@ test_that("dxf", { exp <- c("font", "fill", "alignment", "border", "extLst", "numFmt", "protection") - input <- wb$styles_mgr$styles$dxf + input <- wb$styles_mgr$styles$dxfs got <- read_dxf(as_xml(input)) expect_equal(sort(exp), sort(names(got)))