UPGRADING lyx.man acconfig.h autogen.sh \
config development forms images sourcedoc
-ETAGS_ARGS = --lang=c++
+#ETAGS_ARGS = --language-force=c++
man_MANS = lyx.1
## Needed by bindist
+2001-11-30 Juergen Vigna <jug@sad.it>
+
+ * tabular.C (LyXTabular): add a same_id to set the same id's in the
+ insets for undo reasons.
+
2001-11-28 André Pönitz <poenitz@gmx.net>
* vspace.[Ch]: cosmetical changes
+2001-11-30 Juergen Vigna <jug@sad.it>
+
+ * insettabular.C (InsetTabular): use the save_id flag to create also
+ the tabular with the same id's.
+
+ * insettext.C (setParagraphData): added a same_id function for undo
+ to set the same paragraph id's as of the paragraph we are setting.
+
2001-11-30 José Matos <jamatos@fep.up.pt>
* inseturl.[Ch]:
bool same_id)
: UpdatableInset(tab, same_id), buffer(&buf)
{
- tabular.reset(new LyXTabular(this, *(tab.tabular)));
+ tabular.reset(new LyXTabular(this, *(tab.tabular), same_id));
the_locking_inset = 0;
locked = no_selection = false;
oldcell = -1;
void InsetText::init(InsetText const * ins, bool same_id)
{
if (ins) {
- setParagraphData(ins->par);
+ setParagraphData(ins->par, same_id);
autoBreakRows = ins->autoBreakRows;
drawFrame_ = ins->drawFrame_;
frame_color = ins->frame_color;
}
-void InsetText::setParagraphData(Paragraph * p)
+void InsetText::setParagraphData(Paragraph * p, bool same_id)
{
// we have to unlock any locked inset otherwise we're in troubles
the_locking_inset = 0;
par = tmp;
}
- par = new Paragraph(*p, false);
+ par = new Paragraph(*p, same_id);
par->setInsetOwner(this);
Paragraph * np = par;
while (p->next()) {
p = p->next();
- np->next(new Paragraph(*p, false));
+ np->next(new Paragraph(*p, same_id));
np->next()->previous(np);
np = np->next();
np->setInsetOwner(this);
Paragraph * tmp = par;
while (tmp) {
int tmp_id = tmp->id();
- lyxerr << "Looking at paragraph: " << tmp_id << endl;
if (tmp->id() == id) {
return tmp;
}
///
void writeParagraphData(Buffer const *, std::ostream &) const;
///
- void setParagraphData(Paragraph *);
+ void setParagraphData(Paragraph *, bool same_id = false);
///
void setText(string const &);
///
}
-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)
}
-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!
///
LyXTabular(InsetTabular *, int columns_arg, int rows_arg);
///
- LyXTabular(InsetTabular *, LyXTabular const &);
+ LyXTabular(InsetTabular *, LyXTabular const &, bool same_id = false);
///
explicit
LyXTabular(Buffer const *, InsetTabular *, LyXLex & lex);
///
LyXTabular & operator=(LyXTabular const &);
///
- LyXTabular * clone(InsetTabular *);
+ LyXTabular * clone(InsetTabular *, bool same_id = false);
/// Returns true if there is a topline, returns false if not
bool TopLine(int cell, bool onlycolumn = false) const;
bv->buffer()->redostack.push(createUndo(bv, kind, first, behind));
}
+using lyx::pos_type;
Undo * createUndo(BufferView * bv, Undo::undo_kind kind,
Paragraph const * first, Paragraph const * behind)
Paragraph * start = const_cast<Paragraph *>(first);
Paragraph * end = 0;
-#if 0
- if (first)
- start = const_cast<Paragraph*>(before->next());
- else
- start = firstUndoParagraph(bv);
-#endif
if (behind)
end = const_cast<Paragraph*>(behind->previous());
else {