]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetText.cpp
move more stuff from buffer_func to Buffer
[features.git] / src / insets / InsetText.cpp
index b346726201f1137297e4d6c5a79138752d38f7ca..078d8154dbca4a0b4c76c6f32d357aaadcbfb0a4 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Jürgen Vigna
+ * \author Jürgen Vigna
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -74,8 +74,8 @@ using graphics::PreviewLoader;
 InsetText::InsetText(Buffer const & buf)
        : drawFrame_(false), frame_color_(Color_insetframe)
 {
-       initParagraphs(buf.params());
        setBuffer(const_cast<Buffer &>(buf));
+       initParagraphs();
 }
 
 
@@ -99,13 +99,13 @@ void InsetText::setBuffer(Buffer & buf)
 }
 
 
-void InsetText::initParagraphs(BufferParams const & bparams)
+void InsetText::initParagraphs()
 {
        LASSERT(paragraphs().empty(), /**/);
        paragraphs().push_back(Paragraph());
        Paragraph & ourpar = paragraphs().back();
        ourpar.setInsetOwner(this);
-       ourpar.setPlainOrDefaultLayout(bparams.documentClass());
+       ourpar.setDefaultLayout(buffer_->params().documentClass());
 }
 
 
@@ -458,13 +458,13 @@ void InsetText::updateLabels(ParIterator const & it)
 {
        ParIterator it2 = it;
        it2.forwardPos();
-       LASSERT(&it2.inset() == this && it2.pit() == 0, /**/);
-       if (producesOutput())
-               lyx::updateLabels(buffer(), it2);
-       else {
-               DocumentClass const & tclass = buffer().params().documentClass();
+       LASSERT(&it2.inset() == this && it2.pit() == 0, return);
+       if (producesOutput()) {
+               buffer().updateLabels(it2);
+       else {
+               DocumentClass const & tclass = buffer().masterBuffer()->params().documentClass();
                Counters const savecnt = tclass.counters();
-               lyx::updateLabels(buffer(), it2);
+               buffer().updateLabels(it2);
                tclass.counters() = savecnt;
        }
 }
@@ -504,7 +504,7 @@ void InsetText::addToToc(DocIterator const & cdit)
                                        *static_cast<InsetOptArg&>(inset).paragraphs().begin();
                                if (!par.labelString().empty())
                                        tocstring = par.labelString() + ' ';
-                               tocstring += insetpar.asString();
+                               tocstring += insetpar.asString(AS_STR_INSETS);
                                break;
                        }
                        default:
@@ -517,7 +517,7 @@ void InsetText::addToToc(DocIterator const & cdit)
                        dit.pos() = 0;
                        // insert this into the table of contents
                        if (tocstring.empty())
-                               tocstring = par.asString(AS_STR_LABEL);
+                               tocstring = par.asString(AS_STR_LABEL | AS_STR_INSETS);
                        toc.push_back(TocItem(dit, toclevel - min_toclevel, tocstring));
                }