Skip to content

Commit

Permalink
fix for issue ycphs#68
Browse files Browse the repository at this point in the history
preparation for patch release on cran
  • Loading branch information
ycphs authored and kainhofer committed May 7, 2020
1 parent 146b938 commit 8df3dfe
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: openxlsx
Title: Read, Write and Edit xlsx Files
Version: 4.1.5
Date: 2020-05-06
Version: 4.1.5.1
Date: 2020-05-07
Language: en-US
Authors@R:
c(person(given = "Philipp",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# openxlsx 4.1.5.1

* fixed issue [#68](https://github.com/ycphs/openxlsx/issues/68])


# openxlsx 4.1.5

* include tests for cloneWorksheet
Expand Down
14 changes: 12 additions & 2 deletions R/wrappers.R
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,8 @@ createStyle <- function(fontName = NULL,
if (numFmt %in% validNumFmt) {
style$numFmt <- numFmtMapping[[numFmt[[1]]]]
} else {
style$numFmt <- list("numFmtId" = 9999, formatCode = numFmt) ## Custom numFmt

style$numFmt <- list("numFmtId" = 165, formatCode = numFmt) ## Custom numFmt
}
}

Expand Down Expand Up @@ -1004,7 +1005,16 @@ addStyle <- function(wb, sheet, style, rows, cols, gridExpand = FALSE, stack = F
od <- getOption("OutDec")
options("OutDec" = ".")
on.exit(expr = options("OutDec" = od), add = TRUE)





if(!is.null(style$numFmt)&length(wb$styleObjects)>0){
if(style$numFmt$numFmtId==165){
maxnumFmtId<-max(c(sapply(wb$styleObjects, function(i) as.integer(i$style$numFmt$numFmtId)),9999))
style$numFmt$numFmtId<-maxnumFmtId+1
}
}
sheet <- wb$validateSheet(sheet)

if (!"Workbook" %in% class(wb)) {
Expand Down

0 comments on commit 8df3dfe

Please sign in to comment.