-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make layout_summary() layout order correspond to order in PPTX file
In class `dir_collection`, files are added to a container during initialization using alphabetical sorting. This caused the slide layout order to deviate from the one in the PPTX file, for example, when calling layout_summary(). Files are now added to a container in the order of their trailing numeric index. For example, `slideLayout2.xml` will now preceed `slideLayout10.xml`. Before, alphabetical sorting was used, where `slideLayout10.xml` comes before `slideLayout2.xml`. fix #596
- Loading branch information
1 parent
c966124
commit 443b833
Showing
9 changed files
with
159 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
test_that("trailing file index extraction / sorting", { | ||
files <- c("slideLayout1.xml", "slideLayout11.xml", "slideLayout2.xml", "slideLayout10.xml") | ||
|
||
expect_equal(get_file_index(files), c(1, 11, 2, 10)) | ||
|
||
expect_equal(sort_vec_by_index(files), c("slideLayout1.xml", "slideLayout2.xml", "slideLayout10.xml", "slideLayout11.xml")) | ||
|
||
df <- data.frame(file1 = files, file2 = rev(files)) | ||
a <- sort_dataframe_by_index(df, "file1") | ||
b <- sort_dataframe_by_index(df, "file2") | ||
expect_true(all(a == rev(b))) | ||
}) | ||
|
||
|
||
test_that("misc", { | ||
df <- df_rename(mtcars, c("mpg", "cyl"), c("A", "B")) | ||
expect_true(all(names(df)[1:2] == c("A", "B"))) | ||
}) | ||
|