]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
add missing writeNormal() methods to some insets
[lyx.git] / src / paragraph.C
index 80745161f20150c9eccb35ee135df76fd12affe2..36d87fbc28bbd45290ebf0e5325d3f29eef533f7 100644 (file)
@@ -381,10 +381,18 @@ void Paragraph::validate(LaTeXFeatures & features) const
        }
 
        // then the insets
+       LyXLayout const & layout =
+                textclasslist.Style(bparams.textclass,
+                                    getLayout());
+
        for (InsetList::const_iterator cit = insetlist.begin();
             cit != insetlist.end(); ++cit) {
-               if (cit->inset)
+               if (cit->inset) {
                        cit->inset->validate(features);
+                       if (layout.needprotect &&
+                           cit->inset->lyxCode() == Inset::FOOT_CODE)
+                               features.NeedLyXFootnoteCode = true;
+               }
        }
 }
 
@@ -484,32 +492,29 @@ bool Paragraph::checkInsertChar(LyXFont & font)
 }
 
 
-void Paragraph::insertChar(Paragraph::size_type pos,
-                             Paragraph::value_type c)
+void Paragraph::insertChar(Paragraph::size_type pos, Paragraph::value_type c)
 {
        LyXFont const f(LyXFont::ALL_INHERIT);
        insertChar(pos, c, f);
 }
 
 
-void Paragraph::insertChar(Paragraph::size_type pos,
-                             Paragraph::value_type c,
-                             LyXFont const & font)
+void Paragraph::insertChar(Paragraph::size_type pos, Paragraph::value_type c,
+                           LyXFont const & font)
 {
        pimpl_->insertChar(pos, c, font);
 }
 
 
-void Paragraph::insertInset(Paragraph::size_type pos,
-                              Inset * inset)
+void Paragraph::insertInset(Paragraph::size_type pos, Inset * inset)
 {
        LyXFont const f(LyXFont::ALL_INHERIT);
        insertInset(pos, inset, f);
 }
 
 
-void Paragraph::insertInset(Paragraph::size_type pos,
-                              Inset * inset, LyXFont const & font)
+void Paragraph::insertInset(Paragraph::size_type pos, Inset * inset,
+                            LyXFont const & font)
 {
        pimpl_->insertInset(pos, inset, font);
 }
@@ -1930,18 +1935,23 @@ string const Paragraph::asString(Buffer const * buffer, bool label)
 
 
 string const Paragraph::asString(Buffer const * buffer, 
-                           Paragraph::size_type beg,
-                           Paragraph::size_type end)
+                                Paragraph::size_type beg,
+                                Paragraph::size_type end,
+                                bool label)
 {
        ostringstream ost;
 
-       if (beg == 0 && !params().labelString().empty())
+       if (beg == 0 && label && !params().labelString().empty())
                ost << params().labelString() << ' ';
 
        for (Paragraph::size_type i = beg; i < end; ++i) {
                value_type const c = getUChar(buffer->params, i);
                if (IsPrintable(c))
                        ost << c;
+               else if (c == META_NEWLINE)
+                       ost << '\n';
+               else if (c == META_HFILL)
+                       ost << '\t'; 
                else if (c == META_INSET) {
                        getInset(i)->ascii(buffer, ost);
                }