mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-14 01:22:33 +00:00
Call lyx::next and lyx::prev explicitely. In case libc++ provides
std::next even when not in C++11 mode this is necessary. E.g. with clang from Xcode7 on Mac OS X.
This commit is contained in:
parent
34cbec9074
commit
7e72c1d0d3
@ -422,8 +422,8 @@ static void getParagraphList(DocRange const & range,
|
|||||||
pit_type startpit = range.from.pit();
|
pit_type startpit = range.from.pit();
|
||||||
pit_type endpit = range.to.pit();
|
pit_type endpit = range.to.pit();
|
||||||
ParagraphList const & ps_ = range.text()->paragraphs();
|
ParagraphList const & ps_ = range.text()->paragraphs();
|
||||||
ParagraphList tmp_pars(next(ps_.begin(), startpit),
|
ParagraphList tmp_pars(lyx::next(ps_.begin(), startpit),
|
||||||
next(ps_.begin(), endpit + 1));
|
lyx::next(ps_.begin(), endpit + 1));
|
||||||
|
|
||||||
// Remove the end of the last paragraph; afterwards, remove the
|
// Remove the end of the last paragraph; afterwards, remove the
|
||||||
// beginning of the first paragraph. Keep this order - there may only
|
// beginning of the first paragraph. Keep this order - there may only
|
||||||
|
@ -387,7 +387,7 @@ pasteSelectionHelper(DocIterator const & cur, ParagraphList const & parlist,
|
|||||||
|
|
||||||
// Paste it!
|
// Paste it!
|
||||||
if (empty) {
|
if (empty) {
|
||||||
pars.insert(next(pars.begin(), pit),
|
pars.insert(lyx::next(pars.begin(), pit),
|
||||||
insertion.begin(),
|
insertion.begin(),
|
||||||
insertion.end());
|
insertion.end());
|
||||||
|
|
||||||
@ -395,7 +395,7 @@ pasteSelectionHelper(DocIterator const & cur, ParagraphList const & parlist,
|
|||||||
mergeParagraph(buffer.params(), pars,
|
mergeParagraph(buffer.params(), pars,
|
||||||
pit + insertion.size() - 1);
|
pit + insertion.size() - 1);
|
||||||
} else {
|
} else {
|
||||||
pars.insert(next(pars.begin(), pit + 1),
|
pars.insert(lyx::next(pars.begin(), pit + 1),
|
||||||
insertion.begin(),
|
insertion.begin(),
|
||||||
insertion.end());
|
insertion.end());
|
||||||
|
|
||||||
@ -599,8 +599,8 @@ void copySelectionHelper(Buffer const & buf, Text const & text,
|
|||||||
LASSERT(startpit != endpit || start <= end, return);
|
LASSERT(startpit != endpit || start <= end, return);
|
||||||
|
|
||||||
// Clone the paragraphs within the selection.
|
// Clone the paragraphs within the selection.
|
||||||
ParagraphList copy_pars(next(pars.begin(), startpit),
|
ParagraphList copy_pars(lyx::next(pars.begin(), startpit),
|
||||||
next(pars.begin(), endpit + 1));
|
lyx::next(pars.begin(), endpit + 1));
|
||||||
|
|
||||||
// Remove the end of the last paragraph; afterwards, remove the
|
// Remove the end of the last paragraph; afterwards, remove the
|
||||||
// beginning of the first paragraph. Keep this order - there may only
|
// beginning of the first paragraph. Keep this order - there may only
|
||||||
|
@ -135,7 +135,7 @@ void breakParagraphConservative(BufferParams const & bparams,
|
|||||||
ParagraphList & pars, pit_type par_offset, pos_type pos)
|
ParagraphList & pars, pit_type par_offset, pos_type pos)
|
||||||
{
|
{
|
||||||
// create a new paragraph
|
// create a new paragraph
|
||||||
Paragraph & tmp = *pars.insert(next(pars.begin(), par_offset + 1),
|
Paragraph & tmp = *pars.insert(lyx::next(pars.begin(), par_offset + 1),
|
||||||
Paragraph());
|
Paragraph());
|
||||||
Paragraph & par = pars[par_offset];
|
Paragraph & par = pars[par_offset];
|
||||||
|
|
||||||
@ -668,7 +668,7 @@ static void breakParagraph(Text & text, pit_type par_offset, pos_type pos,
|
|||||||
ParagraphList & pars = text.paragraphs();
|
ParagraphList & pars = text.paragraphs();
|
||||||
// create a new paragraph, and insert into the list
|
// create a new paragraph, and insert into the list
|
||||||
ParagraphList::iterator tmp =
|
ParagraphList::iterator tmp =
|
||||||
pars.insert(next(pars.begin(), par_offset + 1),
|
pars.insert(lyx::next(pars.begin(), par_offset + 1),
|
||||||
Paragraph());
|
Paragraph());
|
||||||
|
|
||||||
Paragraph & par = pars[par_offset];
|
Paragraph & par = pars[par_offset];
|
||||||
@ -1643,14 +1643,14 @@ bool Text::backspacePos0(Cursor & cur)
|
|||||||
if (cur.lastpos() == 0
|
if (cur.lastpos() == 0
|
||||||
|| (cur.lastpos() == 1 && par.isSeparator(0))) {
|
|| (cur.lastpos() == 1 && par.isSeparator(0))) {
|
||||||
cur.recordUndo(prevcur.pit());
|
cur.recordUndo(prevcur.pit());
|
||||||
plist.erase(next(plist.begin(), cur.pit()));
|
plist.erase(lyx::next(plist.begin(), cur.pit()));
|
||||||
needsUpdate = true;
|
needsUpdate = true;
|
||||||
}
|
}
|
||||||
// is previous par empty?
|
// is previous par empty?
|
||||||
else if (prevcur.lastpos() == 0
|
else if (prevcur.lastpos() == 0
|
||||||
|| (prevcur.lastpos() == 1 && prevpar.isSeparator(0))) {
|
|| (prevcur.lastpos() == 1 && prevpar.isSeparator(0))) {
|
||||||
cur.recordUndo(prevcur.pit());
|
cur.recordUndo(prevcur.pit());
|
||||||
plist.erase(next(plist.begin(), prevcur.pit()));
|
plist.erase(lyx::next(plist.begin(), prevcur.pit()));
|
||||||
needsUpdate = true;
|
needsUpdate = true;
|
||||||
}
|
}
|
||||||
// Pasting is not allowed, if the paragraphs have different
|
// Pasting is not allowed, if the paragraphs have different
|
||||||
|
@ -906,7 +906,7 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
|
|||||||
min(old.pit() + 1, old.lastpit()));
|
min(old.pit() + 1, old.lastpit()));
|
||||||
ParagraphList & plist = old.text()->paragraphs();
|
ParagraphList & plist = old.text()->paragraphs();
|
||||||
bool const soa = oldpar.params().startOfAppendix();
|
bool const soa = oldpar.params().startOfAppendix();
|
||||||
plist.erase(next(plist.begin(), old.pit()));
|
plist.erase(lyx::next(plist.begin(), old.pit()));
|
||||||
// do not lose start of appendix marker (bug 4212)
|
// do not lose start of appendix marker (bug 4212)
|
||||||
if (soa && old.pit() < pit_type(plist.size()))
|
if (soa && old.pit() < pit_type(plist.size()))
|
||||||
plist[old.pit()].params().startOfAppendix(true);
|
plist[old.pit()].params().startOfAppendix(true);
|
||||||
@ -970,7 +970,7 @@ void Text::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool tra
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (par.empty() || (par.size() == 1 && par.isLineSeparator(0))) {
|
if (par.empty() || (par.size() == 1 && par.isLineSeparator(0))) {
|
||||||
pars_.erase(next(pars_.begin(), pit));
|
pars_.erase(lyx::next(pars_.begin(), pit));
|
||||||
--pit;
|
--pit;
|
||||||
--last;
|
--last;
|
||||||
continue;
|
continue;
|
||||||
|
@ -370,7 +370,7 @@ static void outline(OutlineOp mode, Cursor & cur)
|
|||||||
ParagraphList & pars = buf.text().paragraphs();
|
ParagraphList & pars = buf.text().paragraphs();
|
||||||
ParagraphList::iterator const bgn = pars.begin();
|
ParagraphList::iterator const bgn = pars.begin();
|
||||||
// The first paragraph of the area to be copied:
|
// The first paragraph of the area to be copied:
|
||||||
ParagraphList::iterator start = next(bgn, pit);
|
ParagraphList::iterator start = lyx::next(bgn, pit);
|
||||||
// The final paragraph of area to be copied:
|
// The final paragraph of area to be copied:
|
||||||
ParagraphList::iterator finish = start;
|
ParagraphList::iterator finish = start;
|
||||||
ParagraphList::iterator const end = pars.end();
|
ParagraphList::iterator const end = pars.end();
|
||||||
@ -808,7 +808,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
ParagraphList & pars = buf.text().paragraphs();
|
ParagraphList & pars = buf.text().paragraphs();
|
||||||
ParagraphList::iterator bgn = pars.begin();
|
ParagraphList::iterator bgn = pars.begin();
|
||||||
// The first paragraph of the area to be selected:
|
// The first paragraph of the area to be selected:
|
||||||
ParagraphList::iterator start = next(bgn, pit);
|
ParagraphList::iterator start = lyx::next(bgn, pit);
|
||||||
// The final paragraph of area to be selected:
|
// The final paragraph of area to be selected:
|
||||||
ParagraphList::iterator finish = start;
|
ParagraphList::iterator finish = start;
|
||||||
ParagraphList::iterator end = pars.end();
|
ParagraphList::iterator end = pars.end();
|
||||||
|
@ -327,8 +327,8 @@ void docbookParagraphs(Text const & text,
|
|||||||
|
|
||||||
// if only part of the paragraphs will be outputed
|
// if only part of the paragraphs will be outputed
|
||||||
if (runparams.par_begin != runparams.par_end) {
|
if (runparams.par_begin != runparams.par_end) {
|
||||||
par = next(paragraphs.begin(), runparams.par_begin);
|
par = lyx::next(paragraphs.begin(), runparams.par_begin);
|
||||||
pend = next(paragraphs.begin(), runparams.par_end);
|
pend = lyx::next(paragraphs.begin(), runparams.par_end);
|
||||||
// runparams will be passed to nested paragraphs, so
|
// runparams will be passed to nested paragraphs, so
|
||||||
// we have to reset the range parameters.
|
// we have to reset the range parameters.
|
||||||
const_cast<OutputParams&>(runparams).par_begin = 0;
|
const_cast<OutputParams&>(runparams).par_begin = 0;
|
||||||
|
@ -470,9 +470,9 @@ void latexArgInsets(ParagraphList const & pars, ParagraphList::const_iterator pi
|
|||||||
// get the first paragraph in sequence with this layout and depth
|
// get the first paragraph in sequence with this layout and depth
|
||||||
pit_type offset = 0;
|
pit_type offset = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
if (prev(pit, offset) == pars.begin())
|
if (lyx::prev(pit, offset) == pars.begin())
|
||||||
break;
|
break;
|
||||||
ParagraphList::const_iterator priorpit = prev(pit, offset + 1);
|
ParagraphList::const_iterator priorpit = lyx::prev(pit, offset + 1);
|
||||||
if (priorpit->layout() == current_layout
|
if (priorpit->layout() == current_layout
|
||||||
&& priorpit->params().depth() == current_depth)
|
&& priorpit->params().depth() == current_depth)
|
||||||
++offset;
|
++offset;
|
||||||
@ -480,7 +480,7 @@ void latexArgInsets(ParagraphList const & pars, ParagraphList::const_iterator pi
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ParagraphList::const_iterator spit = prev(pit, offset);
|
ParagraphList::const_iterator spit = lyx::prev(pit, offset);
|
||||||
|
|
||||||
for (; spit != pars.end(); ++spit) {
|
for (; spit != pars.end(); ++spit) {
|
||||||
if (spit->layout() != current_layout || spit->params().depth() < current_depth)
|
if (spit->layout() != current_layout || spit->params().depth() < current_depth)
|
||||||
|
Loading…
Reference in New Issue
Block a user