]> git.lyx.org Git - lyx.git/blobdiff - src/Text2.cpp
Remove using directives from headers
[lyx.git] / src / Text2.cpp
index 9e6ec8ee1f038c0dbf7815f11c6c34c14b67757c..96d1035243bab5915cbbda9b5e18e04ca3e3534a 100644 (file)
@@ -547,47 +547,23 @@ void Text::insertInset(Cursor & cur, Inset * inset)
 }
 
 
-bool Text::setCursor(Cursor & cur, pit_type par, pos_type pos,
+bool Text::setCursor(Cursor & cur, pit_type pit, pos_type pos,
                        bool setfont, bool boundary)
 {
        TextMetrics const & tm = cur.bv().textMetrics(this);
-       bool const update_needed = !tm.contains(par);
+       bool const update_needed = !tm.contains(pit);
        Cursor old = cur;
-       setCursorIntern(cur, par, pos, setfont, boundary);
+       setCursorIntern(cur, pit, pos, setfont, boundary);
        return cur.bv().checkDepm(cur, old) || update_needed;
 }
 
 
-void Text::setCursor(CursorSlice & cur, pit_type par, pos_type pos)
-{
-       LASSERT(par != int(paragraphs().size()), return);
-       cur.pit() = par;
-       cur.pos() = pos;
-
-       // now some strict checking
-       Paragraph & para = getPar(par);
-
-       // None of these should happen, but we're scaredy-cats
-       if (pos < 0) {
-               LYXERR0("Don't like -1!");
-               LATTEST(false);
-       }
-
-       if (pos > para.size()) {
-               LYXERR0("Don't like 1, pos: " << pos
-                      << " size: " << para.size()
-                      << " par: " << par);
-               LATTEST(false);
-       }
-}
-
-
-void Text::setCursorIntern(Cursor & cur,
-                             pit_type par, pos_type pos, bool setfont, bool boundary)
+void Text::setCursorIntern(Cursor & cur, pit_type pit, pos_type pos,
+                           bool setfont, bool boundary)
 {
        LBUFERR(this == cur.text());
        cur.boundary(boundary);
-       setCursor(cur.top(), par, pos);
+       cur.top().setPitPos(pit, pos);
        if (setfont)
                cur.setCurrentFont();
 }
@@ -906,7 +882,7 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
                               min(old.pit() + 1, old.lastpit()));
                ParagraphList & plist = old.text()->paragraphs();
                bool const soa = oldpar.params().startOfAppendix();
-               plist.erase(next(plist.begin(), old.pit()));
+               plist.erase(lyx::next(plist.begin(), old.pit()));
                // do not lose start of appendix marker (bug 4212)
                if (soa && old.pit() < pit_type(plist.size()))
                        plist[old.pit()].params().startOfAppendix(true);
@@ -970,7 +946,7 @@ void Text::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool tra
                        continue;
 
                if (par.empty() || (par.size() == 1 && par.isLineSeparator(0))) {
-                       pars_.erase(next(pars_.begin(), pit));
+                       pars_.erase(lyx::next(pars_.begin(), pit));
                        --pit;
                        --last;
                        continue;