]> git.lyx.org Git - features.git/commit
Make TextMetrics noncopyable
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 12 Mar 2019 11:40:32 +0000 (12:40 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:16 +0000 (15:48 +0200)
commit6d67dfa2b42845206d8b40e9416f047e372cfa23
tree82ed526afc42c1304ba4e7b00a7b7d38fc9b135a
parent0f21f6024666702dc063aaf16a635bb3258cad3d
Make TextMetrics noncopyable

This is done by declaring unimplemented private copy constructor and
assignment operator.

This breaks compilation in BufferView::textMetrics, which does a copy when
inserting a TextMetrics object in the cache. Some C++11 wizardry I will not
pretend to completely understand saves the day.

See the following page for details:
  https://en.cppreference.com/w/cpp/container/map/emplace

This avoids real world bugs like #11512.
src/BufferView.cpp
src/TextMetrics.h