X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftabular.C;h=5213651290be0272b317d78b35e5836db4a69e27;hb=c130d5dbfd3f4d4a2721c9be786b7fa45b806aca;hp=1445ad1818e07dd13337623881ad1980f65c4e04;hpb=9ecdf1c6c3a4a3bce76a1237981260bd730262c6;p=features.git diff --git a/src/tabular.C b/src/tabular.C index 1445ad1818..5213651290 100644 --- a/src/tabular.C +++ b/src/tabular.C @@ -110,11 +110,23 @@ LyXTabular::LyXTabular(InsetTabular * inset, int rows_arg, int columns_arg) } -LyXTabular::LyXTabular(InsetTabular * inset, LyXTabular const & lt) +LyXTabular::LyXTabular(InsetTabular * inset, LyXTabular const & lt, + bool same_id) { owner_ = inset; cur_cell = -1; Init(lt.rows_, lt.columns_, <); + // 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.paragraph(),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) @@ -164,9 +176,9 @@ LyXTabular & LyXTabular::operator=(LyXTabular const & lt) } -LyXTabular * LyXTabular::clone(InsetTabular * inset) +LyXTabular * LyXTabular::clone(InsetTabular * inset, bool same_id) { - LyXTabular * result = new LyXTabular(inset, *this); + LyXTabular * result = new LyXTabular(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!