2003-03-04 Lars Gullik Bjønnes <larsbj@gullik.net>
+ * paragraph_funcs.C (breakParagraph): take ParagraphList::iterator
+ as arg
+ (breakParagraphConservative): ditto
+
+ * paragraph.h: remove the breakParagraph friend
+
+ * paragraph.C (eraseIntern): new function
+ (setChange): new function
+
* paragraph_funcs.C (mergeParagraph): make it take a
ParagraphList::iterator instead of a Paragraph *, adjust
accordingly.
// end of minibuffer
+void Paragraph::eraseIntern(lyx::pos_type pos)
+{
+ pimpl_->eraseIntern(pos);
+}
+
+
void Paragraph::erase(pos_type pos)
{
pimpl_->erase(pos);
}
+void Paragraph::setChange(lyx::pos_type pos, Change::Type type)
+{
+ pimpl_->setChange(pos, type);
+
+}
+
+
void Paragraph::markErased()
{
pimpl_->markErased();
/// is there a non-addition in this range ?
bool isChangeEdited(lyx::pos_type start, lyx::pos_type end) const;
+ /// set change at pos
+ void setChange(lyx::pos_type pos, Change::Type type);
+
/// accept change
void acceptChange(lyx::pos_type start, lyx::pos_type end);
///
void applyLayout(LyXLayout_ptr const & new_layout);
+ /// definite erase
+ void eraseIntern(lyx::pos_type pos);
/// erase the char at the given position
void erase(lyx::pos_type pos);
/// erase the given range. Returns true if actually erased.
InsetList insetlist;
///
//Counters & counters();
-
- friend void breakParagraph(BufferParams const & bparams,
- Paragraph * par, lyx::pos_type pos, int flag);
-
private:
///
LyXLayout_ptr layout_;
using std::ostream;
void breakParagraph(BufferParams const & bparams,
- Paragraph * par,
+ ParagraphList::iterator par,
pos_type pos,
int flag)
{
- // create a new paragraph
- Paragraph * tmp = new Paragraph(par);
+ // create a new paragraph, and insert into the list
+ Paragraph * tmp = new Paragraph(&*par);
// without doing that we get a crash when typing <Return> at the
// end of a paragraph
tmp->layout(bparams.getLyXTextClass().defaultLayout());
Change::Type change(par->lookupChange(i));
par->cutIntoMinibuffer(bparams, i);
if (tmp->insertFromMinibuffer(j - pos)) {
- tmp->pimpl_->setChange(j - pos, change);
+ tmp->setChange(j - pos, change);
++j;
}
}
for (i = pos_end; i >= pos; --i) {
- par->pimpl_->eraseIntern(i);
+ par->eraseIntern(i);
}
}
void breakParagraphConservative(BufferParams const & bparams,
- Paragraph * par,
+ ParagraphList::iterator par,
pos_type pos)
{
// create a new paragraph
- Paragraph * tmp = new Paragraph(par);
- tmp->makeSameLayout(par);
+ Paragraph * tmp = new Paragraph(&*par);
+ tmp->makeSameLayout(&*par);
// When can pos > Last()?
// I guess pos == Last() is possible.
///
void breakParagraph(BufferParams const & bparams,
- Paragraph *,
+ ParagraphList::iterator par,
lyx::pos_type pos,
int flag);
///
void breakParagraphConservative(BufferParams const & bparams,
- Paragraph *,
+ ParagraphList::iterator par,
lyx::pos_type pos);
/**
* Append the next paragraph onto the tail of this one.
* Be careful, this doesent make any check at all.
*/
-void mergeParagraph(BufferParams const & bparams, ParagraphList::iterator);
+void mergeParagraph(BufferParams const & bparams,
+ ParagraphList::iterator par);
#if 0