+2002-03-21 Juergen Vigna <jug@sad.it>
+
+ * tabular.C (SetMultiColumn): collapse also the contents of the
+ cells and set the last border right. Added a Buffer const * param.
+
2002-03-20 Lars Gullik Bjønnes <larsbj@birdstep.com>
* Makefile.am (LYX_CONV_LIBS): select libs depending on partial
+2002-03-21 Juergen Vigna <jug@sad.it>
+
+ * insettext.C (appendParagraphs): new function added to append
+ the paragraphs to this insets paragraphs.
+
2002-03-20 Lars Gullik Bjønnes <larsbj@birdstep.com>
* Makefile.am: special rules if partial linking
tabular->UnsetMultiColumn(actcell);
updateLocal(bv, INIT, true);
} else {
- tabular->SetMultiColumn(actcell, 1);
+ tabular->SetMultiColumn(bv->buffer(), actcell, 1);
updateLocal(bv, CELL, true);
}
return;
s_start = sel_cell_start;
s_end = sel_cell_end;
}
- tabular->SetMultiColumn(s_start, s_end - s_start + 1);
+ tabular->SetMultiColumn(bv->buffer(), s_start, s_end - s_start + 1);
actcell = s_start;
clearSelection();
updateLocal(bv, INIT, true);
return;
owner()->getDrawFont(font);
}
+
+
+void InsetText::appendParagraphs(BufferParams const & bparams,
+ Paragraph * newpar)
+{
+ Paragraph * buf;
+ Paragraph * tmpbuf = newpar;
+ Paragraph * lastbuffer = buf = new Paragraph(*tmpbuf, false);
+
+ while (tmpbuf->next()) {
+ tmpbuf = tmpbuf->next();
+ lastbuffer->next(new Paragraph(*tmpbuf, false));
+ lastbuffer->next()->previous(lastbuffer);
+ lastbuffer = lastbuffer->next();
+ }
+ lastbuffer = par;
+ while (lastbuffer->next())
+ lastbuffer = lastbuffer->next();
+ if (newpar->size() && lastbuffer->size() &&
+ !lastbuffer->isSeparator(lastbuffer->size()-1))
+ {
+ lastbuffer->insertChar(lastbuffer->size(), ' ');
+ }
+
+ // make the buf exactly the same layout than our last paragraph
+ buf->makeSameLayout(lastbuffer);
+
+ // paste it!
+ lastbuffer->next(buf);
+ buf->previous(lastbuffer);
+ lastbuffer->pasteParagraph(bparams);
+
+ reinitLyXText();
+}
///
void getDrawFont(LyXFont &) const;
///
+ void appendParagraphs(BufferParams const & bparams, Paragraph *);
+ ///
//
// Public structures and variables
///
}
-void LyXTabular::SetMultiColumn(int cell, int number)
+void LyXTabular::SetMultiColumn(Buffer const * buffer, int cell, int number)
{
cellinfo_of_cell(cell)->multicolumn = CELL_BEGIN_OF_MULTICOLUMN;
cellinfo_of_cell(cell)->alignment = column_info[column_of_cell(cell)].alignment;
cellinfo_of_cell(cell)->top_line = row_info[row_of_cell(cell)].top_line;
cellinfo_of_cell(cell)->bottom_line = row_info[row_of_cell(cell)].bottom_line;
+ cellinfo_of_cell(cell)->right_line = column_info[column_of_cell(cell+number-1)].right_line;
+#if 1
+ for (int i = 1; i < number; ++i) {
+ cellinfo_of_cell(cell+i)->multicolumn = CELL_PART_OF_MULTICOLUMN;
+ cellinfo_of_cell(cell)->inset.appendParagraphs(buffer->params,
+ cellinfo_of_cell(cell+i)->inset.paragraph());
+ cellinfo_of_cell(cell+i)->inset.clear();
+ }
+#else
for (number--; number > 0; --number) {
cellinfo_of_cell(cell+number)->multicolumn = CELL_PART_OF_MULTICOLUMN;
}
+#endif
set_row_column_number_info();
}
///
bool IsMultiColumn(int cell, bool real = false) const;
///
- void SetMultiColumn(int cell, int number);
+ void SetMultiColumn(Buffer const *, int cell, int number);
///
int UnsetMultiColumn(int cell); // returns number of new cells
///