Skip to content

Commit 66b3a36

Browse files
committed
fix: feed_from_xml should use vapply instead of sapply to make sure it does not turn into a list
fix edge cases for officedown
1 parent 436f236 commit 66b3a36

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: officer
33
Title: Manipulation of Microsoft Word and PowerPoint Documents
4-
Version: 0.7.2
4+
Version: 0.7.3.001
55
Authors@R: c(
66
person("David", "Gohel", , "david.gohel@ardata.fr", role = c("aut", "cre")),
77
person("Stefan", "Moog", , "moogs@gmx.de", role = "aut"),

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# officer 0.7.3
2+
3+
## Issues
4+
5+
- fix feed_from_xml for 'officedown'.
6+
17
# officer 0.7.2
28

39
## Issues

R/relationship.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ relationship <- R6Class(
1818
children <- xml_children(doc)
1919
ns <- xml_ns(doc)
2020

21-
private$id <- c(private$id, sapply(children, xml_attr, attr = "Id", ns))
21+
private$id <- c(private$id, vapply(children, xml_attr, NA_character_, attr = "Id", ns))
2222
private$type <- c(
2323
private$type,
24-
sapply(children, xml_attr, attr = "Type", ns)
24+
vapply(children, xml_attr, NA_character_, attr = "Type", ns)
2525
)
2626
private$target <- c(
2727
private$target,
28-
sapply(children, xml_attr, attr = "Target", ns)
28+
vapply(children, xml_attr, NA_character_, attr = "Target", ns)
2929
)
3030
private$target_mode <- c(
3131
private$target_mode,
32-
sapply(children, xml_attr, attr = "TargetMode", ns)
32+
vapply(children, xml_attr, NA_character_, attr = "TargetMode", ns)
3333
)
3434
private$ext_src <- c(private$ext_src, character(length(children)))
3535
self
@@ -101,6 +101,7 @@ relationship <- R6Class(
101101
ext_src = private$ext_src,
102102
stringsAsFactors = FALSE
103103
)
104+
104105
data[order(data$id), ]
105106
}
106107
data

0 commit comments

Comments
 (0)