From 7efb00729681ef7cb8a02b711dfb64226256222d Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sat, 15 Sep 2007 17:24:08 +0000 Subject: [PATCH] Clear out selection and cut stack buffers on exit. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20293 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/CutAndPaste.cpp | 6 ++++++ src/CutAndPaste.h | 2 ++ src/LyX.cpp | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 7aeed7a2cd..1b8e73b379 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -690,6 +690,12 @@ void clearSelection() } +void clearCutStack() +{ + theCuts.clear(); +} + + docstring getSelection(Buffer const & buf, size_t sel_index) { return sel_index < theCuts.size() diff --git a/src/CutAndPaste.h b/src/CutAndPaste.h index e3fccedb76..1b7890d842 100644 --- a/src/CutAndPaste.h +++ b/src/CutAndPaste.h @@ -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 &); diff --git a/src/LyX.cpp b/src/LyX.cpp index 613d73f38c..873888c291 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -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; -- 2.39.2