]> git.lyx.org Git - lyx.git/blobdiff - src/textcursor.C
Point fix, earlier forgotten
[lyx.git] / src / textcursor.C
index ecb6584a8ec7876037debeecca8b33eae737d6ae..c8d225990cfb841ba36252ead1ee1b1ab284b6bb 100644 (file)
@@ -1,23 +1,27 @@
+/**
+ * \file textcursor.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
 #include <config.h>
 
 #include "textcursor.h"
 
-bool TextCursor::setSelection()
+void TextCursor::setSelection()
 {
-       bool const lsel = selection.set();
-
        if (!selection.set()) {
-               last_sel_cursor = selection.cursor;
                selection.start = selection.cursor;
                selection.end = selection.cursor;
        }
 
        selection.set(true);
 
-       last_sel_cursor = cursor;
-
        // and now the whole selection
-
        if (selection.cursor.par() == cursor.par())
                if (selection.cursor.pos() < cursor.pos()) {
                        selection.end = cursor;
@@ -40,9 +44,9 @@ bool TextCursor::setSelection()
        // a selection with no contents is not a selection
        if (selection.start.par() == selection.end.par() &&
            selection.start.pos() == selection.end.pos())
+       {
                selection.set(false);
-
-       return lsel;
+       }
 }
 
 
@@ -50,11 +54,13 @@ void TextCursor::clearSelection()
 {
        selection.set(false);
        selection.mark(false);
-       last_sel_cursor = selection.end = selection.start = selection.cursor = cursor;
+       selection.end    = cursor;
+       selection.start  = cursor;
+       selection.cursor = cursor;
 }
 
 
-string const TextCursor::selectionAsString(Buffer const * buffer,
+string const TextCursor::selectionAsString(Buffer const & buffer,
                                        bool label) const
 {
        if (!selection.set())