]> git.lyx.org Git - lyx.git/blobdiff - src/text3.C
remove obsolete comment
[lyx.git] / src / text3.C
index ad3de377e9d33ea51656d495c5964dc611689646..f8d42d02d14578db9bf4ef4042f670664e83bf86 100644 (file)
@@ -205,9 +205,7 @@ void LyXText::cursorPrevious(LCursor & cur)
        pit_type cpar = cur.pit();
 
        int x = cur.x_target();
-
-       // FIXME: there would maybe a need for this 'updated' boolean in the future...
-       bool updated = setCursorFromCoordinates(cur, x, 0);
+       setCursorFromCoordinates(cur, x, 0);
        cur.dispatch(FuncRequest(cur.selection()? LFUN_UP_SELECT: LFUN_UP));
 
        if (cpar == cur.pit() && cpos == cur.pos())
@@ -226,8 +224,7 @@ void LyXText::cursorNext(LCursor & cur)
        pit_type cpar = cur.pit();
 
        int x = cur.x_target();
-       // FIXME: there would maybe a need for this 'updated' boolean in the future...
-       bool updated = setCursorFromCoordinates(cur, x, cur.bv().workHeight() - 1);
+       setCursorFromCoordinates(cur, x, cur.bv().workHeight() - 1);
        cur.dispatch(FuncRequest(cur.selection()? LFUN_DOWN_SELECT: LFUN_DOWN));
 
        if (cpar == cur.pit() && cpos == cur.pos())
@@ -863,31 +860,13 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                break;
        }
 
-       case LFUN_CLIPBOARD_PASTE: {
-               cur.clearSelection();
-               docstring const clip = theClipboard().get();
-               if (!clip.empty()) {
-                       recordUndo(cur);
-                       if (cmd.argument() == "paragraph")
-                               insertStringAsParagraphs(cur, clip);
-                       else
-                               insertStringAsLines(cur, clip);
-               }
+       case LFUN_CLIPBOARD_PASTE:
+               pasteString(cur, theClipboard().get(), cmd.argument());
                break;
-       }
 
-       case LFUN_PRIMARY_SELECTION_PASTE: {
-               cur.clearSelection();
-               docstring const clip = theSelection().get();
-               if (!clip.empty()) {
-                       recordUndo(cur);
-                       if (cmd.argument() == "paragraph")
-                               insertStringAsParagraphs(cur, clip);
-                       else
-                               insertStringAsLines(cur, clip);
-               }
+       case LFUN_PRIMARY_SELECTION_PASTE:
+               pasteString(cur, theSelection().get(), cmd.argument());
                break;
-       }
 
        case LFUN_UNICODE_INSERT: {
                if (cmd.argument().empty())
@@ -1882,4 +1861,17 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd,
 }
 
 
+void LyXText::pasteString(LCursor & cur, docstring const & clip,
+               docstring const & argument)
+{
+       cur.clearSelection();
+       if (!clip.empty()) {
+               recordUndo(cur);
+               if (argument == "paragraph")
+                       insertStringAsParagraphs(cur, clip);
+               else
+                       insertStringAsLines(cur, clip);
+       }
+}
+
 } // namespace lyx