Rename Paragraph::setBuffer to Paragraph::setInsetBuffers, to avoid

confusion about what this routine does.
This commit is contained in:
Richard Heck 2017-10-15 22:14:08 -04:00
parent 66e1819ad1
commit 0bcb9732c5
6 changed files with 8 additions and 8 deletions

View File

@ -736,7 +736,7 @@ bool Compare::Impl::diff(Buffer const * new_buf, Buffer const * old_buf,
diff_i(rp_new); diff_i(rp_new);
for (pit_type p = 0; p < (pit_type)dest_pars_->size(); ++p) { for (pit_type p = 0; p < (pit_type)dest_pars_->size(); ++p) {
(*dest_pars_)[p].setBuffer(const_cast<Buffer &>(*dest_buf)); (*dest_pars_)[p].setInsetBuffers(const_cast<Buffer &>(*dest_buf));
(*dest_pars_)[p].setInsetOwner(&dest_buf_->inset()); (*dest_pars_)[p].setInsetOwner(&dest_buf_->inset());
} }

View File

@ -422,7 +422,7 @@ pasteSelectionHelper(DocIterator const & cur, ParagraphList const & parlist,
// Set paragraph buffers. It's important to do this right away // Set paragraph buffers. It's important to do this right away
// before something calls Inset::buffer() and causes a crash. // before something calls Inset::buffer() and causes a crash.
for (pit_type p = startpit; p <= pit; ++p) for (pit_type p = startpit; p <= pit; ++p)
pars[p].setBuffer(const_cast<Buffer &>(buffer)); pars[p].setInsetBuffers(const_cast<Buffer &>(buffer));
// Join (conditionally) last pasted paragraph with next one, i.e., // Join (conditionally) last pasted paragraph with next one, i.e.,
// the tail of the spliced document paragraph // the tail of the spliced document paragraph
@ -631,7 +631,7 @@ void copySelectionHelper(Buffer const & buf, Text const & text,
// do not have a proper buffer reference. It makes // do not have a proper buffer reference. It makes
// sense to add them temporarily, because the // sense to add them temporarily, because the
// operations below depend on that (acceptChanges included). // operations below depend on that (acceptChanges included).
it->setBuffer(const_cast<Buffer &>(buf)); it->setInsetBuffers(const_cast<Buffer &>(buf));
// PassThru paragraphs have the Language // PassThru paragraphs have the Language
// latex_language. This is invalid for others, so we // latex_language. This is invalid for others, so we
// need to change it to the buffer language. // need to change it to the buffer language.
@ -827,7 +827,7 @@ vector<docstring> availableSelections(Buffer const * buf)
for (; pit != pend; ++pit) { for (; pit != pend; ++pit) {
Paragraph par(*pit, 0, 46); Paragraph par(*pit, 0, 46);
// adapt paragraph to current buffer. // adapt paragraph to current buffer.
par.setBuffer(const_cast<Buffer &>(*buf)); par.setInsetBuffers(const_cast<Buffer &>(*buf));
textSel += par.asString(AS_STR_INSETS); textSel += par.asString(AS_STR_INSETS);
if (textSel.size() > 45) { if (textSel.size() > 45) {
support::truncateWithEllipsis(textSel,45); support::truncateWithEllipsis(textSel,45);

View File

@ -3673,7 +3673,7 @@ InsetList const & Paragraph::insetList() const
} }
void Paragraph::setBuffer(Buffer & b) void Paragraph::setInsetBuffers(Buffer & b)
{ {
d->insetlist_.setBuffer(b); d->insetlist_.setBuffer(b);
} }

View File

@ -397,7 +397,7 @@ public:
/// ///
InsetList const & insetList() const; InsetList const & insetList() const;
/// ///
void setBuffer(Buffer &); void setInsetBuffers(Buffer &);
/// ///
void resetBuffer(); void resetBuffer();

View File

@ -504,7 +504,7 @@ void Undo::Private::doTextUndoOrRedo(CursorData & cur, UndoElementStack & stack,
ParagraphList::iterator fend = fpit; ParagraphList::iterator fend = fpit;
advance(fend, undo.pars->size()); advance(fend, undo.pars->size());
for (; fpit != fend; ++fpit) for (; fpit != fend; ++fpit)
fpit->setBuffer(buffer_); fpit->setInsetBuffers(buffer_);
delete undo.pars; delete undo.pars;
undo.pars = 0; undo.pars = 0;

View File

@ -97,7 +97,7 @@ void InsetText::setBuffer(Buffer & buf)
{ {
ParagraphList::iterator end = paragraphs().end(); ParagraphList::iterator end = paragraphs().end();
for (ParagraphList::iterator it = paragraphs().begin(); it != end; ++it) for (ParagraphList::iterator it = paragraphs().begin(); it != end; ++it)
it->setBuffer(buf); it->setInsetBuffers(buf);
Inset::setBuffer(buf); Inset::setBuffer(buf);
} }