mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
Merge branch 'TataMata-master' into dev
This commit is contained in:
commit
842eedae8c
|
@ -1704,6 +1704,26 @@ void xlsx_consumer::read_shared_workbook_user_data()
|
|||
{
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
/// <summary>
|
||||
/// Try to find given xfid value in the styles vector and, if succeeded, set's the optional style.
|
||||
/// </summary>
|
||||
void set_style_by_xfid(
|
||||
const std::vector<std::pair<style_impl, std::size_t>>& styles, std::size_t xfid, optional<std::string>& style
|
||||
)
|
||||
{
|
||||
for(auto item : styles)
|
||||
{
|
||||
if( item.second == xfid )
|
||||
{
|
||||
style = item.first.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void xlsx_consumer::read_stylesheet()
|
||||
{
|
||||
target_.impl().stylesheet_ = detail::stylesheet();
|
||||
|
@ -2326,7 +2346,7 @@ void xlsx_consumer::read_stylesheet()
|
|||
new_format.pivot_button_ = record.first.pivot_button_;
|
||||
new_format.quote_prefix_ = record.first.quote_prefix_;
|
||||
|
||||
new_format.style = styles.at(record.second).first.name;
|
||||
set_style_by_xfid(styles, record.second, new_format.style);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ cell_vector::iterator cell_vector::begin()
|
|||
cell_vector::iterator cell_vector::end()
|
||||
{
|
||||
auto past_end = cursor_;
|
||||
|
||||
|
||||
if (order_ == major_order::row)
|
||||
{
|
||||
past_end.column_index(bounds_.bottom_right().column_index() + 1);
|
||||
|
@ -69,7 +69,7 @@ cell_vector::const_iterator cell_vector::cbegin() const
|
|||
cell_vector::const_iterator cell_vector::cend() const
|
||||
{
|
||||
auto past_end = cursor_;
|
||||
|
||||
|
||||
if (order_ == major_order::row)
|
||||
{
|
||||
past_end.column_index(bounds_.bottom_right().column_index() + 1);
|
||||
|
@ -161,4 +161,13 @@ cell cell_vector::operator[](std::size_t cell_index)
|
|||
return ws_.cell(cursor_.make_offset(0, static_cast<int>(cell_index)));
|
||||
}
|
||||
|
||||
const cell cell_vector::operator[](std::size_t cell_index) const
|
||||
{
|
||||
if (order_ == major_order::row)
|
||||
{
|
||||
return ws_.cell(cursor_.make_offset(static_cast<int>(cell_index), 0));
|
||||
}
|
||||
|
||||
return ws_.cell(cursor_.make_offset(0, static_cast<int>(cell_index)));
|
||||
}
|
||||
} // namespace xlnt
|
||||
|
|
Loading…
Reference in New Issue
Block a user