]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
again some things which cherry pick did not catch, sorry
[lyx.git] / src / Text.cpp
index 5f79e38a99af5b089f4cef03ce4d109abd3c2fb4..328eb55f1d5f7009e7bf808055032211fe12648d 100644 (file)
@@ -68,6 +68,7 @@
 
 #include <boost/next_prior.hpp>
 
+#include <limits>
 #include <sstream>
 
 
@@ -1970,7 +1971,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)