parlist-22-a.diff

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7055 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2003-05-27 20:59:03 +00:00
parent 4882d49f88
commit 63a7d2f93c
6 changed files with 13 additions and 17 deletions

View File

@ -315,17 +315,4 @@ bool ParagraphList::empty() const
return parlist == 0;
}
ParagraphList::iterator ParagraphList::find(Paragraph const & p)
{
iterator it = begin();
iterator last = end();
for (;it != last; ++it) {
if (&*it == &p)
break;
}
return it;
}
#endif

View File

@ -99,8 +99,6 @@ public:
int size() const;
///
bool empty() const;
///
iterator find(Paragraph const &);
private:
///
Paragraph * parlist;

View File

@ -1396,3 +1396,10 @@ bool Paragraph::isFreeSpacing() const
return (pimpl_->inset_owner->owner()->lyxCode() == Inset::ERT_CODE);
return false;
}
bool operator==(Paragraph const & lhs, Paragraph const & rhs)
{
#warning FIXME this implementatoin must be completely wrong...
return &lhs == &rhs;
}

View File

@ -337,4 +337,6 @@ inline bool isDeletedText(Paragraph const & par, lyx::pos_type pos)
return par.lookupChange(pos) == Change::DELETED;
}
bool operator==(Paragraph const & lhs, Paragraph const & rhs);
#endif // PARAGRAPH_H

View File

@ -147,7 +147,9 @@ int LyXText::workWidth() const
int LyXText::workWidth(Inset const * inset) const
{
ParagraphList::iterator par = ownerParagraphs().find(*inset->parOwner());
ParagraphList::iterator par = std::find(ownerParagraphs().begin(),
ownerParagraphs().end(),
*inset->parOwner());
//lyx::Assert(par);
pos_type pos = par->getPositionOfInset(inset);

View File

@ -1197,7 +1197,7 @@ void LyXText::setCounter(Buffer const * buf, ParagraphList::iterator pit)
isOK = true;
break;
} else {
tmppit = ownerParagraphs().find(*in->parOwner());
tmppit = std::find(ownerParagraphs().begin(), ownerParagraphs().end(), *in->parOwner());
}
}