]> git.lyx.org Git - lyx.git/commitdiff
Remove unneeded swap() (thanks Jean-Marc)
authorGeorg Baum <baum@lyx.org>
Mon, 7 Jul 2014 19:16:10 +0000 (21:16 +0200)
committerGeorg Baum <baum@lyx.org>
Mon, 7 Jul 2014 19:16:10 +0000 (21:16 +0200)
std::swap() does exactly the same thing, and avoiding code duplication is
always good.

src/Length.cpp
src/Length.h
src/insets/InsetTabular.cpp
src/insets/InsetTabular.h

index 10cdd2972615768ec518ef688adf2cd20ad1ac8b..0deed7481c915f3e2e70b6f2f100c80d7d993d64 100644 (file)
@@ -57,13 +57,6 @@ Length::Length(string const & data)
 }
 
 
-void Length::swap(Length & rhs)
-{
-       std::swap(val_, rhs.val_);
-       std::swap(unit_, rhs.unit_);
-}
-
-
 string const Length::asString() const
 {
        ostringstream os;
index 470c7e1a5382b73238f5f0a2785c7adfceba678d..435eea053576ab397c2d620edbee03102340e01d 100644 (file)
@@ -67,8 +67,6 @@ public:
        /// "data" must be a decimal number, followed by a unit
        explicit Length(std::string const & data);
 
-       ///
-       void swap(Length & rhs);
        ///
        double value() const;
        ///
index 52c10489f5aec4e0e4218717f2ab62b782549893..f7f0d2419b8ff20070f7f3bfcf2940ab0b17f144 100644 (file)
@@ -628,30 +628,6 @@ Tabular::CellData & Tabular::CellData::operator=(CellData const & cs)
        return *this;
 }
 
-void Tabular::CellData::swap(CellData & rhs)
-{
-       std::swap(cellno, rhs.cellno);
-       std::swap(width, rhs.width);
-       std::swap(multicolumn, rhs.multicolumn);
-       std::swap(multirow, rhs.multirow);
-       std::swap(mroffset, rhs.mroffset);
-       std::swap(alignment, rhs.alignment);
-       std::swap(valignment, rhs.valignment);
-       std::swap(decimal_hoffset, rhs.decimal_hoffset);
-       std::swap(decimal_width, rhs.decimal_width);
-       std::swap(voffset, rhs.voffset);
-       std::swap(top_line, rhs.top_line);
-       std::swap(bottom_line, rhs.bottom_line);
-       std::swap(left_line, rhs.left_line);
-       std::swap(right_line, rhs.right_line);
-       std::swap(usebox, rhs.usebox);
-       std::swap(rotate, rhs.rotate);
-       std::swap(align_special, rhs.align_special);
-       p_width.swap(rhs.p_width);
-       inset.swap(rhs.inset);
-}
-
-
 Tabular::RowData::RowData()
        : ascent(0),
          descent(0),
index 52a90f4320c30a5a01ee8b2141f0611af896cfa5..774949ca229a39ec5b5caecba478c7775c2927eb 100644 (file)
@@ -612,8 +612,6 @@ public:
                ///
                CellData & operator=(CellData const &);
                ///
-               void swap(CellData & rhs);
-               ///
                idx_type cellno;
                ///
                int width;