From 1477038f20780f305e253d7d75ef010912d767ac Mon Sep 17 00:00:00 2001 From: Duncan Garmonsway Date: Thu, 21 Dec 2023 12:19:15 +0000 Subject: [PATCH] Support inline formatted strings Formatted strings are already supported as part of the strings table, so this change handles them the same way when they are inline. --- src/xlsxcell.cpp | 9 ++++++--- tests/testthat/inline-formatted-string.xlsx | Bin 0 -> 21682 bytes tests/testthat/test-inline-strings.R | 10 ++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 tests/testthat/inline-formatted-string.xlsx diff --git a/src/xlsxcell.cpp b/src/xlsxcell.cpp index 0caaae8..d3db46a 100644 --- a/src/xlsxcell.cpp +++ b/src/xlsxcell.cpp @@ -71,12 +71,12 @@ void xlsxcell::cacheValue( ) { // 'v' for 'value' is either literal (numeric) or an index into a string table rapidxml::xml_node<>* v = cell->first_node("v"); + rapidxml::xml_node<>* is = cell->first_node("is"); + std::string vvalue; if (v != NULL) { vvalue = v->value(); SET_STRING_ELT(book.content_, i, Rf_mkCharCE(vvalue.c_str(), CE_UTF8)); - } else { - book.is_blank_[i] = true; } // 't' for 'type' defines the meaning of 'v' for value @@ -100,15 +100,18 @@ void xlsxcell::cacheValue( if (t != NULL && tvalue == "inlineStr") { book.data_type_[i] = "character"; - rapidxml::xml_node<>* is = cell->first_node("is"); if (is != NULL) { // Get the inline string if it's really there + // Parse it as though it's a simple string std::string inlineString; parseString(is, inlineString); // value is modified in place + // Also parse it as though it's a formatted string SET_STRING_ELT(book.character_, i, Rf_mkCharCE(inlineString.c_str(), CE_UTF8)); + book.character_formatted_[i] = parseFormattedString(is, book.styles_); } return; } else if (v == NULL) { // Can't now be an inline string (tested above) + book.is_blank_[i] = true; book.data_type_[i] = "blank"; return; } else if (t == NULL || tvalue == "n") { diff --git a/tests/testthat/inline-formatted-string.xlsx b/tests/testthat/inline-formatted-string.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..20a0d774fdcc42b06642c0cb872b7d90f893211f GIT binary patch literal 21682 zcmeFZW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%Q1nagiX<2tl$ z59>zhsz2S^*RQ(vV6r)Tcb~qCM^?#!Pg9+3Az;su10}$OLbW>3K63C{kazi%-+?+r+ z0JV*dY`|o9bOXT7z-kI=n-B0=3Sr`~r`h$1?VR17- literal 0 HcmV?d00001 diff --git a/tests/testthat/test-inline-strings.R b/tests/testthat/test-inline-strings.R index 2c5a0f3..532822f 100644 --- a/tests/testthat/test-inline-strings.R +++ b/tests/testthat/test-inline-strings.R @@ -9,6 +9,16 @@ test_that("can read sheets with inlineStr", { expect_equal(x[14], "RQ11610") }) +test_that("can read sheets with formatted inline strings", { + # Original source: http://our.componentone.com/wp-content/uploads/2011/12/TestExcel.xlsx + # These appear to come from LibreOffice 4.2.7.2. + cells <- xlsx_cells("inline-formatted-string.xlsx") + index <- 64 + expect_equal(cells$is_blank[index], FALSE) + expect_equal(cells$data_type[index], "character") + expect_failure(expect_equal(cells$character_formatted[index], NULL)) +}) + test_that("does not crash on phonetic strings", { # https://github.com/nacnudus/tidyxl/issues/30 expect_error(xlsx_cells("phonetic.xlsx"), NA)