diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index bc9afbe980..ca094a33e0 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -147,7 +147,7 @@ pasteSelectionHelper(LCursor & cur, ParagraphList const & parlist, for (pos_type j = 0; j < insertion[i].size(); ++j) { if (insertion[i].isNewline(j)) { // do not track deletion of newline - insertion[i].erase(j, false); + insertion[i].eraseChar(j, false); breakParagraphConservative( buffer.params(), insertion, i, j); @@ -207,7 +207,7 @@ pasteSelectionHelper(LCursor & cur, ParagraphList const & parlist, if (tmpbuf->getChar(i) == Paragraph::META_INSET && !pars[pit].insetAllowed(tmpbuf->getInset(i)->lyxCode())) // do not track deletion of invalid insets - tmpbuf->erase(i--, false); + tmpbuf->eraseChar(i--, false); } // FIXME: Change tracking (MG) @@ -309,7 +309,7 @@ PitPosPair eraseSelectionHelper(BufferParams const & params, // Start and end is inside same paragraph if (endpit == pit_type(pars.size()) || startpit == endpit) { - endpos -= pars[startpit].erase(startpos, endpos); + endpos -= pars[startpit].erase(startpos, endpos, false); return PitPosPair(endpit, endpos); } @@ -325,7 +325,7 @@ PitPosPair eraseSelectionHelper(BufferParams const & params, pos_type const right = ( pit == endpit ? endpos : pars[pit].size() + 1 ); // Logical erase only: - pars[pit].erase(left, right); + pars[pit].erase(left, right, false); // Separate handling of para break: if (merge && pit != endpit && (pit + 1 != endpit || pars[pit].hasSameLayout(pars[pit + 1]))) { @@ -363,11 +363,11 @@ void copySelectionHelper(Buffer const & buf, ParagraphList & pars, // Cut out the end of the last paragraph. Paragraph & back = paragraphs.back(); - back.erase(end, back.size()); + back.erase(end, back.size(), false); // Cut out the begin of the first paragraph Paragraph & front = paragraphs.front(); - front.erase(0, start); + front.erase(0, start, false); theCuts.push(make_pair(paragraphs, tc)); } diff --git a/src/insets/insettext.C b/src/insets/insettext.C index f84cf778a7..8dcd726735 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -354,7 +354,7 @@ void InsetText::setAutoBreakRows(bool flag) if (it->isNewline(i)) // do not track the change, because the user // is not allowed to revert/reject it - it->erase(i, false); + it->eraseChar(i, false); } diff --git a/src/paragraph.C b/src/paragraph.C index 9010c67556..235963b5a4 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -236,9 +236,9 @@ void Paragraph::validate(LaTeXFeatures & features) const } -bool Paragraph::erase(pos_type pos, bool trackChanges) +bool Paragraph::eraseChar(pos_type pos, bool trackChanges) { - return pimpl_->erase(pos, trackChanges); + return pimpl_->eraseChar(pos, trackChanges); } @@ -570,7 +570,7 @@ int Paragraph::stripLeadingSpaces() int i = 0; while (!empty() && (isNewline(0) || isLineSeparator(0)) && (lookupChange(0).type != Change::DELETED)) { - erase(0, false); // no change tracking here + eraseChar(0, false); // no change tracking here ++i; } diff --git a/src/paragraph.h b/src/paragraph.h index 20b2efadab..6afb9fa106 100644 --- a/src/paragraph.h +++ b/src/paragraph.h @@ -241,7 +241,7 @@ public: void applyLayout(LyXLayout_ptr const & new_layout); /// erase the char at the given position - bool erase(pos_type pos, bool trackChanges); + bool eraseChar(pos_type pos, bool trackChanges); /// erase the given range. Returns the number of chars actually erased int erase(pos_type start, pos_type end, bool trackChanges); diff --git a/src/paragraph_funcs.C b/src/paragraph_funcs.C index 22aee75fa5..1b739e2695 100644 --- a/src/paragraph_funcs.C +++ b/src/paragraph_funcs.C @@ -116,7 +116,7 @@ void breakParagraph(BufferParams const & bparams, for (pos_type i = pos_end; i >= pos; --i) // FIXME: change tracking (MG) - par.erase(i, false); // erase without change tracking + par.eraseChar(i, false); // erase without change tracking } if (pos) { @@ -189,7 +189,7 @@ void breakParagraphConservative(BufferParams const & bparams, // FIXME: Change tracking (MG) par.setChange(k, Change(Change::INSERTED)); // FIXME: change tracking (MG) - par.erase(k, false); + par.eraseChar(k, false); } } } diff --git a/src/paragraph_pimpl.C b/src/paragraph_pimpl.C index 3dd8318301..c9b7b01f80 100644 --- a/src/paragraph_pimpl.C +++ b/src/paragraph_pimpl.C @@ -155,7 +155,7 @@ void Paragraph::Pimpl::acceptChange(pos_type start, pos_type end) // Suppress access to nonexistent // "end-of-paragraph char": if (i < size()) { - erase(i); + eraseChar(i); --end; --i; } @@ -185,7 +185,7 @@ void Paragraph::Pimpl::rejectChange(pos_type start, pos_type end) case Change::INSERTED: if (i < size()) { - erase(i); + eraseChar(i); --end; --i; } @@ -260,7 +260,7 @@ void Paragraph::Pimpl::insertInset(pos_type pos, } -void Paragraph::Pimpl::erase(pos_type pos) +void Paragraph::Pimpl::eraseChar(pos_type pos) { // FIXME: change tracking (MG) // do something like changes_.erase(i); @@ -309,7 +309,7 @@ void Paragraph::Pimpl::erase(pos_type pos) } -bool Paragraph::Pimpl::erase(pos_type pos, bool /*trackChanges*/) +bool Paragraph::Pimpl::eraseChar(pos_type pos, bool /*trackChanges*/) { BOOST_ASSERT(pos <= size()); @@ -329,7 +329,7 @@ bool Paragraph::Pimpl::erase(pos_type pos, bool /*trackChanges*/) // Don't physically access nonexistent end-of-paragraph char if (pos < size()) { - erase(pos); + eraseChar(pos); return true; } @@ -341,7 +341,7 @@ int Paragraph::Pimpl::erase(pos_type start, pos_type end, bool trackChanges) { pos_type i = start; for (pos_type count = end - start; count; --count) { - if (!erase(i, trackChanges)) + if (!eraseChar(i, trackChanges)) ++i; } return end - i; diff --git a/src/paragraph_pimpl.h b/src/paragraph_pimpl.h index 837b2add27..98d588a67c 100644 --- a/src/paragraph_pimpl.h +++ b/src/paragraph_pimpl.h @@ -61,9 +61,9 @@ public: /// void insertInset(pos_type pos, InsetBase * inset, Change const & change); /// definite erase - void erase(pos_type pos); + void eraseChar(pos_type pos); /// erase the given position. Returns true if it was actually erased - bool erase(pos_type pos, bool trackChanges); + bool eraseChar(pos_type pos, bool trackChanges); /// erase the given range int erase(pos_type start, pos_type end, bool trackChanges); /// diff --git a/src/text.C b/src/text.C index bf020191e6..e0bd609b05 100644 --- a/src/text.C +++ b/src/text.C @@ -1101,7 +1101,7 @@ void LyXText::breakParagraph(LCursor & cur, bool keep_layout) // It is better to erase the space (Dekel) if (cur.pos() != cur.lastpos() && cpar.isLineSeparator(cur.pos())) // FIXME: change tracking (MG) - cpar.erase(cur.pos(), cur.buffer().params().trackChanges); + cpar.eraseChar(cur.pos(), cur.buffer().params().trackChanges); // How should the layout for the new paragraph be? int preserve_layout = 0; @@ -1137,7 +1137,7 @@ void LyXText::breakParagraph(LCursor & cur, bool keep_layout) while (!pars_[next_par].empty() && pars_[next_par].isNewline(0)) // FIXME: change tracking (MG) - pars_[next_par].erase(0, cur.buffer().params().trackChanges); + pars_[next_par].eraseChar(0, cur.buffer().params().trackChanges); ParIterator current_it(cur); ParIterator last_it(cur); @@ -1787,7 +1787,7 @@ bool LyXText::backspace(LCursor & cur) setCursorIntern(cur, cur.pit(), cur.pos() - 1, false, cur.boundary()); // FIXME: change tracking (MG) - cur.paragraph().erase(cur.pos(), cur.buffer().params().trackChanges); + cur.paragraph().eraseChar(cur.pos(), cur.buffer().params().trackChanges); } if (cur.pos() == cur.lastpos()) @@ -1820,7 +1820,7 @@ bool LyXText::dissolveInset(LCursor & cur) { spit += cur.pit(); Buffer & b = cur.buffer(); // FIXME: change tracking (MG) - cur.paragraph().erase(cur.pos(), b.params().trackChanges); + cur.paragraph().eraseChar(cur.pos(), b.params().trackChanges); if (!plist.empty()) { pasteParagraphList(cur, plist, b.params().textclass, b.errorList("Paste")); diff --git a/src/text2.C b/src/text2.C index 3ab916a9c1..cfb1a824b9 100644 --- a/src/text2.C +++ b/src/text2.C @@ -1262,7 +1262,7 @@ bool LyXText::deleteEmptyParagraphMechanism(LCursor & cur, LCursor & old) && oldpar.isLineSeparator(old.pos()) && oldpar.isLineSeparator(old.pos() - 1) && oldpar.lookupChange(old.pos() - 1).type != Change::DELETED) { - oldpar.erase(old.pos() - 1, false); // do not track changes in DEPM + oldpar.eraseChar(old.pos() - 1, false); // do not track changes in DEPM #ifdef WITH_WARNINGS #warning This will not work anymore when we have multiple views of the same buffer // In this case, we will have to correct also the cursors held by