download.lst | 4 +- external/liborcus/Library_orcus-parser.mk | 1 external/liborcus/Library_orcus.mk | 10 ++++- external/liborcus/UnpackedTarball_liborcus.mk | 3 + external/liborcus/fix-pch.patch.0 | 11 ----- external/liborcus/gnumeric-set-grammar.patch.1 | 17 ++++++++ external/liborcus/msvc-int-narrowing.patch.1 | 50 +++++++++++++++++++++++++ external/liborcus/windows-constants-hack.patch | 12 +++--- 8 files changed, 85 insertions(+), 23 deletions(-)
New commits: commit 644170fe0cf6a53d9aa7fcc296004c1e17165f06 Author: Kohei Yoshida <ko...@libreoffice.org> AuthorDate: Fri Sep 29 17:45:14 2023 -0400 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Sat Dec 2 12:33:22 2023 +0100 Set grammar type to gnumeric before loading the content Without this, the document model side would not know what grammer to use to parse formula expressions. Change-Id: I7e921f9c0f9b088fb98fe126ad4a84db006c8747 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157413 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <ko...@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160229 diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk index b8c44479765b..292435dfd00d 100644 --- a/external/liborcus/UnpackedTarball_liborcus.mk +++ b/external/liborcus/UnpackedTarball_liborcus.mk @@ -21,6 +21,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\ external/liborcus/libtool.patch.0 \ external/liborcus/liborcus_newline.patch.1 \ external/liborcus/msvc-int-narrowing.patch.1 \ + external/liborcus/gnumeric-set-grammar.patch.1 \ )) ifeq ($(OS),WNT) diff --git a/external/liborcus/gnumeric-set-grammar.patch.1 b/external/liborcus/gnumeric-set-grammar.patch.1 new file mode 100644 index 000000000000..42bc46177737 --- /dev/null +++ b/external/liborcus/gnumeric-set-grammar.patch.1 @@ -0,0 +1,17 @@ +diff --git a/src/liborcus/orcus_gnumeric.cpp b/src/liborcus/orcus_gnumeric.cpp +index 76c13682..849759ba 100644 +--- a/src/liborcus/orcus_gnumeric.cpp ++++ b/src/liborcus/orcus_gnumeric.cpp +@@ -144,6 +144,12 @@ void orcus_gnumeric::read_stream(std::string_view stream) + if (!decompress_gzip(stream.data(), stream.size(), file_content)) + return; + ++ if (auto* gs = mp_impl->mp_factory->get_global_settings(); gs) ++ { ++ gs->set_origin_date(1899, 12, 30); ++ gs->set_default_formula_grammar(spreadsheet::formula_grammar_t::gnumeric); ++ } ++ + mp_impl->read_content_xml(file_content, get_config()); + mp_impl->mp_factory->finalize(); + } commit ffeed48bed5c31203978a070b3c758c180589e7c Author: Kohei Yoshida <ko...@libreoffice.org> AuthorDate: Thu Sep 28 20:29:52 2023 -0400 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Sat Dec 2 12:33:18 2023 +0100 Set the correct version number of orcus Ideally we should fix the Windows build properly, but cmake isn't available to us. Change-Id: I3f612604195212ba3a699c0b76785b5aa5f7925b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157391 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <ko...@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160228 diff --git a/external/liborcus/windows-constants-hack.patch b/external/liborcus/windows-constants-hack.patch index e86c74a722f3..68e57857826d 100644 --- a/external/liborcus/windows-constants-hack.patch +++ b/external/liborcus/windows-constants-hack.patch @@ -3,13 +3,13 @@ index ae571f5..539ce18 100644 --- a/src/liborcus/info.cpp +++ b/src/liborcus/info.cpp @@ -7,7 +7,9 @@ - + #include "orcus/info.hpp" - + -#include "constants.inl" +#define ORCUS_MAJOR_VERSION 0 -+#define ORCUS_MINOR_VERSION 17 -+#define ORCUS_MICRO_VERSION 2 - ++#define ORCUS_MINOR_VERSION 19 ++#define ORCUS_MICRO_VERSION 0 + namespace orcus { - + commit 0c2f023eb039d27b8ff3dd3b0baaf7b3c04547cf Author: Kohei Yoshida <ko...@libreoffice.org> AuthorDate: Wed Sep 27 22:15:22 2023 -0400 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Sat Dec 2 12:33:12 2023 +0100 Upgrade liborcus to 0.19.0 Change-Id: I57b92a86a155f244742fd70b1ab9a1acbc206a29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157345 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <ko...@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160227 diff --git a/download.lst b/download.lst index 1c3562bdc248..ecb87c819ee1 100644 --- a/download.lst +++ b/download.lst @@ -428,8 +428,8 @@ OPENSSL_TARBALL := openssl-3.0.11.tar.gz # three static lines # so that git cherry-pick # will not run into conflicts -ORCUS_SHA256SUM := 6006b9f1576315e313df715a7e72a17f3e0b17d7b6bd119cfa8a0b608ce971eb -ORCUS_TARBALL := liborcus-0.18.1.tar.xz +ORCUS_SHA256SUM := 1b68f54bb08face4c3dc83c912d921373c44aed817b37d879b7a4e47f2f15e09 +ORCUS_TARBALL := liborcus-0.19.0.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/liborcus/Library_orcus-parser.mk b/external/liborcus/Library_orcus-parser.mk index f26657756273..b7b459f36b7f 100644 --- a/external/liborcus/Library_orcus-parser.mk +++ b/external/liborcus/Library_orcus-parser.mk @@ -54,7 +54,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,orcus-parser,\ UnpackedTarball/liborcus/src/parser/json_parser_thread \ UnpackedTarball/liborcus/src/parser/parser_base \ UnpackedTarball/liborcus/src/parser/parser_global \ - UnpackedTarball/liborcus/src/parser/pstring \ UnpackedTarball/liborcus/src/parser/sax_parser_base \ UnpackedTarball/liborcus/src/parser/sax_token_parser \ UnpackedTarball/liborcus/src/parser/sax_token_parser_thread \ diff --git a/external/liborcus/Library_orcus.mk b/external/liborcus/Library_orcus.mk index 785cd440aab1..28ef13612260 100644 --- a/external/liborcus/Library_orcus.mk +++ b/external/liborcus/Library_orcus.mk @@ -62,11 +62,15 @@ $(eval $(call gb_Library_add_generated_exception_objects,orcus,\ UnpackedTarball/liborcus/src/liborcus/gnumeric_cell_context \ UnpackedTarball/liborcus/src/liborcus/gnumeric_context \ UnpackedTarball/liborcus/src/liborcus/gnumeric_detection_handler \ + UnpackedTarball/liborcus/src/liborcus/gnumeric_filter_context \ UnpackedTarball/liborcus/src/liborcus/gnumeric_handler \ - UnpackedTarball/liborcus/src/liborcus/gnumeric_helper \ + UnpackedTarball/liborcus/src/liborcus/gnumeric_names_context \ UnpackedTarball/liborcus/src/liborcus/gnumeric_namespace_types \ UnpackedTarball/liborcus/src/liborcus/gnumeric_sheet_context \ + UnpackedTarball/liborcus/src/liborcus/gnumeric_styles_context \ UnpackedTarball/liborcus/src/liborcus/gnumeric_tokens \ + UnpackedTarball/liborcus/src/liborcus/gnumeric_types \ + UnpackedTarball/liborcus/src/liborcus/gnumeric_value_format_parser \ UnpackedTarball/liborcus/src/liborcus/info \ UnpackedTarball/liborcus/src/liborcus/interface \ UnpackedTarball/liborcus/src/liborcus/json_document_tree \ @@ -75,6 +79,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,orcus,\ UnpackedTarball/liborcus/src/liborcus/json_structure_tree \ UnpackedTarball/liborcus/src/liborcus/json_util \ UnpackedTarball/liborcus/src/liborcus/measurement \ + UnpackedTarball/liborcus/src/liborcus/number_utils \ UnpackedTarball/liborcus/src/liborcus/odf_document_styles_context \ UnpackedTarball/liborcus/src/liborcus/odf_helper \ UnpackedTarball/liborcus/src/liborcus/odf_namespace_types \ @@ -114,7 +119,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,orcus,\ UnpackedTarball/liborcus/src/liborcus/string_helper \ UnpackedTarball/liborcus/src/liborcus/xlsx_autofilter_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_conditional_format_context \ - UnpackedTarball/liborcus/src/liborcus/xlsx_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_drawing_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_handler \ UnpackedTarball/liborcus/src/liborcus/xlsx_helper \ @@ -126,7 +130,9 @@ $(eval $(call gb_Library_add_generated_exception_objects,orcus,\ UnpackedTarball/liborcus/src/liborcus/xlsx_pivot_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_revision_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_session_data \ + UnpackedTarball/liborcus/src/liborcus/xlsx_shared_strings_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_sheet_context \ + UnpackedTarball/liborcus/src/liborcus/xlsx_styles_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_table_context \ UnpackedTarball/liborcus/src/liborcus/xlsx_types \ UnpackedTarball/liborcus/src/liborcus/xlsx_workbook_context \ diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk index ca4a40acf4e5..b8c44479765b 100644 --- a/external/liborcus/UnpackedTarball_liborcus.mk +++ b/external/liborcus/UnpackedTarball_liborcus.mk @@ -19,8 +19,8 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\ external/liborcus/rpath.patch.0 \ external/liborcus/gcc9.patch.0 \ external/liborcus/libtool.patch.0 \ - external/liborcus/fix-pch.patch.0 \ external/liborcus/liborcus_newline.patch.1 \ + external/liborcus/msvc-int-narrowing.patch.1 \ )) ifeq ($(OS),WNT) diff --git a/external/liborcus/fix-pch.patch.0 b/external/liborcus/fix-pch.patch.0 deleted file mode 100644 index 42a9d52d99f6..000000000000 --- a/external/liborcus/fix-pch.patch.0 +++ /dev/null @@ -1,11 +0,0 @@ ---- src/liborcus/gnumeric_cell_context.cpp.sav 2018-05-27 18:18:56.000000000 +0200 -+++ src/liborcus/gnumeric_cell_context.cpp 2019-10-13 10:43:24.587258400 +0200 -@@ -248,7 +248,7 @@ - range.last.column = col + mp_cell_data->array_cols - 1; - range.last.row = row + mp_cell_data->array_rows - 1; - -- iface::import_array_formula* af = mp_sheet->get_array_formula(); -+ spreadsheet::iface::import_array_formula* af = mp_sheet->get_array_formula(); - if (af) - { - af->set_range(range); diff --git a/external/liborcus/msvc-int-narrowing.patch.1 b/external/liborcus/msvc-int-narrowing.patch.1 new file mode 100644 index 000000000000..1075cebfdef3 --- /dev/null +++ b/external/liborcus/msvc-int-narrowing.patch.1 @@ -0,0 +1,50 @@ +Fix + + error C2398: Element '2': conversion from 'int' to 'const std::basic_string_view<char,std::char_traits<char>>::size_type' + requires a narrowing conversion + +diff --git a/src/liborcus/gnumeric_value_format_parser.cpp b/src/liborcus/gnumeric_value_format_parser.cpp +index 822c1ba1..014068e9 100644 +--- a/src/liborcus/gnumeric_value_format_parser.cpp ++++ b/src/liborcus/gnumeric_value_format_parser.cpp +@@ -12,6 +12,10 @@ + #include <cassert> + #include <sstream> + ++#include <boost/numeric/conversion/cast.hpp> ++ ++using boost::numeric_cast; ++ + namespace orcus { + + std::size_t gnumeric_value_format_parser::get_pos() const +@@ -41,7 +45,8 @@ void gnumeric_value_format_parser::segment() + if (pos != 2) + throw parse_error("value format segment is not formatted properly", get_pos()); + +- std::string_view s{p0, std::distance(p0, m_cur)}; ++ auto n = std::distance(p0, m_cur); ++ std::string_view s{p0, numeric_cast<std::size_t>(n)}; + if (s.empty()) + throw parse_error("segment value is empty", get_pos()); + +@@ -51,7 +56,8 @@ void gnumeric_value_format_parser::segment() + } + case '=': + { +- std::string_view s{p0, std::distance(p0, m_cur)}; ++ auto n = std::distance(p0, m_cur); ++ std::string_view s{p0, numeric_cast<std::size_t>(n)}; + seg.type = to_gnumeric_value_format_type(s); + if (seg.type == gnumeric_value_format_type::unknown) + { +@@ -65,7 +71,8 @@ void gnumeric_value_format_parser::segment() + } + case ':': + { +- std::string_view s{p0, std::distance(p0, m_cur)}; ++ auto n = std::distance(p0, m_cur); ++ std::string_view s{p0, numeric_cast<std::size_t>(n)}; + + switch (pos) + {