mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
Revert "Another easy 15-20% by not searching with no references"
This reverts commit 3ae31fadc3
.
This commit is contained in:
parent
544e90c975
commit
c3296db932
|
@ -750,7 +750,8 @@ void cell::format(const class format new_format)
|
||||||
format().d_->references -= format().d_->references > 0 ? 1 : 0;
|
format().d_->references -= format().d_->references > 0 ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
d_->format_ = detail::reference(new_format.d_);
|
++new_format.d_->references;
|
||||||
|
d_->format_ = new_format.d_;
|
||||||
}
|
}
|
||||||
|
|
||||||
calendar cell::base_date() const
|
calendar cell::base_date() const
|
||||||
|
|
|
@ -419,7 +419,6 @@ struct stylesheet
|
||||||
if (pattern->references == 0)
|
if (pattern->references == 0)
|
||||||
{
|
{
|
||||||
*pattern = new_format;
|
*pattern = new_format;
|
||||||
return pattern;
|
|
||||||
}
|
}
|
||||||
return find_or_create(new_format);
|
return find_or_create(new_format);
|
||||||
}
|
}
|
||||||
|
@ -432,7 +431,6 @@ struct stylesheet
|
||||||
if (pattern->references == 0)
|
if (pattern->references == 0)
|
||||||
{
|
{
|
||||||
*pattern = new_format;
|
*pattern = new_format;
|
||||||
return pattern;
|
|
||||||
}
|
}
|
||||||
return find_or_create(new_format);
|
return find_or_create(new_format);
|
||||||
}
|
}
|
||||||
|
@ -445,7 +443,6 @@ struct stylesheet
|
||||||
if (pattern->references == 0)
|
if (pattern->references == 0)
|
||||||
{
|
{
|
||||||
*pattern = new_format;
|
*pattern = new_format;
|
||||||
return pattern;
|
|
||||||
}
|
}
|
||||||
return find_or_create(new_format);
|
return find_or_create(new_format);
|
||||||
}
|
}
|
||||||
|
@ -458,7 +455,6 @@ struct stylesheet
|
||||||
if (pattern->references == 0)
|
if (pattern->references == 0)
|
||||||
{
|
{
|
||||||
*pattern = new_format;
|
*pattern = new_format;
|
||||||
return pattern;
|
|
||||||
}
|
}
|
||||||
return find_or_create(new_format);
|
return find_or_create(new_format);
|
||||||
}
|
}
|
||||||
|
@ -471,7 +467,6 @@ struct stylesheet
|
||||||
if (pattern->references == 0)
|
if (pattern->references == 0)
|
||||||
{
|
{
|
||||||
*pattern = new_format;
|
*pattern = new_format;
|
||||||
return pattern;
|
|
||||||
}
|
}
|
||||||
return find_or_create(new_format);
|
return find_or_create(new_format);
|
||||||
}
|
}
|
||||||
|
@ -488,7 +483,6 @@ struct stylesheet
|
||||||
if (pattern->references == 0)
|
if (pattern->references == 0)
|
||||||
{
|
{
|
||||||
*pattern = new_format;
|
*pattern = new_format;
|
||||||
return pattern;
|
|
||||||
}
|
}
|
||||||
return find_or_create(new_format);
|
return find_or_create(new_format);
|
||||||
}
|
}
|
||||||
|
@ -501,7 +495,6 @@ struct stylesheet
|
||||||
if (pattern->references == 0)
|
if (pattern->references == 0)
|
||||||
{
|
{
|
||||||
*pattern = new_format;
|
*pattern = new_format;
|
||||||
return pattern;
|
|
||||||
}
|
}
|
||||||
return find_or_create(new_format);
|
return find_or_create(new_format);
|
||||||
}
|
}
|
||||||
|
@ -584,15 +577,5 @@ struct stylesheet
|
||||||
std::vector<color> colors;
|
std::vector<color> colors;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline format_impl* reference(format_impl *impl)
|
|
||||||
{
|
|
||||||
++impl->references;
|
|
||||||
if (impl->references == 1)
|
|
||||||
{
|
|
||||||
impl = impl->parent->find_or_create(*impl);
|
|
||||||
}
|
|
||||||
return impl;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
} // namespace xlnt
|
} // namespace xlnt
|
||||||
|
|
Loading…
Reference in New Issue
Block a user