diff --git a/src/ChangeLog b/src/ChangeLog index 8bd527b6df..ae0036fe94 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -8,6 +8,7 @@ * paragraph.[Ch]: paragraph_pimpl.[Ch]: + paragraph_funcs.C: undo_funcs.C: Paragraph * -> Paragraph (const) & 2003-04-28 John Levon diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index e0312bdaeb..c89053e5d9 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -133,7 +133,7 @@ pitPosPair CutAndPaste::eraseSelection(ParagraphList & pars, // paste the paragraphs again, if possible if (all_erased && - (startpit->hasSameLayout(&*boost::next(startpit)) || + (startpit->hasSameLayout(*boost::next(startpit)) || boost::next(startpit)->empty())) { #warning current_view used here. // should we pass buffer or buffer->params around? @@ -289,7 +289,7 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar, // make the buf exactly the same layout than // the cursor paragraph - paragraphs.begin()->makeSameLayout(*par); + paragraphs.begin()->makeSameLayout(**par); // find the end of the buffer ParagraphList::iterator lastbuffer = paragraphs.begin(); @@ -325,14 +325,14 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar, pos = lastbuffer->size(); // maybe some pasting if (lastbuffer->next() && paste_the_end) { - if (lastbuffer->next()->hasSameLayout(&*lastbuffer)) { + if (lastbuffer->next()->hasSameLayout(*lastbuffer)) { mergeParagraph(current_view->buffer()->params, current_view->buffer()->paragraphs, lastbuffer); } else if (!lastbuffer->next()->size()) { - lastbuffer->next()->makeSameLayout(&*lastbuffer); + lastbuffer->next()->makeSameLayout(*lastbuffer); mergeParagraph(current_view->buffer()->params, current_view->buffer()->paragraphs, lastbuffer); } else if (!lastbuffer->size()) { - lastbuffer->makeSameLayout(lastbuffer->next()); + lastbuffer->makeSameLayout(*lastbuffer->next()); mergeParagraph(current_view->buffer()->params, current_view->buffer()->paragraphs, lastbuffer); } else diff --git a/src/paragraph.C b/src/paragraph.C index 3f9b040ab0..b46293a4db 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -664,11 +664,11 @@ Paragraph const * Paragraph::previous() const #endif -void Paragraph::makeSameLayout(Paragraph const * par) +void Paragraph::makeSameLayout(Paragraph const & par) { - layout(par->layout()); + layout(par.layout()); // move to pimpl? - params() = par->params(); + params() = par.params(); } @@ -687,11 +687,11 @@ int Paragraph::stripLeadingSpaces() } -bool Paragraph::hasSameLayout(Paragraph const * par) const +bool Paragraph::hasSameLayout(Paragraph const & par) const { return - par->layout() == layout() && - params().sameLayout(par->params()); + par.layout() == layout() && + params().sameLayout(par.params()); } diff --git a/src/paragraph.h b/src/paragraph.h index e06f6ff933..056a0bc1ba 100644 --- a/src/paragraph.h +++ b/src/paragraph.h @@ -106,10 +106,10 @@ public: TexRow & texrow, bool moving_arg); /// - bool hasSameLayout(Paragraph const * par) const; + bool hasSameLayout(Paragraph const & par) const; /// - void makeSameLayout(Paragraph const * par); + void makeSameLayout(Paragraph const & par); /// Inset * inInset() const; diff --git a/src/paragraph_funcs.C b/src/paragraph_funcs.C index 306afd958b..1b15479f39 100644 --- a/src/paragraph_funcs.C +++ b/src/paragraph_funcs.C @@ -149,7 +149,7 @@ void breakParagraphConservative(BufferParams const & bparams, // create a new paragraph ParagraphList::iterator tmp = paragraphs.insert(boost::next(par), new Paragraph); - tmp->makeSameLayout(&*par); + tmp->makeSameLayout(*par); // When can pos > Last()? // I guess pos == Last() is possible. @@ -457,7 +457,7 @@ TeXOnePar(Buffer const * buf, } if (!pit->params().spacing().isDefault() - && (pit == paragraphs.begin() || !boost::prior(pit)->hasSameLayout(&*pit))) { + && (pit == paragraphs.begin() || !boost::prior(pit)->hasSameLayout(*pit))) { os << pit->params().spacing().writeEnvirBegin() << '\n'; texrow.newline(); } @@ -637,7 +637,7 @@ TeXOnePar(Buffer const * buf, } if (!pit->params().spacing().isDefault() - && (boost::next(pit) == paragraphs.end()|| !boost::next(pit)->hasSameLayout(&*pit))) { + && (boost::next(pit) == paragraphs.end()|| !boost::next(pit)->hasSameLayout(*pit))) { os << pit->params().spacing().writeEnvirEnd() << '\n'; texrow.newline(); }