]> git.lyx.org Git - lyx.git/blobdiff - src/text2.C
Look for mathed xpms. Doesn't do anything yet due to lack of workable XPMs
[lyx.git] / src / text2.C
index 7268ca2e3aca3bed6434bc64fc1e00fa31dc5cf9..984a3f4cad759ef3edfd5bac568430c76f0a5230 100644 (file)
@@ -1351,7 +1351,7 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
 
                        if (isOK) {
                                Floating const & fl
-                                       = floatList.getType(static_cast<InsetFloat*>(in)->type());
+                                       = textclass.floats().getType(static_cast<InsetFloat*>(in)->type());
 
                                buf->counters().step(fl.name());
 
@@ -1371,7 +1371,7 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
 
                // reset the enumeration counter. They are always resetted
                // when there is any other layout between
-               for (int i = par->enumdepth + 1; i < 4; i++) {
+               for (int i = par->enumdepth; i < 4; ++i) {
                        buf->counters().set(buf->counters().enums[i], 0);
                }
        }
@@ -1667,37 +1667,6 @@ void LyXText::insertStringAsParagraphs(BufferView * bview, string const & str)
 }
 
 
-bool LyXText::gotoNextInset(BufferView * bview,
-                           vector<Inset::Code> const & codes,
-                           string const & contents) const
-{
-       LyXCursor res = cursor;
-       Inset * inset;
-       do {
-               if (res.pos() < res.par()->size() - 1) {
-                       res.pos(res.pos() + 1);
-               } else  {
-                       res.par(res.par()->next());
-                       res.pos(0);
-               }
-
-       } while (res.par() &&
-                !(res.par()->isInset(res.pos())
-                  && (inset = res.par()->getInset(res.pos())) != 0
-                  && find(codes.begin(), codes.end(), inset->lyxCode())
-                  != codes.end()
-                  && (contents.empty() ||
-                      static_cast<InsetCommand *>(res.par()->getInset(res.pos()))->getContents()
-                      == contents)));
-
-       if (res.par()) {
-               setCursor(bview, res.par(), res.pos(), false);
-               return true;
-       }
-       return false;
-}
-
-
 void LyXText::checkParagraph(BufferView * bview, Paragraph * par,
                             pos_type pos)
 {
@@ -2109,8 +2078,7 @@ void LyXText::cursorUp(BufferView * bview, bool selecting) const
                int y1 = cursor.iy() - first_y;
                int y2 = y1;
                y -= first_y;
-               Inset * inset_hit =
-                       bview->checkInsetHit(const_cast<LyXText *>(this), x, y1);
+               Inset * inset_hit = checkInsetHit(bview, x, y1);
                if (inset_hit && isHighlyEditableInset(inset_hit)) {
                        inset_hit->edit(bview, x, y - (y2 - y1), mouse_button::none);
                }
@@ -2133,8 +2101,7 @@ void LyXText::cursorDown(BufferView * bview, bool selecting) const
                int y1 = cursor.iy() - first_y;
                int y2 = y1;
                y -= first_y;
-               Inset * inset_hit =
-                       bview->checkInsetHit(const_cast<LyXText *>(this), x, y1);
+               Inset * inset_hit = checkInsetHit(bview, x, y1);
                if (inset_hit && isHighlyEditableInset(inset_hit)) {
                        inset_hit->edit(bview, x, y - (y2 - y1), mouse_button::none);
                }