From 564165f0bd505ec3564fefdf7f89672e49a296a6 Mon Sep 17 00:00:00 2001 From: Jan Marvin Garbuszus Date: Sun, 1 Oct 2023 00:14:56 +0200 Subject: [PATCH] allow from or to to be waivers --- R/class-workbook.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/class-workbook.R b/R/class-workbook.R index 32c5d8631..571fdf851 100644 --- a/R/class-workbook.R +++ b/R/class-workbook.R @@ -6904,7 +6904,9 @@ wbWorkbook <- R6::R6Class( #' @param to the worksheet the style is applied to clone_sheet_style = function(from = current_sheet(), to) { - id_org <- private$get_sheet_index(from) + # clone is required, otherwise from sets the current sheet and to can + # not use current_sheet(). + id_org <- self$clone()$.__enclos_env__$private$get_sheet_index(from) id_new <- private$get_sheet_index(to) org_style <- self$worksheets[[id_org]]$sheet_data$cc