]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
Fix a copy-paste error introduced in b754fb02
[lyx.git] / src / Text.cpp
index d3a122660da0636278e2972f3d3b387edcf243df..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 > 10, 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)