]> git.lyx.org Git - features.git/commitdiff
Clear out selection and cut stack buffers on exit.
authorAbdelrazak Younes <younes@lyx.org>
Sat, 15 Sep 2007 17:24:08 +0000 (17:24 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 15 Sep 2007 17:24:08 +0000 (17:24 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20293 a592a061-630c-0410-9148-cb99ea01b6c8

src/CutAndPaste.cpp
src/CutAndPaste.h
src/LyX.cpp

index 7aeed7a2cdd60f07f8dd005ca7bd91e0d9a7e6f8..1b8e73b37963545e55300c6a82ff7bb513e80ec9 100644 (file)
@@ -690,6 +690,12 @@ void clearSelection()
 }
 
 
+void clearCutStack()
+{
+       theCuts.clear();
+}
+
+
 docstring getSelection(Buffer const & buf, size_t sel_index)
 {
        return sel_index < theCuts.size()
index e3fccedb76bc7fef0a3037d09bc1e8de319f06aa..1b7890d8426c7305ea74669fbd58bd4b1a52f62f 100644 (file)
@@ -76,6 +76,8 @@ void saveSelection(Cursor & cur);
 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 &);
index 613d73f38c8a33ec7196d39ae73158056c44256a..873888c2915ef910928399295cb4e0efd929236a 100644 (file)
@@ -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 @@ int LyX::exec(int & argc, char * argv[])
 
 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;