Forgot these bits.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29565 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2009-05-07 20:44:07 +00:00
parent 675925f659
commit 47595faf93
2 changed files with 4 additions and 4 deletions

View File

@ -981,7 +981,7 @@ docstring wrap(docstring const & str, int const ind, size_t const width)
docstring wrapParas(docstring const & str, int const indent,
size_t const width, size_t maxlines)
size_t const width, size_t const maxlines)
{
if (str.empty())
return docstring();
@ -997,12 +997,12 @@ docstring wrapParas(docstring const & str, int const indent,
if (nlines == 0)
continue;
int const curlines = retval.size();
if (curlines + nlines >= maxlines) {
if (maxlines > 0 && curlines + nlines >= maxlines) {
tmp.resize(maxlines - curlines - 1);
tmp.push_back(from_ascii("..."));
}
retval.insert(retval.end(), tmp.begin(), tmp.end());
if (retval.size() >= maxlines)
if (maxlines > 0 && retval.size() >= maxlines)
break;
}
return getStringFromVector(retval, from_ascii("\n"));

View File

@ -242,7 +242,7 @@ docstring wrap(docstring const & str, int const indent = 0,
/// \param numlines Don't return more than numlines lines. If numlines
/// is 0, we return everything.
docstring wrapParas(docstring const & str, int const indent = 0,
size_t const width = 80, size_t const numlines = 10);
size_t const width = 80, size_t const maxlines = 10);
/// gives a vector of stringparts which have the delimiter delim
/// If \p keepempty is true, empty strings will be pushed to the vector as well