]> git.lyx.org Git - features.git/blobdiff - src/text2.C
Replace LString.h with support/std_string.h,
[features.git] / src / text2.C
index 848aa5b5dd48bd2fdb978787e09d08faa69ec94c..aa8a4fe64178d999fb6f3171d4408d1ac128346e 100644 (file)
 #include <config.h>
 
 #include "lyxtext.h"
-#include "LString.h"
-#include "Lsstream.h"
-#include "paragraph.h"
+#include "support/std_sstream.h"
 #include "funcrequest.h"
 #include "frontends/LyXView.h"
 #include "undo_funcs.h"
 #include "buffer.h"
 #include "buffer_funcs.h"
-#include "bufferparams.h"
-#include "errorlist.h"
 #include "gettext.h"
 #include "BufferView.h"
 #include "CutAndPaste.h"
-#include "frontends/Painter.h"
 #include "frontends/font_metrics.h"
 #include "debug.h"
 #include "lyxrc.h"
+#include "Floating.h"
 #include "FloatList.h"
 #include "language.h"
 #include "ParagraphParameters.h"
@@ -56,7 +52,6 @@
 
 #include <boost/tuple/tuple.hpp>
 
-#include <algorithm>
 
 using namespace lyx::support;
 
@@ -671,16 +666,7 @@ void LyXText::cursorHome()
 
 void LyXText::cursorEnd()
 {
-       if (cursor.par()->empty())
-               return;
-
-       RowList::iterator rit = cursorRow();
-       ParagraphList::iterator pit = cursor.par();
-       pos_type pos = lastPos(*pit, rit);
-       /* cursor should be before a hard newline only */
-       if (!pit->isNewline(pos))
-               ++pos;
-       setCursor(pit, pos);
+       setCursor(cursor.par(), cursorRow()->end() - 1);
 }
 
 
@@ -1357,7 +1343,7 @@ void LyXText::setCursor(LyXCursor & cur, ParagraphList::iterator pit,
        // y is now the cursor baseline
        cur.y(y);
 
-       pos_type last = lastPrintablePos(*pit, row);
+       pos_type last = lastPos(*pit, row);
 
        // None of these should happen, but we're scaredy-cats
        if (pos > pit->size()) {
@@ -1496,7 +1482,7 @@ pos_type LyXText::getColumnNearX(ParagraphList::iterator pit,
        double fill_label_hfill = rit->fill_label_hfill();
 
        pos_type vc = rit->pos();
-       pos_type last = lastPrintablePos(*pit, rit);
+       pos_type last = lastPos(*pit, rit);
        pos_type c = 0;
        LyXLayout_ptr const & layout = pit->layout();