]> git.lyx.org Git - lyx.git/blobdiff - src/tabular.C
Make lyx2lyx output the new external inset format.
[lyx.git] / src / tabular.C
index 894e8097de86f851b5ec095fca34b4fa81359857..023f5406cb98e3d4f65de007759403990facf4f7 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)
@@ -177,9 +165,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!
@@ -1872,8 +1860,7 @@ int LyXTabular::TeXCellPostamble(ostream & os, int cell) const
 
 
 int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const * buf,
-                                        LatexRunParams const & runparams,
-                                        bool fragile, bool fp) const
+                                        LatexRunParams const & runparams) const
 {
        if (!is_long_tabular)
                return 0;
@@ -1887,7 +1874,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, fragile, fp);
+                               ret += TeXRow(os, i, buf, runparams);
                        }
                }
                if (endhead.bottomDL) {
@@ -1909,7 +1896,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, fragile, fp);
+                               ret += TeXRow(os, i, buf, runparams);
                        }
                }
                if (endfirsthead.bottomDL) {
@@ -1927,7 +1914,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, fragile, fp);
+                               ret += TeXRow(os, i, buf, runparams);
                        }
                }
                if (endfoot.bottomDL) {
@@ -1949,7 +1936,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, fragile, fp);
+                               ret += TeXRow(os, i, buf, runparams);
                        }
                }
                if (endlastfoot.bottomDL) {
@@ -1973,7 +1960,7 @@ bool LyXTabular::isValidRow(int const row) const
 
 
 int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf,
-                      LatexRunParams const & runparams, bool fragile, bool fp) const
+                      LatexRunParams const & runparams) const
 {
        int ret = 0;
        int cell = GetCellNumber(i, 0);
@@ -1990,7 +1977,7 @@ int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf,
 
                if (rtl)
                        os << "\\R{";
-               ret += inset->latex(buf, os, runparams, fragile, fp);
+               ret += inset->latex(buf, os, runparams);
                if (rtl)
                        os << '}';
 
@@ -2009,7 +1996,7 @@ int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf,
 
 
 int LyXTabular::latex(Buffer const * buf, ostream & os,
-                     LatexRunParams const & runparams, bool fragile, bool fp) const
+                     LatexRunParams const & runparams) const
 {
        int ret = 0;
 
@@ -2083,7 +2070,7 @@ int LyXTabular::latex(Buffer const * buf, ostream & os,
        os << "}\n";
        ++ret;
 
-       ret += TeXLongtableHeaderFooter(os, buf, runparams, fragile, fp);
+       ret += TeXLongtableHeaderFooter(os, buf, runparams);
 
        //+---------------------------------------------------------------------
        //+                      the single row and columns (cells)            +
@@ -2091,7 +2078,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, fragile, fp);
+                       ret += TeXRow(os, i, buf, runparams);
                        if (is_long_tabular && row_info[i].newpage) {
                                os << "\\newpage\n";
                                ++ret;
@@ -2558,8 +2545,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) {