Skip to content

Commit

Permalink
revert unwise data structure change
Browse files Browse the repository at this point in the history
  • Loading branch information
tfussell committed Jul 25, 2018
1 parent cbe50f4 commit 8f39375
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions include/xlnt/workbook/workbook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <functional>
#include <iterator>
#include <map>
#include <memory>
#include <string>
#include <unordered_map>
Expand Down Expand Up @@ -760,15 +761,15 @@ class XLNT_API workbook
/// </summary>
std::size_t add_shared_string(const rich_text &shared, bool allow_duplicates = false);

/// <summary>
/// Returns a reference to the shared string ordered by id
/// </summary>
const std::unordered_map<std::size_t, rich_text> &shared_strings_by_id() const;
/// <summary>
/// Returns a reference to the shared string ordered by id
/// </summary>
const std::map<std::size_t, rich_text> &shared_strings_by_id() const;

/// <summary>
/// Returns a reference to the shared string related to the specified index
/// </summary>
const rich_text &shared_strings(std::size_t index) const;
/// <summary>
/// Returns a reference to the shared string related to the specified index
/// </summary>
const rich_text &shared_strings(std::size_t index) const;

/// <summary>
/// Returns a reference to the shared strings being used by cells
Expand Down
2 changes: 1 addition & 1 deletion source/detail/implementations/workbook_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ struct workbook_impl

std::list<worksheet_impl> worksheets_;
std::unordered_map<rich_text, std::size_t, rich_text_hash> shared_strings_ids_;
std::unordered_map<std::size_t, rich_text> shared_strings_values_;
std::map<std::size_t, rich_text> shared_strings_values_;

optional<stylesheet> stylesheet_;

Expand Down
2 changes: 1 addition & 1 deletion source/workbook/workbook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@ const manifest &workbook::manifest() const
return d_->manifest_;
}

const std::unordered_map<std::size_t, rich_text> &workbook::shared_strings_by_id() const
const std::map<std::size_t, rich_text> &workbook::shared_strings_by_id() const
{
return d_->shared_strings_values_;
}
Expand Down

0 comments on commit 8f39375

Please sign in to comment.