commit f5f2f5b7eaca90ba9bbddee3cea54708c9b98a36
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Tue Sep 18 23:07:48 2018 +0200

    Revert "Use swap in InsetText::updateBuffer for notes ad friends"
    
    This reverts commit 05d3a649521e0e8524209ae9deae75c30ff01e93.
---
 src/Counters.cpp         |    8 --------
 src/Counters.h           |    3 ---
 src/insets/InsetText.cpp |    4 ++--
 3 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/src/Counters.cpp b/src/Counters.cpp
index 3bb4d07..2daac53 100644
--- a/src/Counters.cpp
+++ b/src/Counters.cpp
@@ -697,12 +697,4 @@ void Counters::endEnvironment()
 }
 
 
-void swap(Counters & c1, Counters & c2)
-{
-       Counters tmp = move(c1);
-       c1 = move(c2);
-       c2 = move(tmp);
-}
-
-
 } // namespace lyx
diff --git a/src/Counters.h b/src/Counters.h
index f8bb0fa..536dcc1 100644
--- a/src/Counters.h
+++ b/src/Counters.h
@@ -239,9 +239,6 @@ private:
        std::vector<docstring> counter_stack_;
        /// Same, but for last layout.
        std::vector<Layout const *> layout_stack_;
-
-       ///
-       friend void swap(Counters &, Counters &);
 };
 
 } // namespace lyx
diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index d009357..74f60e4 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -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 savecnt = tclass.counters();
+               Counters const 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);
-               swap(tclass.counters(), savecnt);
+               tclass.counters() = savecnt;
        }
 }
 

Reply via email to