#include "support/gettext.h"
#include "support/lassert.h"
#include "support/lstrings.h"
+#include "support/lyxalgo.h"
#include "support/textutils.h"
-#include <boost/next_prior.hpp>
-
-#include <limits>
#include <sstream>
ParagraphList & pars, pit_type par_offset, pos_type pos)
{
// create a new paragraph
- Paragraph & tmp = *pars.insert(boost::next(pars.begin(), par_offset + 1),
+ Paragraph & tmp = *pars.insert(next(pars.begin(), par_offset + 1),
Paragraph());
Paragraph & par = pars[par_offset];
// move the change of the end-of-paragraph character
par.setChange(par.size(), change);
- pars.erase(boost::next(pars.begin(), par_offset + 1));
+ pars.erase(lyx::next(pars.begin(), par_offset + 1));
}
ParagraphList & pars = text.paragraphs();
// create a new paragraph, and insert into the list
ParagraphList::iterator tmp =
- pars.insert(boost::next(pars.begin(), par_offset + 1),
+ pars.insert(next(pars.begin(), par_offset + 1),
Paragraph());
Paragraph & par = pars[par_offset];
} else {
continue;
}
- // do not insert consecutive spaces if !free_spacing
+ // do not insert consecutive spaces if !free_spacing
} else if ((*cit == ' ' || *cit == '\t') &&
space_inserted && !par.isFreeSpacing()) {
continue;
if (lyxrc.mac_like_cursor_movement) {
// Skip through trailing punctuation and spaces.
while (pos != lastpos && (par.isChar(pos) || par.isSpace(pos)))
- ++pos;
+ ++pos;
// Skip over either a non-char inset or a full word
if (pos != lastpos && par.isWordSeparator(pos))
if (cur.lastpos() == 0
|| (cur.lastpos() == 1 && par.isSeparator(0))) {
cur.recordUndo(prevcur.pit());
- plist.erase(boost::next(plist.begin(), cur.pit()));
+ plist.erase(next(plist.begin(), cur.pit()));
needsUpdate = true;
}
// is previous par empty?
else if (prevcur.lastpos() == 0
|| (prevcur.lastpos() == 1 && prevpar.isSeparator(0))) {
cur.recordUndo(prevcur.pit());
- plist.erase(boost::next(plist.begin(), prevcur.pit()));
+ plist.erase(next(plist.begin(), prevcur.pit()));
needsUpdate = true;
}
// Pasting is not allowed, if the paragraphs have different
void Text::forOutliner(docstring & os, size_t maxlen, bool shorten) const
{
- if (maxlen == 0)
- maxlen = std::numeric_limits<std::size_t>::max();
- else
- LASSERT(maxlen >= 8, maxlen = TOC_ENTRY_LENGTH);
+ LASSERT(maxlen >= 8, maxlen = TOC_ENTRY_LENGTH);
for (size_t i = 0; i != pars_.size() && os.length() < maxlen; ++i)
pars_[i].forOutliner(os, maxlen);
if (shorten && os.length() >= maxlen)