Kaydet (Commit) 42c8178c authored tarafından Kohei Yoshida's avatar Kohei Yoshida

More efficient way to check & insert listener into ptr_map.

Change-Id: I09ec8ed8f05621b72984a34f47db50d20ebd6c06
üst 96422e99
......@@ -557,12 +557,16 @@ sc::FormulaGroupAreaListener* ScFormulaCellGroup::getAreaListener(
{
AreaListenerKey aKey(rRange, bStartFixed, bEndFixed);
std::pair<AreaListenersType::iterator, bool> r =
mpImpl->maAreaListeners.insert(
aKey, new sc::FormulaGroupAreaListener(
AreaListenersType::iterator it = mpImpl->maAreaListeners.lower_bound(aKey);
if (it == mpImpl->maAreaListeners.end() || mpImpl->maAreaListeners.key_comp()(aKey, it->first))
{
// Insert a new one.
it = mpImpl->maAreaListeners.insert(
it, aKey, new sc::FormulaGroupAreaListener(
rRange, ppTopCell, mnLength, bStartFixed, bEndFixed));
}
return r.first->second;
return it->second;
}
void ScFormulaCellGroup::endAllGroupListening( ScDocument& rDoc )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment