]> git.lyx.org Git - lyx.git/blobdiff - src/text3.C
Extracted from r14281
[lyx.git] / src / text3.C
index d74494cefd20ef8c24eb90aa8f5c8092a9f2e174..49d204a3fd8614844e80faa8d9ca4c1c4fddff32 100644 (file)
@@ -47,7 +47,9 @@
 #include "pariterator.h"
 
 #include "frontends/Dialogs.h"
+#include "frontends/Gui.h"
 #include "frontends/LyXView.h"
+#include "frontends/Clipboard.h"
 
 #include "insets/insetcommand.h"
 #include "insets/insetfloatlist.h"
@@ -79,6 +81,9 @@ using lyx::cap::replaceSelection;
 using lyx::support::isStrUnsignedInt;
 using lyx::support::token;
 
+using lyx::frontend::Gui;
+using lyx::frontend::Clipboard;
+
 using std::endl;
 using std::string;
 using std::istringstream;
@@ -119,7 +124,7 @@ namespace {
                if (selecting || cur.mark())
                        cur.setSelection();
                if (!cur.selection())
-                       cur.bv().haveSelection(false);
+                       cur.bv().owner()->gui().clipboard().haveSelection(false);
                cur.bv().switchKeyMap();
        }
 
@@ -980,7 +985,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
 
        case LFUN_PRIMARY_SELECTION_PASTE: {
                cur.clearSelection();
-               string const clip = bv->getClipboard();
+               string const clip = bv->owner()->gui().clipboard().get();
                if (!clip.empty()) {
                        recordUndo(cur);
                        if (cmd.argument == "paragraph")
@@ -1040,7 +1045,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                        cursorEnd(cur);
                        cur.setSelection();
                        bv->cursor() = cur;
-                       bv->haveSelection(cur.selection());
+                       bv->owner()->gui().clipboard().haveSelection(cur.selection());
                }
                break;
 
@@ -1048,7 +1053,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                if (cmd.button() == mouse_button::button1) {
                        selectWord(cur, lyx::WHOLE_WORD_STRICT);
                        bv->cursor() = cur;
-                       bv->haveSelection(cur.selection());
+                       bv->owner()->gui().clipboard().haveSelection(cur.selection());
                }
                break;
 
@@ -1130,7 +1135,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
 
                // finish selection
                if (cmd.button() == mouse_button::button1)
-                       bv->haveSelection(cur.selection());
+                       bv->owner()->gui().clipboard().haveSelection(cur.selection());
 
                bv->switchKeyMap();
                bv->owner()->updateMenubar();
@@ -1151,7 +1156,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                if (lyxrc.auto_region_delete) {
                        if (cur.selection())
                                cutSelection(cur, false, false);
-                       bv->haveSelection(false);
+                       bv->owner()->gui().clipboard().haveSelection(false);
                }
 
                cur.clearSelection();