Skip to content

Commit

Permalink
Merge pull request #407 from krystian8207/master
Browse files Browse the repository at this point in the history
Add support for special characters within namedRegion.
  • Loading branch information
ycphs authored Mar 24, 2023
2 parents 43cd84f + 70b41c4 commit 8327152
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: openxlsx
Title: Read, Write and Edit xlsx Files
Version: 4.2.5.9000
Version: 4.2.5.9001
Date: 2021-12-13
Authors@R:
c(person(given = "Philipp",
Expand Down Expand Up @@ -57,7 +57,7 @@ VignetteBuilder:
knitr
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.1.2
RoxygenNote: 7.2.0
Collate:
'CommentClass.R'
'HyperlinkClass.R'
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# openxlsx (development version)

* Add support for `namedRegion`s having dots and other special characters ([#338](https://github.com/ycphs/openxlsx/issues/338)).
* Add type blanks and not blanks to conditional formatting ([#311](https://github.com/ycphs/openxlsx/pull/311))

# openxlsx 4.2.5
Expand Down
3 changes: 1 addition & 2 deletions R/readWorkbook.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,8 @@ read.xlsx.default <- function(
# name, the name will be "'sheet 1'" instead of "sheet 1.
dn_sheetNames[wsp] <- gsub("^'+|'+$", "\\1", dn_sheetNames[wsp])
}

# namedRegion in between 'name="' and '"'
dn_namedRegion <- gsub(".*name=\"(\\w+)\".*", "\\1", dn)
dn_namedRegion <- gsub(".*name=\"([[:graph:]_]+)\".*", "\\1", dn)

if (length(dn) == 0) {
warning("Workbook has no named region.")
Expand Down

0 comments on commit 8327152

Please sign in to comment.