mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Use std::move in InsetText::updateBuffer for notes and friends
Avoid as much as possible to do full copies of all counters, since
that can be expensive. Unfortunately, it is only posible when we want
to restore the saved counters.
An earlier version (05d3a649
) defined swap() for Counter, but caused
problems on windows.
Part of bug #5973.
This commit is contained in:
parent
f5f2f5b7ea
commit
82516e356b
@ -814,13 +814,13 @@ void InsetText::updateBuffer(ParIterator const & it, UpdateType utype)
|
||||
// Note that we do not need to call:
|
||||
// tclass.counters().clearLastLayout()
|
||||
// since we are saving and restoring the existing counters, etc.
|
||||
Counters const savecnt = tclass.counters();
|
||||
Counters savecnt = tclass.counters();
|
||||
tclass.counters().reset();
|
||||
// we need float information even in note insets (#9760)
|
||||
tclass.counters().current_float(savecnt.current_float());
|
||||
tclass.counters().isSubfloat(savecnt.isSubfloat());
|
||||
buffer().updateBuffer(it2, utype);
|
||||
tclass.counters() = savecnt;
|
||||
tclass.counters() = move(savecnt);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user