mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
reformat a little
This commit is contained in:
parent
182dea155b
commit
a653a39544
|
@ -124,6 +124,23 @@ struct number_converter
|
||||||
double result;
|
double result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
using style_id_pair = std::pair<xlnt::detail::style_impl, std::size_t>;
|
||||||
|
|
||||||
|
/// <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<style_id_pair> &styles,
|
||||||
|
std::size_t xfid, xlnt::optional<std::string> &style)
|
||||||
|
{
|
||||||
|
for (auto &item : styles)
|
||||||
|
{
|
||||||
|
if (item.second == xfid)
|
||||||
|
{
|
||||||
|
style = item.first.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1704,26 +1721,6 @@ 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()
|
void xlsx_consumer::read_stylesheet()
|
||||||
{
|
{
|
||||||
target_.impl().stylesheet_ = detail::stylesheet();
|
target_.impl().stylesheet_ = detail::stylesheet();
|
||||||
|
|
|
@ -170,4 +170,5 @@ const cell cell_vector::operator[](std::size_t cell_index) const
|
||||||
|
|
||||||
return ws_.cell(cursor_.make_offset(0, static_cast<int>(cell_index)));
|
return ws_.cell(cursor_.make_offset(0, static_cast<int>(cell_index)));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace xlnt
|
} // namespace xlnt
|
||||||
|
|
Loading…
Reference in New Issue
Block a user