Skip to content

Commit

Permalink
more bad merges
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMarvin committed Jul 26, 2024
1 parent 3e649fa commit 97ffb3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions R/loadWorkbook.R
Original file line number Diff line number Diff line change
Expand Up @@ -642,11 +642,8 @@ loadWorkbook <- function(file, xlsxFile = NULL, isUnzipped = FALSE, na.convert =
wb$Content_Types <- c(wb$Content_Types, sprintf('<Override PartName="/xl/slicerCaches/slicerCache%s.xml" ContentType="application/vnd.ms-excel.slicerCache+xml"/>', inds))
wb$slicerCaches <- sapply(slicerCachesXML[order(nchar(slicerCachesXML), slicerCachesXML)], function(x) removeHeadTag(cppReadFile(x)))
wb$workbook.xml.rels <- c(wb$workbook.xml.rels, sprintf('<Relationship Id="rId%s" Type="http://schemas.microsoft.com/office/2007/relationships/slicerCache" Target="slicerCaches/slicerCache%s.xml"/>', 1E5 + inds, inds))
wb$workbook$extLst <- c(wb$workbook$extLst, genSlicerCachesExtLst(1E5 + inds))

if (!grepl("slicerCaches", wb$workbook$extLst))
wb$workbook$extLst <- c(wb$workbook$extLst, genSlicerCachesExtLst(1E5 + inds))
else
wb$workbook$extLst <- genSlicerCachesExtLst(1E5 + inds)
}


Expand Down
6 changes: 3 additions & 3 deletions src/read_workbook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,14 +553,14 @@ SEXP read_workbook(IntegerVector cols_in,

if(missing_header[i]){ // a missing header element

snprintf(&(name[0]), 6, "X%d", i+1);
snprintf(&(name[0]), 6, "X%hu", i+1);
col_names[i] = name;

}else{ // this is a header elements

col_names[i] = v[pos];
if(col_names[i] == "NA"){
snprintf(&(name[0]), 6, "X%d", i+1);
snprintf(&(name[0]), 6, "X%hu", i+1);
col_names[i] = name;
}

Expand Down Expand Up @@ -617,7 +617,7 @@ SEXP read_workbook(IntegerVector cols_in,
}else{ // else col_names is FALSE
char name[6];
for(int i =0; i < nCols; i++){
snprintf(&(name[0]), 6, "X%d", i+1);
snprintf(&(name[0]), 6, "X%hu", i+1);
col_names[i] = name;
}
}
Expand Down

0 comments on commit 97ffb3c

Please sign in to comment.