Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for https://github.com/ycphs/openxlsx/issues/511 #512

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/helperFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ get_worksheet_entries <- function(wb, sheet) {
# get boolean vector of text entries
typ <- (dat$t == 1) & !is.na(dat$t)
# get text entry strings
str <- unlist(wb$sharedStrings[as.numeric(val)[typ] + 1])
str <- unlist(wb$sharedStrings[as.numeric(val[typ]) + 1])
# remove xml tags
str <- gsub("<.*?>", "", str)
# write strings to vector of entries
Expand Down
Binary file added inst/extdata/silent_worksheet_entries.xlsx
Binary file not shown.
7 changes: 7 additions & 0 deletions tests/testthat/test-silent_worksheet_entries.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
context("silent get_worksheet_entries")

test_that("get_worksheet_entries is silent in reference to string in other sheet", {
fl <- system.file("extdata", "silent_worksheet_entries.xlsx", package = "openxlsx")
wb <- loadWorkbook(fl)
expect_silent(get_worksheet_entries(wb, 1))
})
Loading