]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
Add \makeat switches to babel settings if necessary.
[lyx.git] / src / Text.cpp
index 5f79e38a99af5b089f4cef03ce4d109abd3c2fb4..baa9c3f1f82d6e6f055941b2c7315cb525fe753d 100644 (file)
@@ -68,6 +68,7 @@
 
 #include <boost/next_prior.hpp>
 
+#include <limits>
 #include <sstream>
 
 
@@ -266,11 +267,13 @@ Font const Text::outerFont(pit_type par_offset) const
 {
        depth_type par_depth = pars_[par_offset].getDepth();
        FontInfo tmpfont = inherit_font;
-
+       depth_type prev_par_depth = 0;
        // Resolve against environment font information
        while (par_offset != pit_type(pars_.size())
+              && par_depth != prev_par_depth
               && par_depth
               && !tmpfont.resolved()) {
+               prev_par_depth = par_depth;
                par_offset = outerHook(par_offset);
                if (par_offset != pit_type(pars_.size())) {
                        tmpfont.realize(pars_[par_offset].layout().font);
@@ -721,8 +724,7 @@ void Text::breakParagraph(Cursor & cur, bool inverse_logic)
                return;
        }
 
-       // a layout change may affect also the following paragraph
-       recUndo(cur, cur.pit(), undoSpan(cur.pit()) - 1);
+       cur.recordUndo();
 
        // Always break behind a space
        // It is better to erase the space (Dekel)
@@ -1693,7 +1695,7 @@ bool Text::dissolveInset(Cursor & cur)
                // change it to the buffer language.
                ParagraphList::iterator it = plist.begin();
                ParagraphList::iterator it_end = plist.end();
-               for (; it != it_end; it++)
+               for (; it != it_end; ++it)
                        it->changeLanguage(b.params(), latex_language, b.language());
 
                pasteParagraphList(cur, plist, b.params().documentClassPtr(),
@@ -1970,7 +1972,10 @@ docstring Text::asString(pit_type beg, pit_type end, int options) const
 
 void Text::forToc(docstring & os, size_t maxlen, bool shorten) const
 {
-       LASSERT(maxlen >= 8, maxlen = 30);
+       if (maxlen == 0)
+               maxlen = std::numeric_limits<std::size_t>::max();
+       else
+               LASSERT(maxlen >= 8, maxlen = TOC_ENTRY_LENGTH);
        for (size_t i = 0; i != pars_.size() && os.length() < maxlen; ++i)
                pars_[i].forToc(os, maxlen);
        if (shorten && os.length() >= maxlen)