]> git.lyx.org Git - lyx.git/commitdiff
Do not pass list of columns parameter by value
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 12 Jan 2024 11:16:31 +0000 (12:16 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 12 Jan 2024 11:16:31 +0000 (12:16 +0100)
There is no need for copying this information.

Noticed by coverity scan.

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

index 27201d217b0881f0be63f0635a58615c193a9a97..112e80643c68173cf8958b4655dcc486b7f55074 100644 (file)
@@ -2599,8 +2599,8 @@ bool Tabular::isPartOfMultiRow(row_type row, col_type column) const
 }
 
 
-void Tabular::TeXTopHLine(otexstream & os, row_type row, list<col_type> columns,
-                         list<col_type> logical_columns) const
+void Tabular::TeXTopHLine(otexstream & os, row_type row, list<col_type> const & columns,
+                         list<col_type> const & logical_columns) const
 {
        // we only output complete row lines and the 1st row here, the rest
        // is done in Tabular::TeXBottomHLine(...)
@@ -2716,8 +2716,8 @@ void Tabular::TeXTopHLine(otexstream & os, row_type row, list<col_type> columns,
 }
 
 
-void Tabular::TeXBottomHLine(otexstream & os, row_type row, list<col_type> columns,
-                            list<col_type> logical_columns) const
+void Tabular::TeXBottomHLine(otexstream & os, row_type row, list<col_type> const & columns,
+                            list<col_type> const & logical_columns) const
 {
        // we output bottomlines of row r and the toplines of row r+1
        // if the latter do not span the whole tabular
@@ -3081,8 +3081,8 @@ void Tabular::TeXCellPostamble(otexstream & os, idx_type cell,
 
 void Tabular::TeXLongtableHeaderFooter(otexstream & os,
                                       OutputParams const & runparams,
-                                      list<col_type> columns,
-                                      list<col_type> logical_columns) const
+                                      list<col_type> const & columns,
+                                      list<col_type> const & logical_columns) const
 {
        if (!is_long_tabular)
                return;
@@ -3164,7 +3164,7 @@ bool Tabular::isValidRow(row_type row) const
 
 void Tabular::TeXRow(otexstream & os, row_type row,
                     OutputParams const & runparams,
-                    list<col_type> columns, list<col_type> logical_columns) const
+                    list<col_type> const & columns, list<col_type> const & logical_columns) const
 {
        //output the top line
        TeXTopHLine(os, row, columns, logical_columns);
index 84b9ae42228fc6beaa3c355af626ee49978fab22..4dba557a80942967b642536faa8d513763499b19 100644 (file)
@@ -923,8 +923,8 @@ public:
        ///
        bool isValidRow(row_type const row) const;
        ///
-       void TeXRow(otexstream &, row_type const row,
-                   OutputParams const &, std::list<col_type>, std::list<col_type>) const;
+       void TeXRow(otexstream &, row_type const row, OutputParams const &,
+                   std::list<col_type> const &, std::list<col_type> const &) const;
 
        /// change associated Buffer
        void setBuffer(Buffer & buffer);
@@ -982,19 +982,19 @@ private:
        ///
        // helper function for LaTeX
        ///
-       void TeXTopHLine(otexstream &, row_type row, std::list<col_type>,
-                        std::list<col_type>) const;
+       void TeXTopHLine(otexstream &, row_type row, std::list<col_type> const &,
+                        std::list<col_type> const &) const;
        ///
-       void TeXBottomHLine(otexstream &, row_type row, std::list<col_type>,
-                           std::list<col_type>) const;
+       void TeXBottomHLine(otexstream &, row_type row, std::list<col_type> const &,
+                           std::list<col_type> const &) const;
        ///
        void TeXCellPreamble(otexstream &, idx_type cell, bool & ismulticol, bool & ismultirow,
                             bool const bidi) const;
        ///
        void TeXCellPostamble(otexstream &, idx_type cell, bool ismulticol, bool ismultirow) const;
        ///
-       void TeXLongtableHeaderFooter(otexstream &, OutputParams const &, std::list<col_type>,
-                                     std::list<col_type>) const;
+       void TeXLongtableHeaderFooter(otexstream &, OutputParams const &, std::list<col_type> const &,
+                                     std::list<col_type> const &) const;
 
 }; // Tabular