From 8946449c899db39e1c648e3c30d73ede76fa909b Mon Sep 17 00:00:00 2001 From: Jan Marvin Garbuszus Date: Sat, 30 Sep 2023 09:33:03 +0200 Subject: [PATCH] [update_table] guard against unknown xml nodes --- R/class-workbook.R | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/R/class-workbook.R b/R/class-workbook.R index 279743b61..32c5d8631 100644 --- a/R/class-workbook.R +++ b/R/class-workbook.R @@ -2399,6 +2399,15 @@ wbWorkbook <- R6::R6Class( xml <- wb_tabs$tab_xml tab_nams <- xml_node_name(xml, "table") + known_xml <- c("autoFilter", "tableColumns", "tableStyleInfo") + tab_unks <- tab_nams[!tab_nams %in% known_xml] + if (length(tab_unks)) { + msg <- paste( + "Found unknown table xml nodes. These are lost using update_table: ", + tab_unks + ) + warning(msg) + } tab_attr <- xml_attr(xml, "table")[[1]] tab_attr[["ref"]] <- dims