From 8f39375f4c29e7f7590efaeb6ce8c56490560c1f Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Tue, 24 Jul 2018 23:08:44 -0400 Subject: [PATCH] revert unwise data structure change --- include/xlnt/workbook/workbook.hpp | 17 +++++++++-------- source/detail/implementations/workbook_impl.hpp | 2 +- source/workbook/workbook.cpp | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/include/xlnt/workbook/workbook.hpp b/include/xlnt/workbook/workbook.hpp index d92cf2b2..3ba26859 100644 --- a/include/xlnt/workbook/workbook.hpp +++ b/include/xlnt/workbook/workbook.hpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -760,15 +761,15 @@ public: /// std::size_t add_shared_string(const rich_text &shared, bool allow_duplicates = false); - /// - /// Returns a reference to the shared string ordered by id - /// - const std::unordered_map &shared_strings_by_id() const; + /// + /// Returns a reference to the shared string ordered by id + /// + const std::map &shared_strings_by_id() const; - /// - /// Returns a reference to the shared string related to the specified index - /// - const rich_text &shared_strings(std::size_t index) const; + /// + /// Returns a reference to the shared string related to the specified index + /// + const rich_text &shared_strings(std::size_t index) const; /// /// Returns a reference to the shared strings being used by cells diff --git a/source/detail/implementations/workbook_impl.hpp b/source/detail/implementations/workbook_impl.hpp index 009f9ff2..13dd1941 100644 --- a/source/detail/implementations/workbook_impl.hpp +++ b/source/detail/implementations/workbook_impl.hpp @@ -118,7 +118,7 @@ struct workbook_impl std::list worksheets_; std::unordered_map shared_strings_ids_; - std::unordered_map shared_strings_values_; + std::map shared_strings_values_; optional stylesheet_; diff --git a/source/workbook/workbook.cpp b/source/workbook/workbook.cpp index 833d1ee8..fcea0b12 100644 --- a/source/workbook/workbook.cpp +++ b/source/workbook/workbook.cpp @@ -1332,7 +1332,7 @@ const manifest &workbook::manifest() const return d_->manifest_; } -const std::unordered_map &workbook::shared_strings_by_id() const +const std::map &workbook::shared_strings_by_id() const { return d_->shared_strings_values_; }