]> git.lyx.org Git - features.git/blobdiff - src/tabular.C
parlist-23-a,diff
[features.git] / src / tabular.C
index 296288fc1113b6bf276c0853ea9785c962ac53dc..a5e498a2f6d38a8b46a9b539b3e7ff1d789c99b6 100644 (file)
@@ -117,23 +117,11 @@ LyXTabular::LyXTabular(BufferParams const & bp,
 
 
 LyXTabular::LyXTabular(BufferParams const & bp,
-                      InsetTabular * inset, LyXTabular const & lt,
-                      bool same_id)
+                      InsetTabular * inset, LyXTabular const & lt)
 {
        owner_ = inset;
        cur_cell = -1;
        Init(bp, lt.rows_, lt.columns_, &lt);
-       // we really should change again to have InsetText as a pointer
-       // and allocate it then we would not have to do this stuff all
-       // double!
-       if (same_id) {
-               for (int i = 0; i < rows_; ++i) {
-                       for (int j = 0; j < columns_; ++j) {
-                               cell_info[i][j].inset.id(lt.cell_info[i][j].inset.id());
-                               cell_info[i][j].inset.setParagraphData(lt.cell_info[i][j].inset.paragraphs, true);
-                       }
-               }
-       }
 #if 0
 #ifdef WITH_WARNINGS
 #warning Jürgen, can you make it the other way round. So that copy assignment depends on the copy constructor and not the other way. (Lgb)
@@ -143,6 +131,33 @@ LyXTabular::LyXTabular(BufferParams const & bp,
 }
 
 
+// LyXTabular::LyXTabular(BufferParams const & bp,
+//                    InsetTabular * inset, LyXTabular const & lt,
+//                    bool same_id)
+// {
+//     owner_ = inset;
+//     cur_cell = -1;
+//     Init(bp, lt.rows_, lt.columns_, &lt);
+//     // we really should change again to have InsetText as a pointer
+//     // and allocate it then we would not have to do this stuff all
+//     // double!
+//     if (same_id) {
+//             for (int i = 0; i < rows_; ++i) {
+//                     for (int j = 0; j < columns_; ++j) {
+//                             cell_info[i][j].inset.id(lt.cell_info[i][j].inset.id());
+//                             cell_info[i][j].inset.setParagraphData(lt.cell_info[i][j].inset.paragraphs, true);
+//                     }
+//             }
+//     }
+// #if 0
+// #ifdef WITH_WARNINGS
+// #warning Jürgen, can you make it the other way round. So that copy assignment depends on the copy constructor and not the other way. (Lgb)
+// #endif
+//     operator=(lt);
+// #endif
+// }
+
+
 LyXTabular::LyXTabular(Buffer const * buf, InsetTabular * inset, LyXLex & lex)
 {
        owner_ = inset;
@@ -177,9 +192,9 @@ LyXTabular & LyXTabular::operator=(LyXTabular const & lt)
 
 
 LyXTabular * LyXTabular::clone(BufferParams const & bp,
-                              InsetTabular * inset, bool same_id)
+                              InsetTabular * inset)
 {
-       LyXTabular * result = new LyXTabular(bp, inset, *this, same_id);
+       LyXTabular * result = new LyXTabular(bp, inset, *this);
 #if 0
        // don't know if this is good but I need to Clone also
        // the text-insets here, this is for the Undo-facility!
@@ -194,6 +209,24 @@ LyXTabular * LyXTabular::clone(BufferParams const & bp,
 }
 
 
+// LyXTabular * LyXTabular::clone(BufferParams const & bp,
+//                            InsetTabular * inset, bool same_id)
+// {
+//     LyXTabular * result = new LyXTabular(bp, inset, *this, same_id);
+// #if 0
+//     // don't know if this is good but I need to Clone also
+//     // the text-insets here, this is for the Undo-facility!
+//     for (int i = 0; i < rows_; ++i) {
+//             for (int j = 0; j < columns_; ++j) {
+//                     result->cell_info[i][j].inset = cell_info[i][j].inset;
+//                     result->cell_info[i][j].inset.setOwner(inset);
+//             }
+//     }
+// #endif
+//     return result;
+// }
+
+
 /* activates all lines and sets all widths to 0 */
 void LyXTabular::Init(BufferParams const & bp,
                      int rows_arg, int columns_arg, LyXTabular const * lt)
@@ -1872,8 +1905,7 @@ int LyXTabular::TeXCellPostamble(ostream & os, int cell) const
 
 
 int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const * buf,
-                                        LatexRunParams const & runparams,
-                                        bool fp) const
+                                        LatexRunParams const & runparams) const
 {
        if (!is_long_tabular)
                return 0;
@@ -1887,7 +1919,7 @@ int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const * buf,
                }
                for (int i = 0; i < rows_; ++i) {
                        if (row_info[i].endhead) {
-                               ret += TeXRow(os, i, buf, runparams, fp);
+                               ret += TeXRow(os, i, buf, runparams);
                        }
                }
                if (endhead.bottomDL) {
@@ -1909,7 +1941,7 @@ int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const * buf,
                }
                for (int i = 0; i < rows_; ++i) {
                        if (row_info[i].endfirsthead) {
-                               ret += TeXRow(os, i, buf, runparams, fp);
+                               ret += TeXRow(os, i, buf, runparams);
                        }
                }
                if (endfirsthead.bottomDL) {
@@ -1927,7 +1959,7 @@ int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const * buf,
                }
                for (int i = 0; i < rows_; ++i) {
                        if (row_info[i].endfoot) {
-                               ret += TeXRow(os, i, buf, runparams, fp);
+                               ret += TeXRow(os, i, buf, runparams);
                        }
                }
                if (endfoot.bottomDL) {
@@ -1949,7 +1981,7 @@ int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const * buf,
                }
                for (int i = 0; i < rows_; ++i) {
                        if (row_info[i].endlastfoot) {
-                               ret += TeXRow(os, i, buf, runparams, fp);
+                               ret += TeXRow(os, i, buf, runparams);
                        }
                }
                if (endlastfoot.bottomDL) {
@@ -1973,7 +2005,7 @@ bool LyXTabular::isValidRow(int const row) const
 
 
 int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf,
-                      LatexRunParams const & runparams, bool fp) const
+                      LatexRunParams const & runparams) const
 {
        int ret = 0;
        int cell = GetCellNumber(i, 0);
@@ -1990,7 +2022,7 @@ int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf,
 
                if (rtl)
                        os << "\\R{";
-               ret += inset->latex(buf, os, runparams, fp);
+               ret += inset->latex(buf, os, runparams);
                if (rtl)
                        os << '}';
 
@@ -2009,7 +2041,7 @@ int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf,
 
 
 int LyXTabular::latex(Buffer const * buf, ostream & os,
-                     LatexRunParams const & runparams, bool fp) const
+                     LatexRunParams const & runparams) const
 {
        int ret = 0;
 
@@ -2083,7 +2115,7 @@ int LyXTabular::latex(Buffer const * buf, ostream & os,
        os << "}\n";
        ++ret;
 
-       ret += TeXLongtableHeaderFooter(os, buf, runparams, fp);
+       ret += TeXLongtableHeaderFooter(os, buf, runparams);
 
        //+---------------------------------------------------------------------
        //+                      the single row and columns (cells)            +
@@ -2091,7 +2123,7 @@ int LyXTabular::latex(Buffer const * buf, ostream & os,
 
        for (int i = 0; i < rows_; ++i) {
                if (isValidRow(i)) {
-                       ret += TeXRow(os, i, buf, runparams, fp);
+                       ret += TeXRow(os, i, buf, runparams);
                        if (is_long_tabular && row_info[i].newpage) {
                                os << "\\newpage\n";
                                ++ret;
@@ -2558,8 +2590,8 @@ vector<string> const LyXTabular::getLabelList() const
 LyXTabular::BoxType LyXTabular::UseParbox(int cell) const
 {
        ParagraphList const & parlist = GetCellInset(cell)->paragraphs;
-       ParagraphList::iterator cit = parlist.begin();
-       ParagraphList::iterator end = parlist.end();
+       ParagraphList::const_iterator cit = parlist.begin();
+       ParagraphList::const_iterator end = parlist.end();
 
        for (; cit != end; ++cit) {
                for (int i = 0; i < cit->size(); ++i) {