mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
fix conditional_format redefinition warning and don't try to write conditional formats for a worksheet without a stylesheet
This commit is contained in:
parent
d54ddea5cc
commit
116106d568
|
@ -173,7 +173,7 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
conditional_format conditional_format(const condition &when);
|
||||
xlnt::conditional_format conditional_format(const condition &when);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the first row or column in this range.
|
||||
|
|
|
@ -661,7 +661,7 @@ public:
|
|||
/// <summary>
|
||||
/// Creates a conditional format for the given range with the given condition.
|
||||
/// </summary>
|
||||
conditional_format conditional_format(const range_reference &ref, const condition &when);
|
||||
xlnt::conditional_format conditional_format(const range_reference &ref, const condition &when);
|
||||
|
||||
private:
|
||||
friend class cell;
|
||||
|
|
|
@ -66,6 +66,7 @@ struct stylesheet
|
|||
{
|
||||
auto iter = format_impls.begin();
|
||||
std::advance(iter, static_cast<std::list<format_impl>::difference_type>(index));
|
||||
|
||||
return xlnt::format(&*iter);
|
||||
}
|
||||
|
||||
|
@ -497,6 +498,7 @@ struct stylesheet
|
|||
|
||||
void clear()
|
||||
{
|
||||
conditional_format_impls.clear();
|
||||
format_impls.clear();
|
||||
|
||||
style_impls.clear();
|
||||
|
|
|
@ -2364,7 +2364,7 @@ void xlsx_producer::write_worksheet(const relationship &rel)
|
|||
write_end_element(xmlns, "mergeCells");
|
||||
}
|
||||
|
||||
// scope for conditional formatting production logic
|
||||
if (source_.impl().stylesheet_.is_set())
|
||||
{
|
||||
const auto &stylesheet = source_.impl().stylesheet_.get();
|
||||
const auto &cf_impls = stylesheet.conditional_format_impls;
|
||||
|
|
Loading…
Reference in New Issue
Block a user