This should go in branch Jurgen. It is I think the right fix for bug 4178.

Abdel.

[EMAIL PROTECTED] wrote:
Author: younes
Date: Sat Sep 15 19:24:08 2007
New Revision: 20293

URL: http://www.lyx.org/trac/changeset/20293
Log:
Clear out selection and cut stack buffers on exit.

Modified:
    lyx-devel/trunk/src/CutAndPaste.cpp
    lyx-devel/trunk/src/CutAndPaste.h
    lyx-devel/trunk/src/LyX.cpp

Modified: lyx-devel/trunk/src/CutAndPaste.cpp
URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/CutAndPaste.cpp?rev=20293
==============================================================================
--- lyx-devel/trunk/src/CutAndPaste.cpp (original)
+++ lyx-devel/trunk/src/CutAndPaste.cpp Sat Sep 15 19:24:08 2007
@@ -690,6 +690,12 @@
 }
+void clearCutStack()
+{
+       theCuts.clear();
+}
+
+
 docstring getSelection(Buffer const & buf, size_t sel_index)
 {
        return sel_index < theCuts.size()

Modified: lyx-devel/trunk/src/CutAndPaste.h
URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/CutAndPaste.h?rev=20293
==============================================================================
--- lyx-devel/trunk/src/CutAndPaste.h (original)
+++ lyx-devel/trunk/src/CutAndPaste.h Sat Sep 15 19:24:08 2007
@@ -76,6 +76,8 @@
 bool selection();
 /// Clear our selection buffer
 void clearSelection();
+/// Clear our cut stack.
+void clearCutStack();
 /// Paste the current selection at \p cur
 /// Does handle undo. Does only work in text, not mathed.
 void pasteSelection(Cursor & cur, ErrorList &);

Modified: lyx-devel/trunk/src/LyX.cpp
URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/LyX.cpp?rev=20293
==============================================================================
--- lyx-devel/trunk/src/LyX.cpp (original)
+++ lyx-devel/trunk/src/LyX.cpp Sat Sep 15 19:24:08 2007
@@ -22,6 +22,7 @@
 #include "buffer_funcs.h"
 #include "BufferList.h"
 #include "Converter.h"
+#include "CutAndPaste.h"
 #include "debug.h"
 #include "Encoding.h"
 #include "ErrorList.h"
@@ -490,6 +491,10 @@
void LyX::prepareExit()
 {
+       // Clear the clipboard and selection stack:
+       cap::clearCutStack();
+       cap::clearSelection();
+
        // Set a flag that we do quitting from the program,
        // so no refreshes are necessary.
        quitting = true;




Reply via email to