]> git.lyx.org Git - features.git/blobdiff - src/text2.C
move floatlist to textclass
[features.git] / src / text2.C
index bf00bc745d66d81946c96a1130dd702957b885dd..228a5039c65bbe70b09fc362a5e7569c35e4d0d8 100644 (file)
@@ -382,10 +382,11 @@ void LyXText::removeParagraph(Row * row) const
 void LyXText::insertParagraph(BufferView * bview, Paragraph * par,
                              Row * row) const
 {
-       insertRow(row, par, 0);            /* insert a new row, starting
-                                           * at position 0 */
+       // insert a new row, starting at position 0
+       insertRow(row, par, 0);
 
-       setCounter(bview->buffer(), par);  // set the counters
+       // set the counters
+       setCounter(bview->buffer(), par);
 
        // and now append the whole paragraph behind the new row
        if (!row) {
@@ -1264,13 +1265,13 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
        }
 
        // is it a layout that has an automatic label?
-       if (layout->labeltype >=  LABEL_COUNTER_CHAPTER) {
+       if (layout->labeltype >= LABEL_COUNTER_CHAPTER) {
 
                int i = layout->labeltype - LABEL_COUNTER_CHAPTER;
                string numbertype, langtype;
                ostringstream s;
 
-               if (i >= 0 && i<= buf->params.secnumdepth) {
+               if (i >= 0 && i <= buf->params.secnumdepth) {
 
                        buf->counters().step(buf->counters().sects[i]);
 
@@ -1350,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());
 
@@ -1360,17 +1361,17 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
                                o << fl.name() << " #:";
                                s = o.str();
                        } else {
-                               /* par->SetLayout(0);
-                                  s = layout->labelstring;  */
+                               // par->SetLayout(0);
+                               // s = layout->labelstring;
                                s = (par->getParLanguage(buf->params)->lang() == "hebrew")
                                        ? " :úåòîùî øñç" : "Senseless: ";
                        }
                }
                par->params().labelString(s);
 
-               /* reset the enumeration counter. They are always resetted
-                * when there is any other layout between */
-               for (int i = par->enumdepth + 1; i < 4; i++) {
+               // reset the enumeration counter. They are always resetted
+               // when there is any other layout between
+               for (int i = par->enumdepth; i < 4; ++i) {
                        buf->counters().set(buf->counters().enums[i], 0);
                }
        }
@@ -1666,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)
 {