+2005-09-06 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * CutAndPaste.[Ch]: new methods dirtyTabularStack and
+ tabularStackDirty to work around bug 1919 (tabular needs
+ to know whether its own cell paste buffer or the one of
+ texted is newer.
+ * CutAndPaste.C: mark tabular_stack_ clean after copy.
+
2005-08-26 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* text2.C (cursorEnd): check for empty text (fixes bug 1998)
-2005-08-19 Lars Gullik Bjønnes <larsbj@gullik.net>
+2005-08-19 Lars Gullik Bjønnes <larsbj@gullik.net>
* CutAndPaste.C (eraseSelectionHelper): fix bug 1920
use old deleteion algorithm when changetracking is on.
CutStack theCuts(10);
+// store whether the tabular stack is newer than the normal copy stack
+// FIXME: this is a workaround for bug 1919. Should be removed for 1.5,
+// when we (hopefully) have a one-for-all paste mechanism.
+bool dirty_tabular_stack_;
+
class resetOwnerAndChanges : public std::unary_function<Paragraph, void> {
public:
void operator()(Paragraph & p) const {
// need a valid cursor. (Lgb)
cur.clearSelection();
updateCounters(cur.buffer());
+
+ // tell tabular that a recent copy happened
+ dirtyTabularStack(false);
}
if (cur.inMathed()) {
pars.back().insert(0, grabSelection(cur), LyXFont());
theCuts.push(make_pair(pars, bp.textclass));
}
+ // tell tabular that a recent copy happened
+ dirtyTabularStack(false);
}
}
+void dirtyTabularStack(bool b)
+{
+ dirty_tabular_stack_ = b;
+}
+
+
+bool tabularStackDirty()
+{
+ return dirty_tabular_stack_;
+}
+
+
} // namespace cap
} // namespace lyx
void selClearOrDel(LCursor & cur);
/// pastes n-th element of cut buffer
void selPaste(LCursor & cur, size_t n);
+
+/** Tabular has its own paste stack for multiple cells
+ * but it needs to know whether there is a more recent
+ * ordinary paste. Therefore which one is newer.
+ */
+//FIXME: this is a workaround for bug 1919. Replace this by
+//an all-for-one-paste mechanism in 1.5
+/// store whether tabular or ordinary paste stack is newer
+void dirtyTabularStack(bool b);
+/// is the tabular paste stack newer than the ordinary one?
+bool tabularStackDirty();
} // namespace cap
} // namespce lyx
+2005-09-06 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * insettabular.C: mark tabular_stack_ (of CutAndPaste) dirty
+ after copying several cells (works around bug 1919).
+
2005-09-05 Michael Gerz <michael.gerz@teststep.org>
* insetcharstyle.C (metrics,draw): consider inset label for
#include "bufferparams.h"
#include "BufferView.h"
#include "cursor.h"
+#include "CutAndPaste.h"
#include "coordcache.h"
#include "debug.h"
#include "dispatchresult.h"
#include <iostream>
#include <limits>
+using lyx::cap::tabularStackDirty;
+
using lyx::graphics::PreviewLoader;
using lyx::support::ltrim;
}
case LFUN_PASTE:
- if (hasPasteBuffer()) {
+ if (hasPasteBuffer() && tabularStackDirty()) {
recordUndo(cur, Undo::INSERT);
pasteSelection(cur);
break;
OutputParams const runparams;
paste_tabular->plaintext(cur.buffer(), os, runparams, 0, true, '\t');
cur.bv().stuffClipboard(os.str());
+ // mark tabular stack dirty
+ // FIXME: this is a workaround for bug 1919. Should be removed for 1.5,
+ // when we (hopefully) have a one-for-all paste mechanism.
+ lyx::cap::dirtyTabularStack(true);
+
return true;
}