-
Notifications
You must be signed in to change notification settings - Fork 76
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 sharedString deletion #515
base: master
Are you sure you want to change the base?
Conversation
if (length(wb$sharedStrings) > 0) { | ||
ss <- data.frame( | ||
# the old index 0 indexed, as used in a$v | ||
old = as.numeric(seq(length(wb$sharedStrings)) - 1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe seq_along(wb$sharedStrings) - 1
@@ -17,7 +17,7 @@ test_that("int2col and col2int", { | |||
test_that("deleteDataColumn basics", { | |||
wb <- createWorkbook() | |||
addWorksheet(wb, "tester") | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unintended whitespace changes in the test file
Hi @DavZim , thanks for taking care of the issue. Much appreciated! Maybe one idea, you resize shared strings and subsequently have to update all references in all sheets. Is that required? Can't we just leave shared strings as is, or replace the removed strings with blanks or |
Good question, I didn't think of this. Is it maybe worth adding it behind a function argument? Or do you think it's such an edge case that its better to keep shared strings anyways? |
I doubt that it’s required to add new arguments for this, but I haven’t checked the impact yet. Aka what spreadsheet software does if some shared string entry isn’t used. Unless the shared strings are very long or very many, the impact on the file size should be negligible. |
Fixes #514
Also adds additional tests for the shared string usecase.
Makes the deleteDataColumn code a little bit easier to read and maintain.
Fixes another bug with sharedStrings across sheets. Now sharedStrings are fixed on a workbook-level and not sheet-level.